diff --git a/.travis.yml b/.travis.yml index d2c743e32..f3236e979 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,9 @@ matrix: - liblapack-dev - python-numpy - python-dev -# - swig +# - swig3.0 + env: + - PYTHON_CFLAGS="-I/usr/include/python2.7" - os: linux compiler: gcc addons: @@ -25,7 +27,9 @@ matrix: - liblapack-dev - python-numpy - python-dev -# - swig +# - swig3.0 + env: + - PYTHON_CFLAGS="-I/usr/include/python2.7" - os: linux compiler: gcc addons: @@ -35,7 +39,9 @@ matrix: - liblapack-dev - python-numpy - python-dev -# - swig +# - swig3.0 + env: + - PYTHON_CFLAGS="-I/usr/include/python2.7" - os: linux compiler: clang addons: @@ -45,8 +51,9 @@ matrix: - liblapack-dev - python-numpy - python-dev -# - swig +# - swig3.0 env: + - PYTHON_CFLAGS="-I/usr/include/python2.7" # NOTE: Hack, c.f. https://github.com/travis-ci/travis-ci/issues/8613 - LD_LIBRARY_PATH="/usr/local/clang/lib" - os: osx @@ -69,8 +76,9 @@ install: - ./.travis/install.sh - aclocal - autoconf - - ./configure + - ./configure --without-cuda - make + - make -C python script: - make test diff --git a/.travis/install.sh b/.travis/install.sh index aaf3683fa..dbaeca41b 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -7,7 +7,7 @@ function installswig() { cd /tmp/ && wget https://github.com/swig/swig/archive/rel-3.0.12.tar.gz && tar zxf rel-3.0.12.tar.gz && cd swig-rel-3.0.12 && - ./autogen.sh && ./configure --prefix "${HOME}"/swig/ 1>/dev/null && + ./autogen.sh && ./configure --prefix "${HOME}" 1>/dev/null && make >/dev/null && make install >/dev/null } diff --git a/Dockerfile b/Dockerfile index ad882f509..e85da3c75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,38 +1,30 @@ -FROM nvidia/cuda:8.0-devel-ubuntu16.04 -MAINTAINER Pierre Letessier +FROM nvidia/cuda:8.0-devel-centos7 -RUN apt-get update -y -RUN apt-get install -y libopenblas-dev python-numpy python-dev swig git python-pip wget +# Install MKL +RUN yum-config-manager --add-repo https://yum.repos.intel.com/mkl/setup/intel-mkl.repo +RUN rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB +RUN yum install -y intel-mkl-2019.3-062 +ENV LD_LIBRARY_PATH /opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH +ENV LIBRARY_PATH /opt/intel/mkl/lib/intel64:$LIBRARY_PATH +ENV LD_PRELOAD /usr/lib64/libgomp.so.1:/opt/intel/mkl/lib/intel64/libmkl_def.so:\ +/opt/intel/mkl/lib/intel64/libmkl_avx2.so:/opt/intel/mkl/lib/intel64/libmkl_core.so:\ +/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so:/opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so -RUN pip install --upgrade pip -RUN pip install matplotlib +# Install necessary build tools +RUN yum install -y gcc-c++ make swig3 + +# Install necesary headers/libs +RUN yum install -y python-devel numpy COPY . /opt/faiss WORKDIR /opt/faiss -ENV BLASLDFLAGS /usr/lib/libopenblas.so.0 - -RUN mv example_makefiles/makefile.inc.Linux ./makefile.inc - -RUN make tests/test_blas -j $(nproc) && \ - make -j $(nproc) && \ - make demos/demo_sift1M -j $(nproc) && \ - make py - -RUN cd gpu && \ - make -j $(nproc) && \ - make test/demo_ivfpq_indexing_gpu && \ - make py - -ENV PYTHONPATH $PYTHONPATH:/opt/faiss - -# RUN ./tests/test_blas && \ -# tests/demo_ivfpq_indexing - - -# RUN wget ftp://ftp.irisa.fr/local/texmex/corpus/sift.tar.gz && \ -# tar xf sift.tar.gz && \ -# mv sift sift1M - -# RUN tests/demo_sift1M +# --with-cuda=/usr/local/cuda-8.0 +RUN ./configure --without-cuda +RUN make -j $(nproc) +RUN make -C python +RUN make test +RUN make install +RUN make -C demos demo_ivfpq_indexing && \ + LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./demos/demo_ivfpq_indexing diff --git a/INSTALL.md b/INSTALL.md index 8bf720d0d..fae5ec0fb 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,39 +8,32 @@ INSTALL file for Faiss (Fair AI Similarity Search) Install via Conda ----------------- -The easiest way to install FAISS is from anaconda. We regularly push stable releases to conda channel. FAISS conda package is built with conda gcc, depends on libgcc, mkl and numpy package shipped in conda in runtime. +The easiest way to install FAISS is from Anaconda. We regularly push stable releases to the pytorch conda channel. -Currently we support faiss-cpu on both Linux and OSX platforms. We also provide faiss-gpu compiled with CUDA8.0/CUDA9.0/CUDA9.2 on Linux systems. +Currently we support faiss-cpu both on Linux and OSX. We also provide faiss-gpu compiled with CUDA8/CUDA9/CUDA10 on Linux systems. You can easily install it by ``` # CPU version only conda install faiss-cpu -c pytorch -# Make sure you have CUDA installed before installing faiss-gpu, otherwise it falls back to CPU version -conda install faiss-gpu -c pytorch # [DEFAULT]For CUDA8.0 -conda install faiss-gpu cuda90 -c pytorch # For CUDA9.0 -conda install faiss-gpu cuda92 -c pytorch # For CUDA9.2 -# cuda90/cuda91 shown above is a feature, it doesn't install CUDA for you. + +# GPU version +conda install faiss-gpu cudatoolkit=8.0 -c pytorch # For CUDA8 +conda install faiss-gpu cudatoolkit=9.0 -c pytorch # For CUDA9 +conda install faiss-gpu cudatoolkit=10.0 -c pytorch # For CUDA10 ``` Compile from source ------------------- -The Faiss compilation works in 3 steps, from easiest to most -involved: +The Faiss compilation works in 2 steps: 1. compile the C++ core and examples 2. compile the Python interface -3. compile GPU part - -Steps 2 and 3 depend on 1, but they are otherwise independent. - -Alternatively, all 3 steps above can be run by building a Docker image (see -section "Docker instructions" below). - +Steps 2 depends on 1. It is also possible to build a pure C interface. This optional process is described separately (please see the [C interface installation file](c_api/INSTALL.md)) @@ -48,20 +41,48 @@ described separately (please see the [C interface installation file](c_api/INSTA General compilation instructions ================================ +TL;DR: `./configure && make (&& make install)` for the C++ library, and then `cd python; make && make install` for the python interface. + +1. `./configure` + +This generates the system-dependent configuration for the `Makefile`, stored in +a file called `makefile.inc`. + +A few useful options: +- `./configure --without-cuda` in order to build the CPU part only. +- `./configure --with-cuda=/path/to/cuda-10.1` in order to hint to the path of +the cudatoolkit. +- `./configure --with-cuda-arch="-gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_72,code=sm_72"` for specifying which GPU architectures to build against. +- `./configure --with-python=/path/to/python3.7` in order to build a python +interface for a different python than the default one. + +2. `make` + +This builds the C++ library (the whole library if a suitable cuda toolkit was +found, or the CPU part only otherwise). + +3. `make install` (optional) + +This installs the headers and libraries. + +4. `make -C python` (or `make py`) + +This builds the python interface. + +5. `make -C python install` + +This installs the python library. + + Faiss has been tested only on x86_64 machines on Linux and Mac OS. -Faiss is compiled via a Makefile. The system-dependent configuration -of the Makefile is in an include file, makefile.inc. The variables in -makefile.inc must be set by hand. - Faiss requires a C++ compiler that understands: -- the Intel intrinsics for SSE instructions -- the GCC intrinsic for the popcount instruction -- basic OpenMP +- the Intel intrinsics for SSE instructions, +- the GCC intrinsic for the popcount instruction, +- basic OpenMP. -There are a few models for makefile.inc in the example_makefiles/ -subdirectory. Copy the relevant one for your system and adjust to your -needs. There are also indications for specific configurations in the +There are a few examples for makefile.inc in the example_makefiles/ +subdirectory. There are also indications for specific configurations in the troubleshooting section of the wiki. https://github.com/facebookresearch/faiss/wiki/Troubleshooting @@ -70,14 +91,6 @@ Faiss comes as a .a archive, that can be linked with executables or dynamic libraries (useful for the Python wrapper). -Step 1: Compiling the C++ Faiss -=============================== - -TL;DR: `./configure && make && make install` - - -The CPU version of Faiss is written in C++11. - BLAS/Lapack ----------- @@ -103,17 +116,6 @@ and run `./misc/test_blas` -Building faiss -------------- - -Once the proper BLAS flags are set, the library should compile -smoothly by running - - `make` - -Then, in order to install the library and the headers, run - - `make install` Testing Faiss ------------- @@ -122,13 +124,18 @@ A basic usage example is in `demos/demo_ivfpq_indexing` -it makes a small index, stores it and performs some searches. A normal +which you can build by calling + `make -C demos demo_ivfpq_indexing` + +It makes a small index, stores it and performs some searches. A normal runtime is around 20s. With a fast machine and Intel MKL's BLAS it runs in 2.5s. To run the whole test suite: - `make test` + `make test` (for the CPU part) + + `make test_gpu` (for the GPU part) A real-life benchmark @@ -154,16 +161,12 @@ setting a different index_key to find the indexing structure that gives the best performance. -Step 2: Compiling the Python interface +The Python interface ====================================== The Python interface is compiled with - `make py` - -If you want to compile it for another python version than the default -Python 2.7, in particular Python 3, the PYTHONCFLAGS must be adjusted in -makefile.inc, see the examples. + `make -C python` (or `make py`) How it works ------------ @@ -172,18 +175,7 @@ The Python interface is provided via SWIG (Simple Wrapper and Interface Generator) and an additional level of manual wrappers (in python/faiss.py). SWIG generates two wrapper files: a Python file (`python/swigfaiss.py`) and a -C++ file that must be compiled to a dynamic library (`python/_swigfaiss.so`). These -files are included in the repository, so running swig is only required when -the C++ headers of Faiss are changed. - -The C++ compilation to the dynamic library requires to set: - -- `SHAREDFLAGS`: system-specific flags to generate a dynamic library - -- `PYTHONCFLAGS`: include flags for Python - -See the example makefile.inc's on how to set the flags. - +C++ file that must be compiled to a dynamic library (`python/_swigfaiss.so`). Testing the Python wrapper -------------------------- @@ -227,23 +219,21 @@ operating points. You can play around with the types of indexes. Step 3: Compiling the GPU implementation ======================================== -There is a GPU-specific Makefile in the `gpu/` directory. It depends on -the same ../makefile.inc for system-specific variables. You need -libfaiss.a from Step 1 for this to work. - The GPU version is a superset of the CPU version. In addition it requires the cuda compiler and related libraries (Cublas) -See the example makefile on how to set the flags. - The nvcc-specific flags to pass to the compiler, based on your desired -compute capability. Only compute capability 3.5+ is supported. For -example, we enable by default: +compute capability can be customized by providing the `--with-cuda-arch` to +`./configure`. Only compute capability 3.5+ is supported. For example, we enable +by default: ``` --gencode arch=compute_35,code="compute_35" --gencode arch=compute_52,code="compute_52" --gencode arch=compute_60,code="compute_60" +-gencode=arch=compute_35,code=compute_35 +-gencode=arch=compute_52,code=compute_52 +-gencode=arch=compute_60,code=compute_60 +-gencode=arch=compute_61,code=compute_61 +-gencode=arch=compute_70,code=compute_70 +-gencode=arch=compute_75,code=compute_75 ``` However, look at https://developer.nvidia.com/cuda-gpus to determine @@ -256,10 +246,6 @@ nvcc, except some of them that are not recognized and that should be escaped by prefixing them with -Xcompiler. Also link flags that are prefixed with -Wl, should be passed with -Xlinker. -Then compile with - - `cd gpu; make` - You may want to add `-j 10` to use 10 threads during compile. Testing the GPU implementation @@ -267,30 +253,12 @@ Testing the GPU implementation Compile the example with - `cd gpu; make tests/demo_ivfpq_indexing_gpu` + `make -C gpu/test demo_ivfpq_indexing_gpu` This produce the GPU code equivalent to the CPU demo_ivfpq_indexing. It also shows how to translate indexed from/to the GPU. -Compiling the Python interface with GPU support ------------------------------------------------ - -Given step 2, adding support of the GPU from Python is quite -straightforward. Run - -`cd python; make _swigfaiss_gpu.so` - -The import is the same for the GPU version and the CPU-only -version. - -`python -c "import faiss"` - -Faiss tries to load the GPU version first, and in case of failure, -loads the CPU-only version. To investigate more closely the cause of -a failure, you can run: - -`python -c "import _swigfaiss_gpu"` Python example with GPU support ------------------------------- @@ -357,7 +325,7 @@ libfaiss.so (or libfaiss.dylib) the executable should be linked to one of these. If you use the static version (.a), add the LDFLAGS used in the Makefile. -For binary-only distributions, the include files should be under +For binary-only distributions, the headers should be under a `faiss/` directory, so that they can be included as ```c++ @@ -371,12 +339,12 @@ Python To import Faiss in your own Python project, you need the files ``` -faiss.py -swigfaiss.py / swigfaiss_gpu.py -_swigfaiss.so / _swigfaiss_gpu.so +__init__.py +swigfaiss.py +_swigfaiss.so ``` - -to be visible in the PYTHONPATH or in the current directory. +to be present in a `faiss/` directory visible in the PYTHONPATH or in the +current directory. Then Faiss can be used in python with ```python diff --git a/Index.h b/Index.h index 4fc2045f4..2217df670 100644 --- a/Index.h +++ b/Index.h @@ -18,8 +18,8 @@ #include #define FAISS_VERSION_MAJOR 1 -#define FAISS_VERSION_MINOR 4 -#define FAISS_VERSION_PATCH 0 +#define FAISS_VERSION_MINOR 5 +#define FAISS_VERSION_PATCH 1 /** * @namespace faiss diff --git a/Makefile b/Makefile index 29de76554..830f02768 100644 --- a/Makefile +++ b/Makefile @@ -6,19 +6,35 @@ -include makefile.inc -SRC=$(wildcard *.cpp) -OBJ=$(SRC:.cpp=.o) +HEADERS = $(wildcard *.h) +SRC = $(wildcard *.cpp) +OBJ = $(SRC:.cpp=.o) +INSTALLDIRS = $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss + +GPU_HEADERS = $(wildcard gpu/*.h gpu/impl/*.h gpu/utils/*.h) +GPU_CPPSRC = $(wildcard gpu/*.cpp gpu/impl/*.cpp gpu/utils/*.cpp) +GPU_CUSRC = $(wildcard gpu/*.cu gpu/impl/*.cu gpu/utils/*.cu \ +gpu/utils/nvidia/*.cu gpu/utils/blockselect/*.cu gpu/utils/warpselect/*.cu) +GPU_SRC = $(GPU_CPPSRC) $(GPU_CUSRC) +GPU_CPPOBJ = $(GPU_CPPSRC:.cpp=.o) +GPU_CUOBJ = $(GPU_CUSRC:.cu=.o) +GPU_OBJ = $(GPU_CPPOBJ) $(GPU_CUOBJ) +GPU_INSTALLDIRS = $(DESTDIR)$(includedir)/faiss/gpu/{impl,utils} + +ifneq ($(strip $(NVCC)),) + OBJ += $(GPU_OBJ) + INSTALLDIRS += $(GPU_INSTALLDIRS) + HEADERS += $(GPU_HEADERS) +endif ############################ # Building -default: libfaiss.a - all: libfaiss.a libfaiss.$(SHAREDEXT) libfaiss.a: $(OBJ) - ar r $@ $^ + $(AR) r $@ $^ libfaiss.$(SHAREDEXT): $(OBJ) $(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) @@ -26,8 +42,11 @@ libfaiss.$(SHAREDEXT): $(OBJ) %.o: %.cpp $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -c $< -o $@ +%.o: %.cu + $(NVCC) $(NVCCFLAGS) -g -O3 -c $< -o $@ + clean: - rm -f libfaiss.* + rm -f libfaiss.{a,$(SHAREDEXT)} rm -f $(OBJ) @@ -35,15 +54,14 @@ clean: # Installing install: libfaiss.a libfaiss.$(SHAREDEXT) installdirs - cp libfaiss.a libfaiss.$(SHAREDEXT) $(DESTDIR)$(libdir) - cp *.h $(DESTDIR)$(includedir)/faiss/ + cp libfaiss.{a,$(SHAREDEXT)} $(DESTDIR)$(libdir) + tar cf - $(HEADERS) | tar xf - -C $(DESTDIR)$(includedir)/faiss/ installdirs: - $(MKDIR_P) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss + $(MKDIR_P) $(INSTALLDIRS) uninstall: - rm $(DESTDIR)$(libdir)/libfaiss.a - rm $(DESTDIR)$(libdir)/libfaiss.$(SHAREDEXT) + rm -f $(DESTDIR)$(libdir)/libfaiss.{a,$(SHAREDEXT)} rm -rf $(DESTDIR)$(includedir)/faiss @@ -52,41 +70,44 @@ uninstall: -include depend -# The above makefile.dep is generated by the following target: -depend: - for i in $(SRC); do \ - $(CXXCPP) $(CPPFLAGS) -MM $$i; \ +depend: $(SRC) $(GPU_SRC) + for i in $^; do \ + $(CXXCPP) $(CPPFLAGS) -x c++ -MM $$i; \ done > depend +############################# +# Python + +py: libfaiss.a + $(MAKE) -C python + + ############################# # Tests test: libfaiss.a py - make -C tests run + $(MAKE) -C tests run PYTHONPATH=./python/build/`ls python/build | grep lib` \ $(PYTHON) -m unittest discover tests/ -v +test_gpu: libfaiss.a + $(MAKE) -C gpu/test run + PYTHONPATH=./python/build/`ls python/build | grep lib` \ + $(PYTHON) -m unittest discover gpu/test/ -v ############################# # Demos demos: libfaiss.a - make -C demos + $(MAKE) -C demos ############################# # Misc misc/test_blas: misc/test_blas.cpp - $(CXX) $(CXXFLAG) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -############################# -# Python - -py: - $(MAKE) -C python build - - -.PHONY: all clean default demos install installdirs py test uninstall +.PHONY: all clean demos install installdirs py test gpu_test uninstall diff --git a/acinclude/fa_check_cuda.m4 b/acinclude/fa_check_cuda.m4 index 09c7cc352..f730bc23e 100644 --- a/acinclude/fa_check_cuda.m4 +++ b/acinclude/fa_check_cuda.m4 @@ -1,28 +1,52 @@ AC_DEFUN([FA_CHECK_CUDA], [ AC_ARG_WITH(cuda, -[AS_HELP_STRING([--with-cuda=], [prefix of the CUDA installation])]) -case $with_cuda in -"") cuda_prefix=/usr/local/cuda ;; -*) cuda_prefix="$with_cuda" -esac + [AS_HELP_STRING([--with-cuda=], [prefix of the CUDA installation])]) +AC_ARG_WITH(cuda-arch, + [AS_HELP_STRING([--with-cuda-arch=], [device specific -gencode flags])], + [], + [with_cuda_arch=default]) -AC_CHECK_PROG(NVCC, "nvcc", "$cuda_prefix/bin/nvcc", "", "$cuda_prefix/bin") -fa_nvcc_bin=$NVCC +if test x$with_cuda != xno; then + if test x$with_cuda != x; then + cuda_prefix=$with_cuda + AC_CHECK_PROG(NVCC, [nvcc], [$cuda_prefix/bin/nvcc], [], [$cuda_prefix/bin]) + NVCC_CPPFLAGS="-I$cuda_prefix/include" + NVCC_LDFLAGS="-L$cuda_prefix/lib64" + else + AC_CHECK_PROGS(NVCC, [nvcc /usr/local/cuda/bin/nvcc], []) + if test "x$NVCC" == "x/usr/local/cuda/bin/nvcc"; then + cuda_prefix="/usr/local/cuda" + NVCC_CPPFLAGS="-I$cuda_prefix/include" + NVCC_LDFLAGS="-L$cuda_prefix/lib64" + else + cuda_prefix="" + NVCC_CPPFLAGS="" + NVCC_LDFLAGS="" + fi + fi + + if test "x$NVCC" == x; then + AC_MSG_ERROR([Couldn't find nvcc]) + fi + + if test "x$with_cuda_arch" == xdefault; then + with_cuda_arch="-gencode=arch=compute_35,code=compute_35 \\ +-gencode=arch=compute_52,code=compute_52 \\ +-gencode=arch=compute_60,code=compute_60 \\ +-gencode=arch=compute_61,code=compute_61 \\ +-gencode=arch=compute_70,code=compute_70 \\ +-gencode=arch=compute_75,code=compute_75" + fi -if test x$fa_nvcc_bin != x; then fa_save_CPPFLAGS="$CPPFLAGS" fa_save_LDFLAGS="$LDFLAGS" fa_save_LIBS="$LIBS" - NVCC_CPPFLAGS="-I$cuda_prefix/include" - NVCC_LDFLAGS="-L$cuda_prefix/lib64" - CPPFLAGS="$NVCC_CPPFLAGS $CPPFLAGS" LDFLAGS="$NVCC_LDFLAGS $LDFLAGS" AC_CHECK_HEADER([cuda.h], [], AC_MSG_FAILURE([Couldn't find cuda.h])) - AC_CHECK_LIB([cuda], [cuInit], [], AC_MSG_FAILURE([Couldn't find libcuda])) AC_CHECK_LIB([cublas], [cublasAlloc], [], AC_MSG_FAILURE([Couldn't find libcublas])) AC_CHECK_LIB([cudart], [cudaSetDevice], [], AC_MSG_FAILURE([Couldn't find libcudart])) @@ -32,8 +56,6 @@ if test x$fa_nvcc_bin != x; then CPPFLAGS="$fa_save_CPPFLAGS" LDFLAGS="$fa_save_LDFLAGS" LIBS="$fa_save_LIBS" -else - cuda_prefix="" fi AC_SUBST(NVCC) @@ -41,4 +63,5 @@ AC_SUBST(NVCC_CPPFLAGS) AC_SUBST(NVCC_LDFLAGS) AC_SUBST(NVCC_LIBS) AC_SUBST(CUDA_PREFIX, $cuda_prefix) +AC_SUBST(CUDA_ARCH, $with_cuda_arch) ]) diff --git a/acinclude/fa_prog_swig.m4 b/acinclude/fa_prog_swig.m4 index ea6ebd3d4..1e6ab8e49 100644 --- a/acinclude/fa_prog_swig.m4 +++ b/acinclude/fa_prog_swig.m4 @@ -3,10 +3,9 @@ AC_DEFUN([FA_PROG_SWIG], [ AC_ARG_WITH(swig, [AS_HELP_STRING([--with-swig=], [use SWIG binary ])]) case $with_swig in - "") SWIG_BIN=swig ;; - *) SWIG_BIN="$with_swig" + "") AC_CHECK_PROG(SWIG, swig, swig);; + *) SWIG="$with_swig" esac -AC_CHECK_PROG(SWIG, $SWIG_BIN, $SWIG_BIN) AC_SUBST(SWIG) ]) diff --git a/acinclude/fa_python.m4 b/acinclude/fa_python.m4 index 6bc6e4919..a58a9d15e 100644 --- a/acinclude/fa_python.m4 +++ b/acinclude/fa_python.m4 @@ -10,36 +10,12 @@ esac AC_CHECK_PROG(PYTHON, $PYTHON_BIN, $PYTHON_BIN) fa_python_bin=$PYTHON -AC_ARG_WITH(python-config, - [AS_HELP_STRING([--with-python-config=], [use Python config binary ])]) -case $with_python_config in - "") PYTHON_CFG_BIN="${PYTHON_BIN}-config" ;; - *) PYTHON_CFG_BIN="$with_python_config" -esac +AC_MSG_CHECKING([for Python C flags]) +fa_python_cflags=`$PYTHON -c " +import sysconfig +paths = [['-I' + sysconfig.get_path(p) for p in ['include', 'platinclude']]] +print(' '.join(paths))"` +AC_MSG_RESULT($fa_python_cflags) +AC_SUBST(PYTHON_CFLAGS, "$PYTHON_CFLAGS $fa_python_cflags") -AC_CHECK_PROG(PYTHON_CFG, $PYTHON_CFG_BIN, $PYTHON_CFG_BIN) -fa_python_cfg_bin=$PYTHON_CFG - -if test x$fa_python_cfg_bin != x; then - AC_MSG_CHECKING([for Python C flags]) - fa_python_cflags=`${PYTHON_CFG} --includes` - if test x"$fa_python_cflags" == x; then - AC_MSG_RESULT([not found]) - AC_MSG_WARN([You won't be able to build the python interface.]) - else - AC_MSG_RESULT($fa_python_cflags) - AC_SUBST(PYTHON_CFLAGS, $fa_python_cflags) - fi - - AC_MSG_CHECKING([for Python ld flags]) - fa_python_ldflags=`${PYTHON_CFG} --ldflags` - if test x"$fa_python_ldflags" == x; then - AC_MSG_RESULT([not found]) - else - AC_MSG_RESULT($fa_python_ldflags) - AC_SUBST(PYTHON_LDFLAGS, $fa_python_ldflags) - fi -else - AC_MSG_WARN([You won't be able to build the python interface.]) -fi -]) +])dnl FA_PYTHON diff --git a/conda/Dockerfile b/conda/Dockerfile new file mode 100644 index 000000000..690a5d8dc --- /dev/null +++ b/conda/Dockerfile @@ -0,0 +1,33 @@ +FROM soumith/conda-cuda:latest + +COPY ./ faiss +WORKDIR /faiss/conda + +ENV FAISS_BUILD_VERSION 1.5.1 +ENV FAISS_BUILD_NUMBER 1 +RUN conda build faiss --no-anaconda-upload -c pytorch +RUN CUDA_ROOT=/usr/local/cuda-8.0 \ + CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \ + -gencode=arch=compute_52,code=compute_52 \ + -gencode=arch=compute_60,code=compute_60 \ + -gencode=arch=compute_61,code=compute_61" \ + conda build faiss-gpu --variants '{ "cudatoolkit": "8.0" }' \ + --no-anaconda-upload -c pytorch --no-test +RUN CUDA_ROOT=/usr/local/cuda-9.0 \ + CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \ + -gencode=arch=compute_52,code=compute_52 \ + -gencode=arch=compute_60,code=compute_60 \ + -gencode=arch=compute_61,code=compute_61 \ + -gencode=arch=compute_70,code=compute_70" \ + conda build faiss-gpu --variants '{ "cudatoolkit": "9.0" }' \ + --no-anaconda-upload -c pytorch --no-test +RUN CUDA_ROOT=/usr/local/cuda-10.0 \ + CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \ + -gencode=arch=compute_52,code=compute_52 \ + -gencode=arch=compute_60,code=compute_60 \ + -gencode=arch=compute_61,code=compute_61 \ + -gencode=arch=compute_70,code=compute_70 \ + -gencode=arch=compute_72,code=compute_72 \ + -gencode=arch=compute_75,code=compute_75" \ + conda build faiss-gpu --variants '{ "cudatoolkit": "10.0" }' \ + --no-anaconda-upload -c pytorch --no-test diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml new file mode 100644 index 000000000..e9f0a51d2 --- /dev/null +++ b/conda/conda_build_config.yaml @@ -0,0 +1,7 @@ +CONDA_BUILD_SYSROOT: + - /opt/MacOSX10.9.sdk # [osx] +python: + - 2.7 + - 3.5 + - 3.6 + - 3.7 diff --git a/conda/faiss-gpu/build.sh b/conda/faiss-gpu/build.sh new file mode 100644 index 000000000..b0da4d8c5 --- /dev/null +++ b/conda/faiss-gpu/build.sh @@ -0,0 +1,5 @@ +./configure --with-cuda=$CUDA_ROOT --with-cuda-arch="$CUDA_ARCH" +make -j $CPU_COUNT +cd python +make +$PYTHON setup.py install --single-version-externally-managed --record=record.txt diff --git a/conda/faiss-gpu/conda_build_config.yaml b/conda/faiss-gpu/conda_build_config.yaml new file mode 100644 index 000000000..0c9ab8900 --- /dev/null +++ b/conda/faiss-gpu/conda_build_config.yaml @@ -0,0 +1,11 @@ +cxx_compiler_version: + - 5.4 +cudatoolkit: + - 8.0 + - 9.0 + - 9.2 + - 10.0 +# - 10.1 # cudatoolkit 10.1 packages are not yet available on Anaconda. +pin_run_as_build: + cudatoolkit: + max_pin: x.x diff --git a/conda/faiss-gpu/meta.yaml b/conda/faiss-gpu/meta.yaml new file mode 100644 index 000000000..483c4e532 --- /dev/null +++ b/conda/faiss-gpu/meta.yaml @@ -0,0 +1,41 @@ +package: + name: faiss-gpu + version: "{{ FAISS_BUILD_VERSION }}" + +source: + git_url: ../../ + +requirements: + build: + - {{ compiler('cxx') }} + - llvm-openmp # [osx] + - setuptools + - swig + + host: + - python {{ python }} + - intel-openmp # [osx] + - numpy 1.11.* + - mkl >=2018 + - cudatoolkit {{ cudatoolkit }} + + run: + - python {{ python }} + - intel-openmp # [osx] + - numpy >=1.11 + - mkl >=2018 + - blas=*=mkl + - {{ pin_compatible('cudatoolkit') }} + +build: + number: {{ FAISS_BUILD_NUMBER }} + script_env: + - CUDA_ROOT + - CUDA_ARCH + +about: + home: https://github.com/facebookresearch/faiss + license: BSD 3-Clause + license_family: BSD + license_file: LICENSE + summary: A library for efficient similarity search and clustering of dense vectors. diff --git a/conda/faiss-gpu/run_test.py b/conda/faiss-gpu/run_test.py new file mode 100644 index 000000000..68e0bbc3e --- /dev/null +++ b/conda/faiss-gpu/run_test.py @@ -0,0 +1,16 @@ +import faiss +import numpy as np + +d = 128 +n = 100 + +rs = np.random.RandomState(1337) +x = rs.rand(n, d).astype(np.float32) + +index = faiss.IndexFlatL2(d) + +res = faiss.StandardGpuResources() +gpu_index = faiss.index_cpu_to_gpu(res, 0, index) +gpu_index.add(x) + +D, I = index.search(x, 10) diff --git a/conda/faiss/build.sh b/conda/faiss/build.sh new file mode 100644 index 000000000..66ca439af --- /dev/null +++ b/conda/faiss/build.sh @@ -0,0 +1,5 @@ +./configure --without-cuda +make -j $CPU_COUNT +cd python +make +$PYTHON setup.py install --single-version-externally-managed --record=record.txt diff --git a/conda/faiss/meta.yaml b/conda/faiss/meta.yaml new file mode 100644 index 000000000..ccd2bbb6f --- /dev/null +++ b/conda/faiss/meta.yaml @@ -0,0 +1,36 @@ +package: + name: faiss-cpu + version: "{{ FAISS_BUILD_VERSION }}" + +source: + git_url: ../../ + +requirements: + build: + - {{ compiler('cxx') }} + - llvm-openmp # [osx] + - setuptools + - swig + + host: + - python {{ python }} + - intel-openmp # [osx] + - numpy 1.11.* + - mkl >=2018 + + run: + - python {{ python }} + - intel-openmp # [osx] + - numpy >=1.11 + - blas=*=mkl + - mkl >=2018 + +build: + number: {{ FAISS_BUILD_NUMBER }} + +about: + home: https://github.com/facebookresearch/faiss + license: BSD 3-Clause + license_family: BSD + license_file: LICENSE + summary: A library for efficient similarity search and clustering of dense vectors. diff --git a/conda/faiss/run_test.py b/conda/faiss/run_test.py new file mode 100644 index 000000000..57e6d7d92 --- /dev/null +++ b/conda/faiss/run_test.py @@ -0,0 +1,14 @@ +import faiss +import numpy as np + +d = 128 +# NOTE: BLAS kicks in only when n > distance_compute_blas_threshold = 20 +n = 100 + +rs = np.random.RandomState(1337) +x = rs.rand(n, d).astype(np.float32) + +index = faiss.IndexFlatL2(d) +index.add(x) + +D, I = index.search(x, 10) diff --git a/configure b/configure index b2053d0ca..8a428d601 100755 --- a/configure +++ b/configure @@ -645,6 +645,7 @@ build_cpu build OPENMP_CXXFLAGS LIBOBJS +CUDA_ARCH CUDA_PREFIX NVCC_LIBS NVCC_LDFLAGS @@ -655,9 +656,7 @@ CXXCPP NVCC SWIG NUMPY_INCLUDE -PYTHON_LDFLAGS PYTHON_CFLAGS -PYTHON_CFG PYTHON MKDIR_P SET_MAKE @@ -692,7 +691,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -716,9 +714,9 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_python -with_python_config with_swig with_cuda +with_cuda_arch enable_openmp with_blas with_lapack @@ -774,7 +772,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1027,15 +1024,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1173,7 +1161,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1326,7 +1314,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1367,10 +1354,10 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-python= use Python binary - --with-python-config= - use Python config binary --with-swig= use SWIG binary --with-cuda= prefix of the CUDA installation + --with-cuda-arch= + device specific -gencode flags --with-blas= use BLAS library --with-lapack= use LAPACK library @@ -4143,88 +4130,17 @@ fi fa_python_bin=$PYTHON - -# Check whether --with-python-config was given. -if test "${with_python_config+set}" = set; then : - withval=$with_python_config; -fi - -case $with_python_config in - "") PYTHON_CFG_BIN="${PYTHON_BIN}-config" ;; - *) PYTHON_CFG_BIN="$with_python_config" -esac - -# Extract the first word of "$PYTHON_CFG_BIN", so it can be a program name with args. -set dummy $PYTHON_CFG_BIN; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_CFG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON_CFG"; then - ac_cv_prog_PYTHON_CFG="$PYTHON_CFG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PYTHON_CFG="$PYTHON_CFG_BIN" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PYTHON_CFG=$ac_cv_prog_PYTHON_CFG -if test -n "$PYTHON_CFG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CFG" >&5 -$as_echo "$PYTHON_CFG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fa_python_cfg_bin=$PYTHON_CFG - -if test x$fa_python_cfg_bin != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python C flags" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python C flags" >&5 $as_echo_n "checking for Python C flags... " >&6; } - fa_python_cflags=`${PYTHON_CFG} --includes` - if test x"$fa_python_cflags" == x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You won't be able to build the python interface." >&5 -$as_echo "$as_me: WARNING: You won't be able to build the python interface." >&2;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fa_python_cflags" >&5 +fa_python_cflags=`$PYTHON -c " +import sysconfig +paths = ['-I' + sysconfig.get_path(p) for p in ['include', 'platinclude']] +print(' '.join(paths))"` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fa_python_cflags" >&5 $as_echo "$fa_python_cflags" >&6; } - PYTHON_CFLAGS=$fa_python_cflags +PYTHON_CFLAGS="$PYTHON_CFLAGS $fa_python_cflags" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python ld flags" >&5 -$as_echo_n "checking for Python ld flags... " >&6; } - fa_python_ldflags=`${PYTHON_CFG} --ldflags` - if test x"$fa_python_ldflags" == x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fa_python_ldflags" >&5 -$as_echo "$fa_python_ldflags" >&6; } - PYTHON_LDFLAGS=$fa_python_ldflags - - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You won't be able to build the python interface." >&5 -$as_echo "$as_me: WARNING: You won't be able to build the python interface." >&2;} -fi if test x$PYTHON != x; then @@ -4266,12 +4182,8 @@ if test "${with_swig+set}" = set; then : fi case $with_swig in - "") SWIG_BIN=swig ;; - *) SWIG_BIN="$with_swig" -esac - -# Extract the first word of "$SWIG_BIN", so it can be a program name with args. -set dummy $SWIG_BIN; ac_word=$2 + "") # Extract the first word of "swig", so it can be a program name with args. +set dummy swig; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_SWIG+:} false; then : @@ -4287,7 +4199,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_SWIG="$SWIG_BIN" + ac_cv_prog_SWIG="swig" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4306,6 +4218,9 @@ else $as_echo "no" >&6; } fi +;; + *) SWIG="$with_swig" +esac @@ -4711,13 +4626,20 @@ if test "${with_cuda+set}" = set; then : withval=$with_cuda; fi -case $with_cuda in -"") cuda_prefix=/usr/local/cuda ;; -*) cuda_prefix="$with_cuda" -esac -# Extract the first word of ""nvcc"", so it can be a program name with args. -set dummy "nvcc"; ac_word=$2 +# Check whether --with-cuda-arch was given. +if test "${with_cuda_arch+set}" = set; then : + withval=$with_cuda_arch; +else + with_cuda_arch=default +fi + + +if test x$with_cuda != xno; then + if test x$with_cuda != x; then + cuda_prefix=$with_cuda + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NVCC+:} false; then : @@ -4727,13 +4649,13 @@ else ac_cv_prog_NVCC="$NVCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in "$cuda_prefix/bin" +for as_dir in $cuda_prefix/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NVCC=""$cuda_prefix/bin/nvcc"" + ac_cv_prog_NVCC="$cuda_prefix/bin/nvcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4741,7 +4663,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_NVCC" && ac_cv_prog_NVCC="""" fi fi NVCC=$ac_cv_prog_NVCC @@ -4754,16 +4675,79 @@ $as_echo "no" >&6; } fi -fa_nvcc_bin=$NVCC + NVCC_CPPFLAGS="-I$cuda_prefix/include" + NVCC_LDFLAGS="-L$cuda_prefix/lib64" + else + for ac_prog in nvcc /usr/local/cuda/bin/nvcc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NVCC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NVCC"; then + ac_cv_prog_NVCC="$NVCC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NVCC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NVCC=$ac_cv_prog_NVCC +if test -n "$NVCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +$as_echo "$NVCC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$NVCC" && break +done + + if test "x$NVCC" == "x/usr/local/cuda/bin/nvcc"; then + cuda_prefix="/usr/local/cuda" + NVCC_CPPFLAGS="-I$cuda_prefix/include" + NVCC_LDFLAGS="-L$cuda_prefix/lib64" + else + cuda_prefix="" + NVCC_CPPFLAGS="" + NVCC_LDFLAGS="" + fi + fi + + if test "x$NVCC" == x; then + as_fn_error $? "Couldn't find nvcc" "$LINENO" 5 + fi + + if test "x$with_cuda_arch" == xdefault; then + with_cuda_arch="-gencode=arch=compute_35,code=compute_35 \\ +-gencode=arch=compute_52,code=compute_52 \\ +-gencode=arch=compute_60,code=compute_60 \\ +-gencode=arch=compute_61,code=compute_61 \\ +-gencode=arch=compute_70,code=compute_70 \\ +-gencode=arch=compute_75,code=compute_75" + fi -if test x$fa_nvcc_bin != x; then fa_save_CPPFLAGS="$CPPFLAGS" fa_save_LDFLAGS="$LDFLAGS" fa_save_LIBS="$LIBS" - NVCC_CPPFLAGS="-I$cuda_prefix/include" - NVCC_LDFLAGS="-L$cuda_prefix/lib64" - CPPFLAGS="$NVCC_CPPFLAGS $CPPFLAGS" LDFLAGS="$NVCC_LDFLAGS $LDFLAGS" @@ -4778,56 +4762,6 @@ See \`config.log' for more details" "$LINENO" 5; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cuInit in -lcuda" >&5 -$as_echo_n "checking for cuInit in -lcuda... " >&6; } -if ${ac_cv_lib_cuda_cuInit+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcuda $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cuInit (); -int -main () -{ -return cuInit (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_cuda_cuInit=yes -else - ac_cv_lib_cuda_cuInit=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cuda_cuInit" >&5 -$as_echo "$ac_cv_lib_cuda_cuInit" >&6; } -if test "x$ac_cv_lib_cuda_cuInit" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCUDA 1 -_ACEOF - - LIBS="-lcuda $LIBS" - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Couldn't find libcuda -See \`config.log' for more details" "$LINENO" 5; } -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cublasAlloc in -lcublas" >&5 $as_echo_n "checking for cublasAlloc in -lcublas... " >&6; } if ${ac_cv_lib_cublas_cublasAlloc+:} false; then : @@ -4935,8 +4869,6 @@ fi CPPFLAGS="$fa_save_CPPFLAGS" LDFLAGS="$fa_save_LDFLAGS" LIBS="$fa_save_LIBS" -else - cuda_prefix="" fi @@ -4945,6 +4877,8 @@ fi CUDA_PREFIX=$cuda_prefix +CUDA_ARCH=$with_cuda_arch + @@ -5474,8 +5408,6 @@ main () if (*(data + i) != *(data3 + i)) return 14; close (fd); - free (data); - free (data3); return 0; } _ACEOF diff --git a/demos/Makefile b/demos/Makefile index 1ed104c29..7ef635c30 100644 --- a/demos/Makefile +++ b/demos/Makefile @@ -15,8 +15,8 @@ all: $(DEMOS) clean: rm -f $(DEMOS) -%: %.cpp ../libfaiss.a - $(CXX) -o $@ $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) +%: %.cpp + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) -lfaiss .PHONY: all clean diff --git a/depend b/depend index c3ed24d4c..bc60e2248 100644 --- a/depend +++ b/depend @@ -1,42 +1,69 @@ -AutoTune.o: AutoTune.cpp AutoTune.h Index.h FaissAssert.h \ +AutoTune.o: AutoTune.cpp AutoTune.h Index.h IndexBinary.h FaissAssert.h \ FaissException.h utils.h Heap.h IndexFlat.h VectorTransform.h IndexLSH.h \ IndexPQ.h ProductQuantizer.h Clustering.h PolysemousTraining.h \ - IndexIVF.h IndexIVFPQ.h IndexIVFFlat.h MetaIndexes.h \ - IndexScalarQuantizer.h IndexHNSW.h -AuxIndexStructures.o: AuxIndexStructures.cpp AuxIndexStructures.h Index.h -Clustering.o: Clustering.cpp Clustering.h Index.h utils.h Heap.h \ - FaissAssert.h FaissException.h IndexFlat.h + IndexIVF.h InvertedLists.h IndexIVFPQ.h IndexIVFFlat.h MetaIndexes.h \ + IndexShards.h IndexScalarQuantizer.h IndexHNSW.h HNSW.h \ + IndexBinaryFlat.h IndexBinaryHNSW.h IndexBinaryIVF.h +AuxIndexStructures.o: AuxIndexStructures.cpp AuxIndexStructures.h Index.h \ + FaissAssert.h FaissException.h +Clustering.o: Clustering.cpp Clustering.h Index.h AuxIndexStructures.h \ + utils.h Heap.h FaissAssert.h FaissException.h IndexFlat.h FaissException.o: FaissException.cpp FaissException.h +HNSW.o: HNSW.cpp HNSW.h Index.h FaissAssert.h FaissException.h utils.h \ + Heap.h AuxIndexStructures.h Heap.o: Heap.cpp Heap.h +IVFlib.o: IVFlib.cpp IVFlib.h IndexIVF.h Index.h InvertedLists.h \ + Clustering.h Heap.h VectorTransform.h FaissAssert.h FaissException.h Index.o: Index.cpp IndexFlat.h Index.h FaissAssert.h FaissException.h +IndexBinary.o: IndexBinary.cpp IndexBinary.h FaissAssert.h \ + FaissException.h Index.h +IndexBinaryFlat.o: IndexBinaryFlat.cpp IndexBinaryFlat.h IndexBinary.h \ + FaissAssert.h FaissException.h Index.h hamming.h Heap.h utils.h \ + AuxIndexStructures.h +IndexBinaryFromFloat.o: IndexBinaryFromFloat.cpp IndexBinaryFromFloat.h \ + IndexBinary.h FaissAssert.h FaissException.h Index.h utils.h Heap.h +IndexBinaryHNSW.o: IndexBinaryHNSW.cpp IndexBinaryHNSW.h HNSW.h Index.h \ + FaissAssert.h FaissException.h utils.h Heap.h IndexBinaryFlat.h \ + IndexBinary.h hamming.h AuxIndexStructures.h +IndexBinaryIVF.o: IndexBinaryIVF.cpp IndexBinaryIVF.h IndexBinary.h \ + FaissAssert.h FaissException.h Index.h IndexIVF.h InvertedLists.h \ + Clustering.h Heap.h hamming.h utils.h AuxIndexStructures.h IndexFlat.h IndexFlat.o: IndexFlat.cpp IndexFlat.h Index.h utils.h Heap.h \ FaissAssert.h FaissException.h AuxIndexStructures.h -IndexHNSW.o: IndexHNSW.cpp IndexHNSW.h IndexFlat.h Index.h IndexPQ.h \ - ProductQuantizer.h Clustering.h Heap.h PolysemousTraining.h \ - IndexScalarQuantizer.h IndexIVF.h utils.h FaissAssert.h FaissException.h \ - IndexIVFPQ.h -IndexIVF.o: IndexIVF.cpp IndexIVF.h Index.h Clustering.h Heap.h utils.h \ - hamming.h FaissAssert.h FaissException.h IndexFlat.h \ +IndexHNSW.o: IndexHNSW.cpp IndexHNSW.h HNSW.h Index.h FaissAssert.h \ + FaissException.h utils.h Heap.h IndexFlat.h IndexPQ.h ProductQuantizer.h \ + Clustering.h PolysemousTraining.h IndexScalarQuantizer.h IndexIVF.h \ + InvertedLists.h IndexIVFPQ.h AuxIndexStructures.h +IndexIVF.o: IndexIVF.cpp IndexIVF.h Index.h InvertedLists.h Clustering.h \ + Heap.h utils.h hamming.h FaissAssert.h FaissException.h IndexFlat.h \ AuxIndexStructures.h IndexIVFFlat.o: IndexIVFFlat.cpp IndexIVFFlat.h IndexIVF.h Index.h \ - Clustering.h Heap.h utils.h FaissAssert.h FaissException.h IndexFlat.h \ - AuxIndexStructures.h -IndexIVFPQ.o: IndexIVFPQ.cpp IndexIVFPQ.h IndexIVF.h Index.h Clustering.h \ - Heap.h IndexPQ.h ProductQuantizer.h PolysemousTraining.h utils.h \ - IndexFlat.h hamming.h FaissAssert.h FaissException.h \ - AuxIndexStructures.h + InvertedLists.h Clustering.h Heap.h utils.h FaissAssert.h \ + FaissException.h IndexFlat.h AuxIndexStructures.h +IndexIVFPQ.o: IndexIVFPQ.cpp IndexIVFPQ.h IndexIVF.h Index.h \ + InvertedLists.h Clustering.h Heap.h IndexPQ.h ProductQuantizer.h \ + PolysemousTraining.h utils.h IndexFlat.h hamming.h FaissAssert.h \ + FaissException.h AuxIndexStructures.h IndexLSH.o: IndexLSH.cpp IndexLSH.h Index.h VectorTransform.h utils.h \ Heap.h hamming.h FaissAssert.h FaissException.h IndexPQ.o: IndexPQ.cpp IndexPQ.h Index.h ProductQuantizer.h Clustering.h \ Heap.h PolysemousTraining.h FaissAssert.h FaissException.h \ AuxIndexStructures.h hamming.h +IndexReplicas.o: IndexReplicas.cpp IndexReplicas.h Index.h IndexBinary.h \ + FaissAssert.h FaissException.h WorkerThread.h IndexScalarQuantizer.o: IndexScalarQuantizer.cpp IndexScalarQuantizer.h \ - IndexIVF.h Index.h Clustering.h Heap.h utils.h FaissAssert.h \ - FaissException.h -MetaIndexes.o: MetaIndexes.cpp MetaIndexes.h Index.h FaissAssert.h \ - FaissException.h Heap.h AuxIndexStructures.h + IndexIVF.h Index.h InvertedLists.h Clustering.h Heap.h utils.h \ + FaissAssert.h FaissException.h AuxIndexStructures.h +IndexShards.o: IndexShards.cpp IndexShards.h Index.h IndexBinary.h \ + FaissAssert.h FaissException.h Heap.h WorkerThread.h +InvertedLists.o: InvertedLists.cpp InvertedLists.h Index.h utils.h Heap.h \ + FaissAssert.h FaissException.h +MetaIndexes.o: MetaIndexes.cpp MetaIndexes.h Index.h IndexShards.h \ + IndexBinary.h FaissAssert.h FaissException.h Heap.h AuxIndexStructures.h \ + WorkerThread.h OnDiskInvertedLists.o: OnDiskInvertedLists.cpp OnDiskInvertedLists.h \ - IndexIVF.h Index.h Clustering.h Heap.h FaissAssert.h FaissException.h + IndexIVF.h Index.h InvertedLists.h Clustering.h Heap.h FaissAssert.h \ + FaissException.h PolysemousTraining.o: PolysemousTraining.cpp PolysemousTraining.h \ ProductQuantizer.h Clustering.h Index.h Heap.h utils.h hamming.h \ FaissAssert.h FaissException.h @@ -46,11 +73,1837 @@ ProductQuantizer.o: ProductQuantizer.cpp ProductQuantizer.h Clustering.h \ VectorTransform.o: VectorTransform.cpp VectorTransform.h Index.h utils.h \ Heap.h FaissAssert.h FaissException.h IndexPQ.h ProductQuantizer.h \ Clustering.h PolysemousTraining.h +WorkerThread.o: WorkerThread.cpp WorkerThread.h FaissAssert.h \ + FaissException.h hamming.o: hamming.cpp hamming.h Heap.h FaissAssert.h FaissException.h index_io.o: index_io.cpp index_io.h FaissAssert.h FaissException.h \ - IndexFlat.h Index.h VectorTransform.h IndexLSH.h IndexPQ.h \ - ProductQuantizer.h Clustering.h Heap.h PolysemousTraining.h IndexIVF.h \ - IndexIVFPQ.h IndexIVFFlat.h MetaIndexes.h IndexScalarQuantizer.h \ - IndexHNSW.h utils.h OnDiskInvertedLists.h + AuxIndexStructures.h Index.h IndexFlat.h VectorTransform.h IndexLSH.h \ + IndexPQ.h ProductQuantizer.h Clustering.h Heap.h PolysemousTraining.h \ + IndexIVF.h InvertedLists.h IndexIVFPQ.h IndexIVFFlat.h MetaIndexes.h \ + IndexShards.h IndexBinary.h IndexScalarQuantizer.h IndexHNSW.h HNSW.h \ + utils.h OnDiskInvertedLists.h IndexBinaryFlat.h IndexBinaryFromFloat.h \ + IndexBinaryHNSW.h IndexBinaryIVF.h utils.o: utils.cpp utils.h Heap.h AuxIndexStructures.h Index.h \ FaissAssert.h FaissException.h +utils_simd.o: utils_simd.cpp utils.h Heap.h +GpuAutoTune.o: gpu/GpuAutoTune.cpp gpu/GpuAutoTune.h gpu/../Index.h \ + gpu/../AutoTune.h gpu/../Index.h gpu/../IndexBinary.h \ + gpu/../FaissAssert.h gpu/../FaissException.h gpu/GpuClonerOptions.h \ + gpu/GpuIndicesOptions.h gpu/GpuIndex.h gpu/utils/MemorySpace.h \ + gpu/../FaissAssert.h gpu/../index_io.h gpu/../IndexFlat.h \ + gpu/../IndexIVF.h gpu/../InvertedLists.h gpu/../Clustering.h \ + gpu/../Heap.h gpu/../IndexIVFFlat.h gpu/../IndexIVF.h \ + gpu/../IndexIVFPQ.h gpu/../IndexPQ.h gpu/../ProductQuantizer.h \ + gpu/../PolysemousTraining.h gpu/../IndexReplicas.h gpu/../WorkerThread.h \ + gpu/../VectorTransform.h gpu/../MetaIndexes.h gpu/../IndexShards.h \ + gpu/GpuIndexFlat.h gpu/GpuIndexIVFFlat.h gpu/GpuIndexIVF.h \ + gpu/../Clustering.h gpu/GpuIndexIVFPQ.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h +GpuClonerOptions.o: gpu/GpuClonerOptions.cpp gpu/GpuClonerOptions.h \ + gpu/GpuIndicesOptions.h +GpuResources.o: gpu/GpuResources.cpp gpu/GpuResources.h \ + gpu/utils/DeviceMemory.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h +IndexProxy.o: gpu/IndexProxy.cpp gpu/IndexProxy.h gpu/../Index.h \ + gpu/utils/WorkerThread.h gpu/../FaissAssert.h gpu/../FaissException.h \ + gpu/../Clustering.h gpu/../Index.h gpu/GpuIndexFlat.h gpu/GpuIndex.h \ + gpu/utils/MemorySpace.h gpu/StandardGpuResources.h gpu/GpuResources.h \ + gpu/utils/DeviceMemory.h gpu/utils/StackDeviceMemory.h \ + gpu/utils/DeviceUtils.h gpu/utils/../../FaissAssert.h +StandardGpuResources.o: gpu/StandardGpuResources.cpp \ + gpu/StandardGpuResources.h gpu/GpuResources.h gpu/utils/DeviceMemory.h \ + gpu/utils/StackDeviceMemory.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h \ + gpu/utils/MemorySpace.h gpu/../FaissAssert.h +RemapIndices.o: gpu/impl/RemapIndices.cpp gpu/impl/RemapIndices.h \ + gpu/impl/../../FaissAssert.h gpu/impl/../../FaissException.h +DeviceMemory.o: gpu/utils/DeviceMemory.cpp gpu/utils/DeviceMemory.h \ + gpu/utils/DeviceUtils.h gpu/utils/../../FaissAssert.h \ + gpu/utils/../../FaissException.h +MemorySpace.o: gpu/utils/MemorySpace.cpp gpu/utils/MemorySpace.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h +StackDeviceMemory.o: gpu/utils/StackDeviceMemory.cpp \ + gpu/utils/StackDeviceMemory.h gpu/utils/DeviceMemory.h \ + gpu/utils/DeviceUtils.h gpu/utils/../../FaissAssert.h \ + gpu/utils/../../FaissException.h gpu/utils/MemorySpace.h \ + gpu/utils/StaticUtils.h +Timer.o: gpu/utils/Timer.cpp gpu/utils/Timer.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h +WorkerThread.o: gpu/utils/WorkerThread.cpp gpu/utils/WorkerThread.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h +GpuDistance.o: gpu/GpuDistance.cu gpu/GpuDistance.h gpu/../Index.h \ + gpu/../FaissAssert.h gpu/../FaissException.h gpu/GpuResources.h \ + gpu/utils/DeviceMemory.h gpu/impl/Distance.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/Float16.cuh \ + gpu/utils/ConversionOperators.cuh gpu/utils/../../Index.h \ + gpu/utils/CopyUtils.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh +GpuIndex.o: gpu/GpuIndex.cu gpu/GpuIndex.h gpu/../Index.h \ + gpu/utils/MemorySpace.h gpu/../FaissAssert.h gpu/../FaissException.h \ + gpu/GpuResources.h gpu/utils/DeviceMemory.h gpu/utils/CopyUtils.cuh \ + gpu/utils/DeviceTensor.cuh gpu/utils/Tensor.cuh gpu/utils/Tensor-inl.cuh \ + gpu/utils/../GpuFaissAssert.h gpu/utils/../../FaissAssert.h \ + gpu/utils/DeviceUtils.h gpu/utils/../../FaissAssert.h \ + gpu/utils/DeviceTensor-inl.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh gpu/utils/StaticUtils.h +GpuIndexBinaryFlat.o: gpu/GpuIndexBinaryFlat.cu gpu/GpuIndexBinaryFlat.h \ + gpu/../IndexBinaryFlat.h gpu/../IndexBinary.h gpu/../FaissAssert.h \ + gpu/../FaissException.h gpu/../Index.h gpu/GpuIndex.h gpu/../Index.h \ + gpu/utils/MemorySpace.h gpu/GpuResources.h gpu/utils/DeviceMemory.h \ + gpu/impl/BinaryFlatIndex.cuh gpu/impl/../utils/DeviceTensor.cuh \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/StaticUtils.h \ + gpu/utils/ConversionOperators.cuh gpu/utils/../../Index.h \ + gpu/utils/Float16.cuh gpu/utils/CopyUtils.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh +GpuIndexFlat.o: gpu/GpuIndexFlat.cu gpu/GpuIndexFlat.h gpu/GpuIndex.h \ + gpu/../Index.h gpu/utils/MemorySpace.h gpu/../IndexFlat.h gpu/../Index.h \ + gpu/GpuResources.h gpu/utils/DeviceMemory.h gpu/impl/FlatIndex.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/Float16.cuh gpu/utils/ConversionOperators.cuh \ + gpu/utils/../../Index.h gpu/utils/CopyUtils.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh +GpuIndexIVF.o: gpu/GpuIndexIVF.cu gpu/GpuIndexIVF.h gpu/GpuIndex.h \ + gpu/../Index.h gpu/utils/MemorySpace.h gpu/GpuIndexFlat.h \ + gpu/GpuIndicesOptions.h gpu/../Clustering.h gpu/../Index.h \ + gpu/../FaissAssert.h gpu/../FaissException.h gpu/../IndexFlat.h \ + gpu/../IndexIVF.h gpu/../InvertedLists.h gpu/../Clustering.h \ + gpu/../Heap.h gpu/utils/DeviceUtils.h gpu/utils/../../FaissAssert.h \ + gpu/utils/Float16.cuh gpu/utils/../GpuResources.h \ + gpu/utils/../utils/DeviceMemory.h gpu/utils/DeviceTensor.cuh \ + gpu/utils/Tensor.cuh gpu/utils/Tensor-inl.cuh \ + gpu/utils/../GpuFaissAssert.h gpu/utils/../../FaissAssert.h \ + gpu/utils/DeviceTensor-inl.cuh +GpuIndexIVFFlat.o: gpu/GpuIndexIVFFlat.cu gpu/GpuIndexIVFFlat.h \ + gpu/GpuIndexIVF.h gpu/GpuIndex.h gpu/../Index.h gpu/utils/MemorySpace.h \ + gpu/GpuIndexFlat.h gpu/GpuIndicesOptions.h gpu/../Clustering.h \ + gpu/../Index.h gpu/../IndexFlat.h gpu/../IndexIVFFlat.h \ + gpu/../IndexIVF.h gpu/../InvertedLists.h gpu/../Clustering.h \ + gpu/../Heap.h gpu/GpuResources.h gpu/utils/DeviceMemory.h \ + gpu/impl/IVFFlat.cuh gpu/impl/IVFBase.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/DeviceTensor.cuh \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/utils/CopyUtils.cuh \ + gpu/utils/HostTensor.cuh gpu/utils/HostTensor-inl.cuh \ + gpu/utils/Float16.cuh +GpuIndexIVFPQ.o: gpu/GpuIndexIVFPQ.cu gpu/GpuIndexIVFPQ.h \ + gpu/GpuIndexIVF.h gpu/GpuIndex.h gpu/../Index.h gpu/utils/MemorySpace.h \ + gpu/GpuIndexFlat.h gpu/GpuIndicesOptions.h gpu/../Clustering.h \ + gpu/../Index.h gpu/../IndexFlat.h gpu/../IndexIVFPQ.h gpu/../IndexIVF.h \ + gpu/../InvertedLists.h gpu/../Clustering.h gpu/../Heap.h \ + gpu/../IndexPQ.h gpu/../ProductQuantizer.h gpu/../PolysemousTraining.h \ + gpu/../ProductQuantizer.h gpu/GpuResources.h gpu/utils/DeviceMemory.h \ + gpu/impl/IVFPQ.cuh gpu/impl/IVFBase.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/DeviceTensor.cuh \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/Float16.cuh \ + gpu/utils/CopyUtils.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh +BinaryDistance.o: gpu/impl/BinaryDistance.cu \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/DeviceDefs.cuh gpu/impl/../utils/Select.cuh \ + gpu/impl/../utils/Comparators.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/MergeNetworkBlock.cuh \ + gpu/impl/../utils/MergeNetworkUtils.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/MergeNetworkWarp.cuh gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh gpu/impl/../utils/Limits.cuh \ + gpu/impl/../utils/Pair.cuh gpu/impl/../utils/MathOperators.cuh +BinaryFlatIndex.o: gpu/impl/BinaryFlatIndex.cu \ + gpu/impl/BinaryFlatIndex.cuh gpu/impl/../utils/DeviceTensor.cuh \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/StaticUtils.h \ + gpu/impl/BinaryDistance.cuh gpu/impl/../GpuResources.h +BroadcastSum.o: gpu/impl/BroadcastSum.cu gpu/impl/../../FaissAssert.h \ + gpu/impl/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/StaticUtils.h +Distance.o: gpu/impl/Distance.cu gpu/impl/Distance.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/Float16.cuh gpu/impl/../utils/../GpuResources.h \ + gpu/impl/BroadcastSum.cuh gpu/impl/L2Norm.cuh gpu/impl/L2Select.cuh \ + gpu/impl/../../FaissAssert.h gpu/impl/../../AuxIndexStructures.h \ + gpu/impl/../../Index.h gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/Limits.cuh gpu/impl/../utils/Pair.cuh \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/MatrixMult.cuh gpu/impl/../utils/BlockSelectKernel.cuh \ + gpu/impl/../utils/Select.cuh gpu/impl/../utils/Comparators.cuh \ + gpu/impl/../utils/MergeNetworkBlock.cuh \ + gpu/impl/../utils/MergeNetworkUtils.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/MergeNetworkWarp.cuh \ + gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh +FlatIndex.o: gpu/impl/FlatIndex.cu gpu/impl/FlatIndex.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/DeviceVector.cuh gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/Float16.cuh gpu/impl/../utils/../GpuResources.h \ + gpu/impl/Distance.cuh gpu/impl/L2Norm.cuh \ + gpu/impl/../utils/CopyUtils.cuh gpu/impl/../utils/HostTensor.cuh \ + gpu/impl/../utils/HostTensor-inl.cuh gpu/impl/../utils/Transpose.cuh +IVFBase.o: gpu/impl/IVFBase.cu gpu/impl/IVFBase.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/DeviceVector.cuh \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../GpuResources.h \ + gpu/impl/FlatIndex.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/InvertedListAppend.cuh gpu/impl/RemapIndices.h \ + gpu/impl/../utils/DeviceDefs.cuh gpu/impl/../utils/HostTensor.cuh \ + gpu/impl/../utils/HostTensor-inl.cuh +IVFFlat.o: gpu/impl/IVFFlat.cu gpu/impl/IVFFlat.cuh gpu/impl/IVFBase.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/DeviceVector.cuh \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../GpuResources.h \ + gpu/impl/FlatIndex.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/InvertedListAppend.cuh gpu/impl/IVFFlatScan.cuh \ + gpu/impl/RemapIndices.h gpu/impl/../utils/CopyUtils.cuh \ + gpu/impl/../utils/HostTensor.cuh gpu/impl/../utils/HostTensor-inl.cuh \ + gpu/impl/../utils/DeviceDefs.cuh gpu/impl/../utils/Transpose.cuh +IVFFlatScan.o: gpu/impl/IVFFlatScan.cu gpu/impl/IVFFlatScan.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../GpuResources.h \ + gpu/impl/../utils/DeviceMemory.h gpu/impl/IVFUtils.cuh \ + gpu/impl/../utils/ConversionOperators.cuh \ + gpu/impl/../utils/../../Index.h gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/MathOperators.cuh \ + gpu/impl/../utils/LoadStoreOperators.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh gpu/impl/../utils/Limits.cuh \ + gpu/impl/../utils/Pair.cuh gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/StaticUtils.h +IVFPQ.o: gpu/impl/IVFPQ.cu gpu/impl/IVFPQ.cuh gpu/impl/IVFBase.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/DeviceVector.cuh \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/MemorySpace.h gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h gpu/impl/BroadcastSum.cuh \ + gpu/impl/Distance.cuh gpu/impl/FlatIndex.cuh \ + gpu/impl/InvertedListAppend.cuh gpu/impl/L2Norm.cuh \ + gpu/impl/PQCodeDistances.cuh gpu/impl/../utils/NoTypeTensor.cuh \ + gpu/impl/PQScanMultiPassNoPrecomputed.cuh \ + gpu/impl/PQScanMultiPassPrecomputed.cuh gpu/impl/RemapIndices.h \ + gpu/impl/VectorResidual.cuh gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/HostTensor.cuh gpu/impl/../utils/HostTensor-inl.cuh \ + gpu/impl/../utils/MatrixMult.cuh gpu/impl/../utils/Transpose.cuh +IVFUtils.o: gpu/impl/IVFUtils.cu gpu/impl/IVFUtils.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/ThrustAllocator.cuh gpu/impl/../utils/MemorySpace.h +IVFUtilsSelect1.o: gpu/impl/IVFUtilsSelect1.cu gpu/impl/IVFUtils.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/Limits.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/Pair.cuh \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/Select.cuh gpu/impl/../utils/Comparators.cuh \ + gpu/impl/../utils/MergeNetworkBlock.cuh \ + gpu/impl/../utils/MergeNetworkUtils.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/MergeNetworkWarp.cuh \ + gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh +IVFUtilsSelect2.o: gpu/impl/IVFUtilsSelect2.cu gpu/impl/IVFUtils.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/Limits.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/Pair.cuh \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/Select.cuh gpu/impl/../utils/Comparators.cuh \ + gpu/impl/../utils/MergeNetworkBlock.cuh \ + gpu/impl/../utils/MergeNetworkUtils.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/MergeNetworkWarp.cuh \ + gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh +InvertedListAppend.o: gpu/impl/InvertedListAppend.cu \ + gpu/impl/InvertedListAppend.cuh gpu/impl/../GpuIndicesOptions.h \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../../FaissAssert.h \ + gpu/impl/../utils/Float16.cuh gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../utils/StaticUtils.h +L2Norm.o: gpu/impl/L2Norm.cu gpu/impl/L2Norm.cuh \ + gpu/impl/../utils/Float16.cuh gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../../FaissAssert.h \ + gpu/impl/../utils/ConversionOperators.cuh \ + gpu/impl/../utils/../../Index.h gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/Reductions.cuh \ + gpu/impl/../utils/ReductionOperators.cuh gpu/impl/../utils/Limits.cuh \ + gpu/impl/../utils/Pair.cuh gpu/impl/../utils/WarpShuffles.cuh +L2Select.o: gpu/impl/L2Select.cu gpu/impl/L2Select.cuh \ + gpu/impl/../utils/Float16.cuh gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../../FaissAssert.h \ + gpu/impl/../utils/DeviceDefs.cuh gpu/impl/../utils/MathOperators.cuh \ + gpu/impl/../utils/Pair.cuh gpu/impl/../utils/WarpShuffles.cuh \ + gpu/impl/../utils/Reductions.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/ReductionOperators.cuh gpu/impl/../utils/Limits.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/Select.cuh \ + gpu/impl/../utils/Comparators.cuh \ + gpu/impl/../utils/MergeNetworkBlock.cuh \ + gpu/impl/../utils/MergeNetworkUtils.cuh \ + gpu/impl/../utils/MergeNetworkWarp.cuh +PQCodeDistances.o: gpu/impl/PQCodeDistances.cu \ + gpu/impl/PQCodeDistances.cuh gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/NoTypeTensor.cuh \ + gpu/impl/BroadcastSum.cuh gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/Distance.cuh \ + gpu/impl/L2Norm.cuh gpu/impl/../utils/DeviceDefs.cuh \ + gpu/impl/../utils/MatrixMult.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/../utils/StaticUtils.h gpu/impl/../utils/Transpose.cuh +PQScanMultiPassNoPrecomputed.o: gpu/impl/PQScanMultiPassNoPrecomputed.cu \ + gpu/impl/PQScanMultiPassNoPrecomputed.cuh \ + gpu/impl/../GpuIndicesOptions.h gpu/impl/../utils/Tensor.cuh \ + gpu/impl/../utils/Tensor-inl.cuh gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../GpuResources.h \ + gpu/impl/../utils/DeviceMemory.h gpu/impl/PQCodeDistances.cuh \ + gpu/impl/../utils/NoTypeTensor.cuh gpu/impl/PQCodeLoad.cuh \ + gpu/impl/../utils/PtxUtils.cuh gpu/impl/IVFUtils.cuh \ + gpu/impl/../utils/ConversionOperators.cuh \ + gpu/impl/../utils/../../Index.h gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/LoadStoreOperators.cuh gpu/impl/../utils/StaticUtils.h \ + gpu/impl/../utils/HostTensor.cuh gpu/impl/../utils/HostTensor-inl.cuh +PQScanMultiPassPrecomputed.o: gpu/impl/PQScanMultiPassPrecomputed.cu \ + gpu/impl/PQScanMultiPassPrecomputed.cuh gpu/impl/../GpuIndicesOptions.h \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/NoTypeTensor.cuh \ + gpu/impl/../GpuResources.h gpu/impl/../utils/DeviceMemory.h \ + gpu/impl/PQCodeLoad.cuh gpu/impl/../utils/PtxUtils.cuh \ + gpu/impl/IVFUtils.cuh gpu/impl/../utils/ConversionOperators.cuh \ + gpu/impl/../utils/../../Index.h gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh \ + gpu/impl/../utils/LoadStoreOperators.cuh \ + gpu/impl/../utils/MathOperators.cuh gpu/impl/../utils/StaticUtils.h +VectorResidual.o: gpu/impl/VectorResidual.cu gpu/impl/VectorResidual.cuh \ + gpu/impl/../utils/Tensor.cuh gpu/impl/../utils/Tensor-inl.cuh \ + gpu/impl/../utils/../GpuFaissAssert.h \ + gpu/impl/../utils/../../FaissAssert.h \ + gpu/impl/../utils/../../FaissException.h gpu/impl/../utils/DeviceUtils.h \ + gpu/impl/../utils/../../FaissAssert.h gpu/impl/../utils/Float16.cuh \ + gpu/impl/../utils/../GpuResources.h \ + gpu/impl/../utils/../utils/DeviceMemory.h \ + gpu/impl/../utils/DeviceTensor.cuh gpu/impl/../utils/MemorySpace.h \ + gpu/impl/../utils/DeviceTensor-inl.cuh gpu/impl/../../FaissAssert.h \ + gpu/impl/../utils/ConversionOperators.cuh \ + gpu/impl/../utils/../../Index.h gpu/impl/../utils/StaticUtils.h +BlockSelectFloat.o: gpu/utils/BlockSelectFloat.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf.o: gpu/utils/BlockSelectHalf.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +DeviceUtils.o: gpu/utils/DeviceUtils.cu gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/../../FaissException.h \ + gpu/utils/DeviceDefs.cuh +Float16.o: gpu/utils/Float16.cu gpu/utils/Float16.cuh \ + gpu/utils/../GpuResources.h gpu/utils/../utils/DeviceMemory.h \ + gpu/utils/DeviceTensor.cuh gpu/utils/Tensor.cuh gpu/utils/Tensor-inl.cuh \ + gpu/utils/../GpuFaissAssert.h gpu/utils/../../FaissAssert.h \ + gpu/utils/../../FaissException.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/MemorySpace.h \ + gpu/utils/DeviceTensor-inl.cuh gpu/utils/nvidia/fp16_emu.cuh +MatrixMult.o: gpu/utils/MatrixMult.cu gpu/utils/MatrixMult.cuh \ + gpu/utils/Float16.cuh gpu/utils/../GpuResources.h \ + gpu/utils/../utils/DeviceMemory.h gpu/utils/DeviceTensor.cuh \ + gpu/utils/Tensor.cuh gpu/utils/Tensor-inl.cuh \ + gpu/utils/../GpuFaissAssert.h gpu/utils/../../FaissAssert.h \ + gpu/utils/../../FaissException.h gpu/utils/DeviceUtils.h \ + gpu/utils/../../FaissAssert.h gpu/utils/MemorySpace.h \ + gpu/utils/DeviceTensor-inl.cuh gpu/utils/HostTensor.cuh \ + gpu/utils/HostTensor-inl.cuh +WarpSelectFloat.o: gpu/utils/WarpSelectFloat.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf.o: gpu/utils/WarpSelectHalf.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +fp16_emu.o: gpu/utils/nvidia/fp16_emu.cu gpu/utils/nvidia/fp16_emu.cuh +BlockSelectFloat1.o: gpu/utils/blockselect/BlockSelectFloat1.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloat128.o: gpu/utils/blockselect/BlockSelectFloat128.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloat256.o: gpu/utils/blockselect/BlockSelectFloat256.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloat32.o: gpu/utils/blockselect/BlockSelectFloat32.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloat64.o: gpu/utils/blockselect/BlockSelectFloat64.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatF1024.o: gpu/utils/blockselect/BlockSelectFloatF1024.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatF2048.o: gpu/utils/blockselect/BlockSelectFloatF2048.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatF512.o: gpu/utils/blockselect/BlockSelectFloatF512.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatT1024.o: gpu/utils/blockselect/BlockSelectFloatT1024.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatT2048.o: gpu/utils/blockselect/BlockSelectFloatT2048.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectFloatT512.o: gpu/utils/blockselect/BlockSelectFloatT512.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf1.o: gpu/utils/blockselect/BlockSelectHalf1.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf128.o: gpu/utils/blockselect/BlockSelectHalf128.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf256.o: gpu/utils/blockselect/BlockSelectHalf256.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf32.o: gpu/utils/blockselect/BlockSelectHalf32.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalf64.o: gpu/utils/blockselect/BlockSelectHalf64.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfF1024.o: gpu/utils/blockselect/BlockSelectHalfF1024.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfF2048.o: gpu/utils/blockselect/BlockSelectHalfF2048.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfF512.o: gpu/utils/blockselect/BlockSelectHalfF512.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfT1024.o: gpu/utils/blockselect/BlockSelectHalfT1024.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfT2048.o: gpu/utils/blockselect/BlockSelectHalfT2048.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +BlockSelectHalfT512.o: gpu/utils/blockselect/BlockSelectHalfT512.cu \ + gpu/utils/blockselect/BlockSelectImpl.cuh \ + gpu/utils/blockselect/../BlockSelectKernel.cuh \ + gpu/utils/blockselect/../Float16.cuh \ + gpu/utils/blockselect/../../GpuResources.h \ + gpu/utils/blockselect/../../utils/DeviceMemory.h \ + gpu/utils/blockselect/../DeviceTensor.cuh \ + gpu/utils/blockselect/../Tensor.cuh \ + gpu/utils/blockselect/../Tensor-inl.cuh \ + gpu/utils/blockselect/../../GpuFaissAssert.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../../../FaissException.h \ + gpu/utils/blockselect/../DeviceUtils.h \ + gpu/utils/blockselect/../../../FaissAssert.h \ + gpu/utils/blockselect/../MemorySpace.h \ + gpu/utils/blockselect/../DeviceTensor-inl.cuh \ + gpu/utils/blockselect/../Select.cuh \ + gpu/utils/blockselect/../Comparators.cuh \ + gpu/utils/blockselect/../DeviceDefs.cuh \ + gpu/utils/blockselect/../MergeNetworkBlock.cuh \ + gpu/utils/blockselect/../MergeNetworkUtils.cuh \ + gpu/utils/blockselect/../PtxUtils.cuh \ + gpu/utils/blockselect/../StaticUtils.h \ + gpu/utils/blockselect/../WarpShuffles.cuh \ + gpu/utils/blockselect/../MergeNetworkWarp.cuh \ + gpu/utils/blockselect/../Reductions.cuh \ + gpu/utils/blockselect/../ReductionOperators.cuh \ + gpu/utils/blockselect/../Limits.cuh gpu/utils/blockselect/../Pair.cuh \ + gpu/utils/blockselect/../MathOperators.cuh +WarpSelectFloat1.o: gpu/utils/warpselect/WarpSelectFloat1.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloat128.o: gpu/utils/warpselect/WarpSelectFloat128.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloat256.o: gpu/utils/warpselect/WarpSelectFloat256.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloat32.o: gpu/utils/warpselect/WarpSelectFloat32.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloat64.o: gpu/utils/warpselect/WarpSelectFloat64.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatF1024.o: gpu/utils/warpselect/WarpSelectFloatF1024.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatF2048.o: gpu/utils/warpselect/WarpSelectFloatF2048.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatF512.o: gpu/utils/warpselect/WarpSelectFloatF512.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatT1024.o: gpu/utils/warpselect/WarpSelectFloatT1024.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatT2048.o: gpu/utils/warpselect/WarpSelectFloatT2048.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectFloatT512.o: gpu/utils/warpselect/WarpSelectFloatT512.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf1.o: gpu/utils/warpselect/WarpSelectHalf1.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf128.o: gpu/utils/warpselect/WarpSelectHalf128.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf256.o: gpu/utils/warpselect/WarpSelectHalf256.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf32.o: gpu/utils/warpselect/WarpSelectHalf32.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalf64.o: gpu/utils/warpselect/WarpSelectHalf64.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfF1024.o: gpu/utils/warpselect/WarpSelectHalfF1024.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfF2048.o: gpu/utils/warpselect/WarpSelectHalfF2048.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfF512.o: gpu/utils/warpselect/WarpSelectHalfF512.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfT1024.o: gpu/utils/warpselect/WarpSelectHalfT1024.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfT2048.o: gpu/utils/warpselect/WarpSelectHalfT2048.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh +WarpSelectHalfT512.o: gpu/utils/warpselect/WarpSelectHalfT512.cu \ + gpu/utils/warpselect/WarpSelectImpl.cuh \ + gpu/utils/warpselect/../WarpSelectKernel.cuh \ + gpu/utils/warpselect/../Float16.cuh \ + gpu/utils/warpselect/../../GpuResources.h \ + gpu/utils/warpselect/../../utils/DeviceMemory.h \ + gpu/utils/warpselect/../DeviceTensor.cuh \ + gpu/utils/warpselect/../Tensor.cuh \ + gpu/utils/warpselect/../Tensor-inl.cuh \ + gpu/utils/warpselect/../../GpuFaissAssert.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../../../FaissException.h \ + gpu/utils/warpselect/../DeviceUtils.h \ + gpu/utils/warpselect/../../../FaissAssert.h \ + gpu/utils/warpselect/../MemorySpace.h \ + gpu/utils/warpselect/../DeviceTensor-inl.cuh \ + gpu/utils/warpselect/../Select.cuh \ + gpu/utils/warpselect/../Comparators.cuh \ + gpu/utils/warpselect/../DeviceDefs.cuh \ + gpu/utils/warpselect/../MergeNetworkBlock.cuh \ + gpu/utils/warpselect/../MergeNetworkUtils.cuh \ + gpu/utils/warpselect/../PtxUtils.cuh \ + gpu/utils/warpselect/../StaticUtils.h \ + gpu/utils/warpselect/../WarpShuffles.cuh \ + gpu/utils/warpselect/../MergeNetworkWarp.cuh \ + gpu/utils/warpselect/../Reductions.cuh \ + gpu/utils/warpselect/../ReductionOperators.cuh \ + gpu/utils/warpselect/../Limits.cuh gpu/utils/warpselect/../Pair.cuh \ + gpu/utils/warpselect/../MathOperators.cuh diff --git a/gpu/Makefile b/gpu/Makefile deleted file mode 100644 index f1512b7ff..000000000 --- a/gpu/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (c) 2015-present, Facebook, Inc. -# All rights reserved. -# -# This source code is licensed under the BSD+Patents license found in the -# LICENSE file in the root directory of this source tree. - --include ../makefile.inc - -all: libgpufaiss.a libgpufaiss.$(SHAREDEXT) - -CPPOBJ = GpuResources.o \ - IndexProxy.o \ - StandardGpuResources.o \ - GpuAutoTune.o \ - GpuClonerOptions.o \ - impl/RemapIndices.o \ - utils/DeviceMemory.o \ - utils/StackDeviceMemory.o \ - utils/DeviceUtils.o \ - utils/Timer.o \ - utils/MemorySpace.o \ - utils/WorkerThread.o - - -INS = 1 32 64 128 256 F512 T512 F1024 T1024 - -CUOBJ = impl/BinaryDistance.o \ - impl/BinaryFlatIndex.o \ - impl/BroadcastSum.o \ - impl/Distance.o \ - impl/FlatIndex.o \ - impl/InvertedListAppend.o \ - impl/IVFBase.o \ - impl/IVFFlat.o \ - impl/IVFFlatScan.o \ - impl/IVFPQ.o \ - impl/IVFUtils.o \ - impl/IVFUtilsSelect1.o \ - impl/IVFUtilsSelect2.o \ - impl/L2Norm.o \ - impl/L2Select.o \ - impl/PQCodeDistances.o \ - impl/PQScanMultiPassNoPrecomputed.o \ - impl/PQScanMultiPassPrecomputed.o \ - impl/VectorResidual.o \ - GpuDistance.o \ - GpuIndex.o \ - GpuIndexBinaryFlat.o \ - GpuIndexFlat.o \ - GpuIndexIVF.o \ - GpuIndexIVFFlat.o \ - GpuIndexIVFPQ.o \ - utils/Float16.o \ - utils/MatrixMult.o \ - utils/BlockSelectFloat.o \ - utils/BlockSelectHalf.o \ - utils/WarpSelectFloat.o \ - utils/WarpSelectHalf.o \ - utils/nvidia/fp16_emu.o \ - $(foreach v,$(INS), \ - utils/blockselect/BlockSelectHalf$(v).o \ - utils/blockselect/BlockSelectFloat$(v).o \ - utils/warpselect/WarpSelectHalf$(v).o \ - utils/warpselect/WarpSelectFloat$(v).o \ - ) - -%.o: %.cpp - $(CXX) $(CXXFLAGS) $(CPUFLAGS) -c $< -o $@ $(CUDACFLAGS) - -%.o: %.cu - $(NVCC) $(NVCCFLAGS) -g -O3 -c $< -o $@ - -libgpufaiss.a: $(CPPOBJ) $(CUOBJ) - ar r $@ $^ - -libgpufaiss.$(SHAREDEXT): $(CPPOBJ) $(CUOBJ) - $(CXX) $(SHAREDFLAGS) $(LDFLAGS) $(NVCCLDFLAGS) \ - -o libgpufaiss.$(SHAREDEXT) $^ $(LIBS) $(NVCCLIBS) - -clean: - rm -rf *.o impl/*.o utils/*.o libgpufaiss.a \ - libgpufaiss.$(SHAREDEXT) \ - --include depend - -depend: - for i in $(patsubst %.o,%.cpp,$(CPPOBJ)) \ - $(patsubst %.o,%.cu,$(CUOBJ)); do \ - $(CXXCPP) $(CPPFLAGS) -x c++ -MM $$i; \ - done > depend - -install: libgpufaiss.a libgpufaiss.$(SHAREDEXT) installdirs - cp libgpufaiss.a libgpufaiss.$(SHAREDEXT) $(DESTDIR)$(libdir) - cp *.h $(DESTDIR)$(includedir)/faiss/gpu - cp --parents **/**.h $(DESTDIR)$(includedir)/faiss/gpu - -installdirs: - $(MKDIR_P) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss/gpu - -.PHONY: all clean diff --git a/gpu/test/Makefile b/gpu/test/Makefile index d31dd2f8f..9b0f43449 100644 --- a/gpu/test/Makefile +++ b/gpu/test/Makefile @@ -6,13 +6,45 @@ -include ../../makefile.inc -%.o: %.cpp - $(CXX) $(CUDACFLAGS) -o $@ -c $^ +TESTS_SRC = TestGpuIndexFlat.cpp TestGpuIndexIVFPQ.cpp \ +TestGpuIndexBinaryFlat.cpp TestGpuIndexIVFFlat.cpp TestGpuMemoryException.cpp +CUDA_TESTS_SRC = TestGpuSelect.cu -demo_ivfpq_indexing_gpu: demo_ivfpq_indexing_gpu.o ../libgpufaiss.a ../../libfaiss.a - $(CXX) $(LDFLAGS) $(NVCCLDFLAGS) -o $@ $^ $(LIBS) $(NVCCLIBS) +TESTS_BIN = $(TESTS_SRC:.cpp=) +CUDA_TESTS_BIN = $(CUDA_TESTS_SRC:.cu=) + + +# test_gpu_index.py test_pytorch_faiss.py + +run: $(TESTS_BIN) $(CUDA_TESTS_BIN) + for t in $(TESTS_BIN) $(CUDA_TESTS_BIN); do ./$$t; done + +%.o: %.cu gtest + $(NVCC) $(NVCCFLAGS) -g -O3 -o $@ -c $< -Igtest/include + +%.o: %.cpp gtest + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -o $@ -c $< -Igtest/include + +%: %.o TestUtils.o ../../libfaiss.a gtest/make/gtest.a + $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) + +demo_ivfpq_indexing_gpu: demo_ivfpq_indexing_gpu.o ../../libfaiss.a + $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) + +demo_ivfpq_indexing_gpu.o: demo_ivfpq_indexing_gpu.cpp + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -o $@ -c $^ + +gtest/make/gtest.a: gtest + $(MAKE) -C gtest/make CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" gtest.a + +gtest: + curl -L https://github.com/google/googletest/archive/release-1.8.0.tar.gz | tar xz && \ + mv googletest-release-1.8.0/googletest gtest && \ + rm -rf googletest-release-1.8.0 clean: - rm -f *.o demo_ivfpq_indexing_gpu + rm -f *.o $(TESTS_BIN) + rm -rf gtest + rm -f demo_ivfpq_indexing_gpu .PHONY: clean diff --git a/gpu/utils/DeviceUtils.cpp b/gpu/utils/DeviceUtils.cpp deleted file mode 100644 index 7814cc552..000000000 --- a/gpu/utils/DeviceUtils.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD+Patents license found in the - * LICENSE file in the root directory of this source tree. - */ - - -#include "DeviceUtils.h" -#include "../../FaissAssert.h" -#include -#include - -namespace faiss { namespace gpu { - -int getCurrentDevice() { - int dev = -1; - CUDA_VERIFY(cudaGetDevice(&dev)); - FAISS_ASSERT(dev != -1); - - return dev; -} - -void setCurrentDevice(int device) { - CUDA_VERIFY(cudaSetDevice(device)); -} - -int getNumDevices() { - int numDev = -1; - CUDA_VERIFY(cudaGetDeviceCount(&numDev)); - FAISS_ASSERT(numDev != -1); - - return numDev; -} - -void synchronizeAllDevices() { - for (int i = 0; i < getNumDevices(); ++i) { - DeviceScope scope(i); - - CUDA_VERIFY(cudaDeviceSynchronize()); - } -} - -const cudaDeviceProp& getDeviceProperties(int device) { - static std::mutex mutex; - static std::unordered_map properties; - - std::lock_guard guard(mutex); - - auto it = properties.find(device); - if (it == properties.end()) { - cudaDeviceProp prop; - CUDA_VERIFY(cudaGetDeviceProperties(&prop, device)); - - properties[device] = prop; - it = properties.find(device); - } - - return it->second; -} - -const cudaDeviceProp& getCurrentDeviceProperties() { - return getDeviceProperties(getCurrentDevice()); -} - -int getMaxThreads(int device) { - return getDeviceProperties(device).maxThreadsPerBlock; -} - -int getMaxThreadsCurrentDevice() { - return getMaxThreads(getCurrentDevice()); -} - -size_t getMaxSharedMemPerBlock(int device) { - return getDeviceProperties(device).sharedMemPerBlock; -} - -size_t getMaxSharedMemPerBlockCurrentDevice() { - return getMaxSharedMemPerBlock(getCurrentDevice()); -} - -int getDeviceForAddress(const void* p) { - if (!p) { - return -1; - } - - cudaPointerAttributes att; - cudaError_t err = cudaPointerGetAttributes(&att, p); - FAISS_ASSERT(err == cudaSuccess || - err == cudaErrorInvalidValue); - - if (err == cudaErrorInvalidValue) { - // Make sure the current thread error status has been reset - err = cudaGetLastError(); - FAISS_ASSERT(err == cudaErrorInvalidValue); - return -1; - } else if (att.memoryType == cudaMemoryTypeHost) { - return -1; - } else { - return att.device; - } -} - -bool getFullUnifiedMemSupport(int device) { - const auto& prop = getDeviceProperties(device); - return (prop.major >= 6); -} - -bool getFullUnifiedMemSupportCurrentDevice() { - return getFullUnifiedMemSupport(getCurrentDevice()); -} - -DeviceScope::DeviceScope(int device) { - prevDevice_ = getCurrentDevice(); - - if (prevDevice_ != device) { - setCurrentDevice(device); - } else { - prevDevice_ = -1; - } -} - -DeviceScope::~DeviceScope() { - if (prevDevice_ != -1) { - setCurrentDevice(prevDevice_); - } -} - -CublasHandleScope::CublasHandleScope() { - auto blasStatus = cublasCreate(&blasHandle_); - FAISS_ASSERT(blasStatus == CUBLAS_STATUS_SUCCESS); -} - -CublasHandleScope::~CublasHandleScope() { - auto blasStatus = cublasDestroy(blasHandle_); - FAISS_ASSERT(blasStatus == CUBLAS_STATUS_SUCCESS); -} - -CudaEvent::CudaEvent(cudaStream_t stream) - : event_(0) { - CUDA_VERIFY(cudaEventCreateWithFlags(&event_, cudaEventDisableTiming)); - CUDA_VERIFY(cudaEventRecord(event_, stream)); -} - -CudaEvent::CudaEvent(CudaEvent&& event) noexcept - : event_(std::move(event.event_)) { - event.event_ = 0; -} - -CudaEvent::~CudaEvent() { - if (event_) { - CUDA_VERIFY(cudaEventDestroy(event_)); - } -} - -CudaEvent& -CudaEvent::operator=(CudaEvent&& event) noexcept { - event_ = std::move(event.event_); - event.event_ = 0; - - return *this; -} - -void -CudaEvent::streamWaitOnEvent(cudaStream_t stream) { - CUDA_VERIFY(cudaStreamWaitEvent(stream, event_, 0)); -} - -void -CudaEvent::cpuWaitOnEvent() { - CUDA_VERIFY(cudaEventSynchronize(event_)); -} - -} } // namespace diff --git a/makefile.inc.in b/makefile.inc.in index 7b627ae71..c7c5da6a7 100644 --- a/makefile.inc.in +++ b/makefile.inc.in @@ -6,27 +6,20 @@ CXX = @CXX@ CXXCPP = @CXXCPP@ -# TODO: Investigate the LAPACKE wrapper for LAPACK, which defines the correct -# type for FORTRAN integers. -CPPFLAGS = -DFINTEGER=int @CPPFLAGS@ -CXXFLAGS = -fPIC @OPENMP_CXXFLAGS@ @ARCH_CXXFLAGS@ -Wno-sign-compare @CXXFLAGS@ +CPPFLAGS = -DFINTEGER=int @CPPFLAGS@ @OPENMP_CXXFLAGS@ @NVCC_CPPFLAGS@ +CXXFLAGS = -fPIC @ARCH_CXXFLAGS@ -Wno-sign-compare @CXXFLAGS@ CPUFLAGS = @ARCH_CPUFLAGS@ -LDFLAGS = @OPENMP_LDFLAGS@ @LDFLAGS@ -LIBS = @BLAS_LIBS@ @LAPACK_LIBS@ @LIBS@ +LDFLAGS = @OPENMP_CXXFLAGS@ @LDFLAGS@ @NVCC_LDFLAGS@ +LIBS = @BLAS_LIBS@ @LAPACK_LIBS@ @LIBS@ @NVCC_LIBS@ PYTHONCFLAGS = @PYTHON_CFLAGS@ -I@NUMPY_INCLUDE@ NVCC = @NVCC@ -NVCCLDFLAGS = @NVCC_LDFLAGS@ -NVCCLIBS = @NVCC_LIBS@ -CUDAROOT = @CUDA_PREFIX@ -CUDACFLAGS = @NVCC_CPPFLAGS@ -NVCCFLAGS = -I $(CUDAROOT)/targets/x86_64-linux/include/ \ +CUDA_ROOT = @CUDA_PREFIX@ +CUDA_ARCH = @CUDA_ARCH@ +NVCCFLAGS = -I $(CUDA_ROOT)/targets/x86_64-linux/include/ \ -Xcompiler -fPIC \ -Xcudafe --diag_suppress=unrecognized_attribute \ --gencode arch=compute_35,code="compute_35" \ --gencode arch=compute_52,code="compute_52" \ --gencode arch=compute_60,code="compute_60" \ --gencode arch=compute_61,code="compute_61" \ +$(CUDA_ARCH) \ -lineinfo \ -ccbin $(CXX) -DFAISS_USE_FLOAT16 @@ -43,6 +36,7 @@ endif MKDIR_P = @MKDIR_P@ PYTHON = @PYTHON@ SWIG = @SWIG@ +AR ?= ar prefix ?= @prefix@ exec_prefix ?= @exec_prefix@ diff --git a/python/Makefile b/python/Makefile index 252d96f75..f5d0a2217 100644 --- a/python/Makefile +++ b/python/Makefile @@ -6,52 +6,33 @@ -include ../makefile.inc -HEADERS = $(wildcard ../*.h) +ifneq ($(strip $(NVCC)),) + SWIGFLAGS = -DGPU_WRAPPER +endif -all: cpu build - -############################# -# CPU - -cpu: _swigfaiss.so +all: build # Also silently generates swigfaiss.py. -swigfaiss_wrap.cpp: swigfaiss.swig $(HEADERS) - $(SWIG) -python -c++ -Doverride= -I../ -o $@ $< +swigfaiss.cpp: swigfaiss.swig ../libfaiss.a + $(SWIG) -python -c++ -Doverride= -I../ $(SWIGFLAGS) -o $@ $< -swigfaiss_wrap.o: swigfaiss_wrap.cpp - $(CXX) $(CXXFLAGS) $(CPUFLAGS) $(PYTHONCFLAGS) -I../ -c $< -o $@ +swigfaiss.o: swigfaiss.cpp + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) $(PYTHONCFLAGS) \ + -I../ -c $< -o $@ # Extension is .so even on OSX. -_swigfaiss.so: swigfaiss_wrap.o ../libfaiss.a - $(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) +_swigfaiss.so: swigfaiss.o ../libfaiss.a + $(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) - -############################# -# GPU - -gpu: _swigfaiss_gpu.so - -# Also silently generates swigfaiss.py. -swigfaiss_gpu_wrap.cpp: swigfaiss.swig - $(SWIG) -python -c++ -Doverride= -I../ -DGPU_WRAPPER -o $@ $< - -swigfaiss_gpu_wrap.o: swigfaiss_gpu_wrap.cpp - $(NVCC) $(NVCCFLAGS) $(PYTHONCFLAGS) -I../ -c $< -o $@ - -_swigfaiss_gpu.so: swigfaiss_gpu_wrap.o ../gpu/libgpufaiss.a ../libfaiss.a - $(CXX) $(SHAREDFLAGS) $(NVCCLDFLAGS) $(LDFLAGS) -o $@ $^ $(NVCCLIBS) $(LIBS) - - -build: cpu +build: _swigfaiss.so faiss.py $(PYTHON) setup.py build install: build $(PYTHON) setup.py install clean: - rm -f swigfaiss_wrap.cpp swigfaiss_gpu_wrap.cpp - rm -f swigfaiss.py swigfaiss_gpu.py - rm -f _swigfaiss.so _swigfaiss_gpu.so + rm -f swigfaiss.{cpp,o,py} + rm -f _swigfaiss.so + rm -rf build/ -.PHONY: all build clean cpu gpu install +.PHONY: all build clean install diff --git a/python/faiss.py b/python/faiss.py index 261d7bc0e..fa1a6050d 100644 --- a/python/faiss.py +++ b/python/faiss.py @@ -16,16 +16,7 @@ import pdb # we import * so that the symbol X can be accessed as faiss.X - -try: - from swigfaiss_gpu import * -except ImportError as e: - - if 'No module named' not in e.args[0]: - # swigfaiss_gpu is there but failed to load: Warn user about it. - sys.stderr.write("Failed to load GPU Faiss: %s\n" % e.args[0]) - sys.stderr.write("Faiss falling back to CPU-only.\n") - from swigfaiss import * +from .swigfaiss import * __version__ = "%d.%d.%d" % (FAISS_VERSION_MAJOR, FAISS_VERSION_MINOR, diff --git a/python/setup.py b/python/setup.py index 304f9c73b..f6f112755 100644 --- a/python/setup.py +++ b/python/setup.py @@ -8,8 +8,7 @@ here = os.path.abspath(os.path.dirname(__file__)) check_fpath = os.path.join("_swigfaiss.so") if not os.path.exists(check_fpath): print("Could not find {}".format(check_fpath)) - print("Have you run `make` and `make py` " - "(and optionally `cd gpu && make && make py && cd ..`)?") + print("Have you run `make` and `make -C python`?") # make the faiss python package dir shutil.rmtree("faiss", ignore_errors=True) @@ -17,27 +16,22 @@ os.mkdir("faiss") shutil.copyfile("faiss.py", "faiss/__init__.py") shutil.copyfile("swigfaiss.py", "faiss/swigfaiss.py") shutil.copyfile("_swigfaiss.so", "faiss/_swigfaiss.so") -try: - shutil.copyfile("_swigfaiss_gpu.so", "faiss/_swigfaiss_gpu.so") - shutil.copyfile("swigfaiss_gpu.py", "faiss/swigfaiss_gpu.py") -except: - pass long_description=""" -Faiss is a library for efficient similarity search and clustering of dense +Faiss is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of any size, - up to ones that possibly do not fit in RAM. It also contains supporting -code for evaluation and parameter tuning. Faiss is written in C++ with -complete wrappers for Python/numpy. Some of the most useful algorithms + up to ones that possibly do not fit in RAM. It also contains supporting +code for evaluation and parameter tuning. Faiss is written in C++ with +complete wrappers for Python/numpy. Some of the most useful algorithms are implemented on the GPU. It is developed by Facebook AI Research. """ setup( name='faiss', - version='0.1', + version='1.5.1', description='A library for efficient similarity search and clustering of dense vectors', long_description=long_description, url='https://github.com/facebookresearch/faiss', - author='Matthijs Douze, Jeff Johnson, Herve Jegou', + author='Matthijs Douze, Jeff Johnson, Herve Jegou, Lucas Hosseini', author_email='matthijs@fb.com', license='BSD', keywords='search nearest neighbors', diff --git a/python/swigfaiss.py b/python/swigfaiss.py deleted file mode 100644 index c27bc3cdd..000000000 --- a/python/swigfaiss.py +++ /dev/null @@ -1,6173 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 3.0.12 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - -from sys import version_info as _swig_python_version_info -if _swig_python_version_info >= (2, 7, 0): - def swig_import_helper(): - import importlib - pkg = __name__.rpartition('.')[0] - mname = '.'.join((pkg, '_swigfaiss')).lstrip('.') - try: - return importlib.import_module(mname) - except ImportError: - return importlib.import_module('_swigfaiss') - _swigfaiss = swig_import_helper() - del swig_import_helper -elif _swig_python_version_info >= (2, 6, 0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_swigfaiss', [dirname(__file__)]) - except ImportError: - import _swigfaiss - return _swigfaiss - try: - _mod = imp.load_module('_swigfaiss', fp, pathname, description) - finally: - if fp is not None: - fp.close() - return _mod - _swigfaiss = swig_import_helper() - del swig_import_helper -else: - import _swigfaiss -del _swig_python_version_info - -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. - -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ - -def _swig_setattr_nondynamic(self, class_type, name, value, static=1): - if (name == "thisown"): - return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name, None) - if method: - return method(self, value) - if (not static): - if _newclass: - object.__setattr__(self, name, value) - else: - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - - -def _swig_setattr(self, class_type, name, value): - return _swig_setattr_nondynamic(self, class_type, name, value, 0) - - -def _swig_getattr(self, class_type, name): - if (name == "thisown"): - return self.this.own() - method = class_type.__swig_getmethods__.get(name, None) - if method: - return method(self) - raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) - - -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - -try: - _object = object - _newclass = 1 -except __builtin__.Exception: - class _object: - pass - _newclass = 0 - -class FloatVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, FloatVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, FloatVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_FloatVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.FloatVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.FloatVector_clear(self) - - def data(self): - return _swigfaiss.FloatVector_data(self) - - def size(self): - return _swigfaiss.FloatVector_size(self) - - def at(self, n): - return _swigfaiss.FloatVector_at(self, n) - - def resize(self, n): - return _swigfaiss.FloatVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.FloatVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_FloatVector - __del__ = lambda self: None -FloatVector_swigregister = _swigfaiss.FloatVector_swigregister -FloatVector_swigregister(FloatVector) - -class DoubleVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_DoubleVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.DoubleVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.DoubleVector_clear(self) - - def data(self): - return _swigfaiss.DoubleVector_data(self) - - def size(self): - return _swigfaiss.DoubleVector_size(self) - - def at(self, n): - return _swigfaiss.DoubleVector_at(self, n) - - def resize(self, n): - return _swigfaiss.DoubleVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.DoubleVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_DoubleVector - __del__ = lambda self: None -DoubleVector_swigregister = _swigfaiss.DoubleVector_swigregister -DoubleVector_swigregister(DoubleVector) - -class ByteVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ByteVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ByteVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_ByteVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.ByteVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.ByteVector_clear(self) - - def data(self): - return _swigfaiss.ByteVector_data(self) - - def size(self): - return _swigfaiss.ByteVector_size(self) - - def at(self, n): - return _swigfaiss.ByteVector_at(self, n) - - def resize(self, n): - return _swigfaiss.ByteVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.ByteVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_ByteVector - __del__ = lambda self: None -ByteVector_swigregister = _swigfaiss.ByteVector_swigregister -ByteVector_swigregister(ByteVector) - -class CharVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, CharVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, CharVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_CharVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.CharVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.CharVector_clear(self) - - def data(self): - return _swigfaiss.CharVector_data(self) - - def size(self): - return _swigfaiss.CharVector_size(self) - - def at(self, n): - return _swigfaiss.CharVector_at(self, n) - - def resize(self, n): - return _swigfaiss.CharVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.CharVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_CharVector - __del__ = lambda self: None -CharVector_swigregister = _swigfaiss.CharVector_swigregister -CharVector_swigregister(CharVector) - -class Uint64Vector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Uint64Vector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Uint64Vector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_Uint64Vector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.Uint64Vector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.Uint64Vector_clear(self) - - def data(self): - return _swigfaiss.Uint64Vector_data(self) - - def size(self): - return _swigfaiss.Uint64Vector_size(self) - - def at(self, n): - return _swigfaiss.Uint64Vector_at(self, n) - - def resize(self, n): - return _swigfaiss.Uint64Vector_resize(self, n) - - def swap(self, other): - return _swigfaiss.Uint64Vector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_Uint64Vector - __del__ = lambda self: None -Uint64Vector_swigregister = _swigfaiss.Uint64Vector_swigregister -Uint64Vector_swigregister(Uint64Vector) - -class LongVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, LongVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, LongVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_LongVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.LongVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.LongVector_clear(self) - - def data(self): - return _swigfaiss.LongVector_data(self) - - def size(self): - return _swigfaiss.LongVector_size(self) - - def at(self, n): - return _swigfaiss.LongVector_at(self, n) - - def resize(self, n): - return _swigfaiss.LongVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.LongVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_LongVector - __del__ = lambda self: None -LongVector_swigregister = _swigfaiss.LongVector_swigregister -LongVector_swigregister(LongVector) - -class IntVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_IntVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.IntVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.IntVector_clear(self) - - def data(self): - return _swigfaiss.IntVector_data(self) - - def size(self): - return _swigfaiss.IntVector_size(self) - - def at(self, n): - return _swigfaiss.IntVector_at(self, n) - - def resize(self, n): - return _swigfaiss.IntVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.IntVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_IntVector - __del__ = lambda self: None -IntVector_swigregister = _swigfaiss.IntVector_swigregister -IntVector_swigregister(IntVector) - -class VectorTransformVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorTransformVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VectorTransformVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_VectorTransformVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.VectorTransformVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.VectorTransformVector_clear(self) - - def data(self): - return _swigfaiss.VectorTransformVector_data(self) - - def size(self): - return _swigfaiss.VectorTransformVector_size(self) - - def at(self, n): - return _swigfaiss.VectorTransformVector_at(self, n) - - def resize(self, n): - return _swigfaiss.VectorTransformVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.VectorTransformVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_VectorTransformVector - __del__ = lambda self: None -VectorTransformVector_swigregister = _swigfaiss.VectorTransformVector_swigregister -VectorTransformVector_swigregister(VectorTransformVector) - -class OperatingPointVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPointVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPointVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_OperatingPointVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.OperatingPointVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.OperatingPointVector_clear(self) - - def data(self): - return _swigfaiss.OperatingPointVector_data(self) - - def size(self): - return _swigfaiss.OperatingPointVector_size(self) - - def at(self, n): - return _swigfaiss.OperatingPointVector_at(self, n) - - def resize(self, n): - return _swigfaiss.OperatingPointVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.OperatingPointVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_OperatingPointVector - __del__ = lambda self: None -OperatingPointVector_swigregister = _swigfaiss.OperatingPointVector_swigregister -OperatingPointVector_swigregister(OperatingPointVector) - -class InvertedListsPtrVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InvertedListsPtrVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InvertedListsPtrVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_InvertedListsPtrVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.InvertedListsPtrVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.InvertedListsPtrVector_clear(self) - - def data(self): - return _swigfaiss.InvertedListsPtrVector_data(self) - - def size(self): - return _swigfaiss.InvertedListsPtrVector_size(self) - - def at(self, n): - return _swigfaiss.InvertedListsPtrVector_at(self, n) - - def resize(self, n): - return _swigfaiss.InvertedListsPtrVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.InvertedListsPtrVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_InvertedListsPtrVector - __del__ = lambda self: None -InvertedListsPtrVector_swigregister = _swigfaiss.InvertedListsPtrVector_swigregister -InvertedListsPtrVector_swigregister(InvertedListsPtrVector) - -class FloatVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, FloatVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, FloatVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_FloatVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.FloatVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.FloatVectorVector_clear(self) - - def data(self): - return _swigfaiss.FloatVectorVector_data(self) - - def size(self): - return _swigfaiss.FloatVectorVector_size(self) - - def at(self, n): - return _swigfaiss.FloatVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss.FloatVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.FloatVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_FloatVectorVector - __del__ = lambda self: None -FloatVectorVector_swigregister = _swigfaiss.FloatVectorVector_swigregister -FloatVectorVector_swigregister(FloatVectorVector) - -class ByteVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ByteVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ByteVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_ByteVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.ByteVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.ByteVectorVector_clear(self) - - def data(self): - return _swigfaiss.ByteVectorVector_data(self) - - def size(self): - return _swigfaiss.ByteVectorVector_size(self) - - def at(self, n): - return _swigfaiss.ByteVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss.ByteVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.ByteVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_ByteVectorVector - __del__ = lambda self: None -ByteVectorVector_swigregister = _swigfaiss.ByteVectorVector_swigregister -ByteVectorVector_swigregister(ByteVectorVector) - -class LongVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, LongVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, LongVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_LongVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss.LongVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss.LongVectorVector_clear(self) - - def data(self): - return _swigfaiss.LongVectorVector_data(self) - - def size(self): - return _swigfaiss.LongVectorVector_size(self) - - def at(self, n): - return _swigfaiss.LongVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss.LongVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss.LongVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss.delete_LongVectorVector - __del__ = lambda self: None -LongVectorVector_swigregister = _swigfaiss.LongVectorVector_swigregister -LongVectorVector_swigregister(LongVectorVector) - - -def popcount64(x): - return _swigfaiss.popcount64(x) -popcount64 = _swigfaiss.popcount64 - -def hammings(a, b, na, nb, nbytespercode, dis): - return _swigfaiss.hammings(a, b, na, nb, nbytespercode, dis) -hammings = _swigfaiss.hammings - -def bitvec_print(b, d): - return _swigfaiss.bitvec_print(b, d) -bitvec_print = _swigfaiss.bitvec_print - -def fvecs2bitvecs(x, b, d, n): - return _swigfaiss.fvecs2bitvecs(x, b, d, n) -fvecs2bitvecs = _swigfaiss.fvecs2bitvecs - -def fvec2bitvec(x, b, d): - return _swigfaiss.fvec2bitvec(x, b, d) -fvec2bitvec = _swigfaiss.fvec2bitvec - -def hammings_knn_hc(ha, a, b, nb, ncodes, ordered): - return _swigfaiss.hammings_knn_hc(ha, a, b, nb, ncodes, ordered) -hammings_knn_hc = _swigfaiss.hammings_knn_hc - -def hammings_knn(ha, a, b, nb, ncodes, ordered): - return _swigfaiss.hammings_knn(ha, a, b, nb, ncodes, ordered) -hammings_knn = _swigfaiss.hammings_knn - -def hammings_knn_mc(a, b, na, nb, k, ncodes, distances, labels): - return _swigfaiss.hammings_knn_mc(a, b, na, nb, k, ncodes, distances, labels) -hammings_knn_mc = _swigfaiss.hammings_knn_mc - -def hamming_count_thres(bs1, bs2, n1, n2, ht, ncodes, nptr): - return _swigfaiss.hamming_count_thres(bs1, bs2, n1, n2, ht, ncodes, nptr) -hamming_count_thres = _swigfaiss.hamming_count_thres - -def match_hamming_thres(bs1, bs2, n1, n2, ht, ncodes, idx, dis): - return _swigfaiss.match_hamming_thres(bs1, bs2, n1, n2, ht, ncodes, idx, dis) -match_hamming_thres = _swigfaiss.match_hamming_thres - -def crosshamming_count_thres(dbs, n, ht, ncodes, nptr): - return _swigfaiss.crosshamming_count_thres(dbs, n, ht, ncodes, nptr) -crosshamming_count_thres = _swigfaiss.crosshamming_count_thres -class HammingComputer4(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer4, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer4, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer4_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer4_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer4_a0_get, _swigfaiss.HammingComputer4_a0_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer4(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a, code_size): - return _swigfaiss.HammingComputer4_set(self, a, code_size) - - def hamming(self, b): - return _swigfaiss.HammingComputer4_hamming(self, b) - __swig_destroy__ = _swigfaiss.delete_HammingComputer4 - __del__ = lambda self: None -HammingComputer4_swigregister = _swigfaiss.HammingComputer4_swigregister -HammingComputer4_swigregister(HammingComputer4) -cvar = _swigfaiss.cvar - -class HammingComputer8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer8, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer8_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer8_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer8_a0_get, _swigfaiss.HammingComputer8_a0_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer8(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a, code_size): - return _swigfaiss.HammingComputer8_set(self, a, code_size) - - def hamming(self, b): - return _swigfaiss.HammingComputer8_hamming(self, b) - __swig_destroy__ = _swigfaiss.delete_HammingComputer8 - __del__ = lambda self: None -HammingComputer8_swigregister = _swigfaiss.HammingComputer8_swigregister -HammingComputer8_swigregister(HammingComputer8) - -class HammingComputer16(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer16, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer16, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer16_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer16_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer16_a0_get, _swigfaiss.HammingComputer16_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.HammingComputer16_a1_set - __swig_getmethods__["a1"] = _swigfaiss.HammingComputer16_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.HammingComputer16_a1_get, _swigfaiss.HammingComputer16_a1_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer16(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputer16_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputer16_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputer16 - __del__ = lambda self: None -HammingComputer16_swigregister = _swigfaiss.HammingComputer16_swigregister -HammingComputer16_swigregister(HammingComputer16) - -class HammingComputer20(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer20, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer20, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer20_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer20_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer20_a0_get, _swigfaiss.HammingComputer20_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.HammingComputer20_a1_set - __swig_getmethods__["a1"] = _swigfaiss.HammingComputer20_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.HammingComputer20_a1_get, _swigfaiss.HammingComputer20_a1_set) - __swig_setmethods__["a2"] = _swigfaiss.HammingComputer20_a2_set - __swig_getmethods__["a2"] = _swigfaiss.HammingComputer20_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss.HammingComputer20_a2_get, _swigfaiss.HammingComputer20_a2_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer20(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputer20_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputer20_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputer20 - __del__ = lambda self: None -HammingComputer20_swigregister = _swigfaiss.HammingComputer20_swigregister -HammingComputer20_swigregister(HammingComputer20) - -class HammingComputer32(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer32, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer32, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer32_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer32_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer32_a0_get, _swigfaiss.HammingComputer32_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.HammingComputer32_a1_set - __swig_getmethods__["a1"] = _swigfaiss.HammingComputer32_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.HammingComputer32_a1_get, _swigfaiss.HammingComputer32_a1_set) - __swig_setmethods__["a2"] = _swigfaiss.HammingComputer32_a2_set - __swig_getmethods__["a2"] = _swigfaiss.HammingComputer32_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss.HammingComputer32_a2_get, _swigfaiss.HammingComputer32_a2_set) - __swig_setmethods__["a3"] = _swigfaiss.HammingComputer32_a3_set - __swig_getmethods__["a3"] = _swigfaiss.HammingComputer32_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss.HammingComputer32_a3_get, _swigfaiss.HammingComputer32_a3_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer32(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputer32_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputer32_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputer32 - __del__ = lambda self: None -HammingComputer32_swigregister = _swigfaiss.HammingComputer32_swigregister -HammingComputer32_swigregister(HammingComputer32) - -class HammingComputer64(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer64, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer64, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.HammingComputer64_a0_set - __swig_getmethods__["a0"] = _swigfaiss.HammingComputer64_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.HammingComputer64_a0_get, _swigfaiss.HammingComputer64_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.HammingComputer64_a1_set - __swig_getmethods__["a1"] = _swigfaiss.HammingComputer64_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.HammingComputer64_a1_get, _swigfaiss.HammingComputer64_a1_set) - __swig_setmethods__["a2"] = _swigfaiss.HammingComputer64_a2_set - __swig_getmethods__["a2"] = _swigfaiss.HammingComputer64_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss.HammingComputer64_a2_get, _swigfaiss.HammingComputer64_a2_set) - __swig_setmethods__["a3"] = _swigfaiss.HammingComputer64_a3_set - __swig_getmethods__["a3"] = _swigfaiss.HammingComputer64_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss.HammingComputer64_a3_get, _swigfaiss.HammingComputer64_a3_set) - __swig_setmethods__["a4"] = _swigfaiss.HammingComputer64_a4_set - __swig_getmethods__["a4"] = _swigfaiss.HammingComputer64_a4_get - if _newclass: - a4 = _swig_property(_swigfaiss.HammingComputer64_a4_get, _swigfaiss.HammingComputer64_a4_set) - __swig_setmethods__["a5"] = _swigfaiss.HammingComputer64_a5_set - __swig_getmethods__["a5"] = _swigfaiss.HammingComputer64_a5_get - if _newclass: - a5 = _swig_property(_swigfaiss.HammingComputer64_a5_get, _swigfaiss.HammingComputer64_a5_set) - __swig_setmethods__["a6"] = _swigfaiss.HammingComputer64_a6_set - __swig_getmethods__["a6"] = _swigfaiss.HammingComputer64_a6_get - if _newclass: - a6 = _swig_property(_swigfaiss.HammingComputer64_a6_get, _swigfaiss.HammingComputer64_a6_set) - __swig_setmethods__["a7"] = _swigfaiss.HammingComputer64_a7_set - __swig_getmethods__["a7"] = _swigfaiss.HammingComputer64_a7_get - if _newclass: - a7 = _swig_property(_swigfaiss.HammingComputer64_a7_get, _swigfaiss.HammingComputer64_a7_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputer64(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputer64_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputer64_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputer64 - __del__ = lambda self: None -HammingComputer64_swigregister = _swigfaiss.HammingComputer64_swigregister -HammingComputer64_swigregister(HammingComputer64) - -class HammingComputerDefault(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerDefault, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerDefault, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss.HammingComputerDefault_a_set - __swig_getmethods__["a"] = _swigfaiss.HammingComputerDefault_a_get - if _newclass: - a = _swig_property(_swigfaiss.HammingComputerDefault_a_get, _swigfaiss.HammingComputerDefault_a_set) - __swig_setmethods__["n"] = _swigfaiss.HammingComputerDefault_n_set - __swig_getmethods__["n"] = _swigfaiss.HammingComputerDefault_n_get - if _newclass: - n = _swig_property(_swigfaiss.HammingComputerDefault_n_get, _swigfaiss.HammingComputerDefault_n_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputerDefault(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputerDefault_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputerDefault_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputerDefault - __del__ = lambda self: None -HammingComputerDefault_swigregister = _swigfaiss.HammingComputerDefault_swigregister -HammingComputerDefault_swigregister(HammingComputerDefault) - -class HammingComputerM8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerM8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerM8, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss.HammingComputerM8_a_set - __swig_getmethods__["a"] = _swigfaiss.HammingComputerM8_a_get - if _newclass: - a = _swig_property(_swigfaiss.HammingComputerM8_a_get, _swigfaiss.HammingComputerM8_a_set) - __swig_setmethods__["n"] = _swigfaiss.HammingComputerM8_n_set - __swig_getmethods__["n"] = _swigfaiss.HammingComputerM8_n_get - if _newclass: - n = _swig_property(_swigfaiss.HammingComputerM8_n_get, _swigfaiss.HammingComputerM8_n_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputerM8(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss.HammingComputerM8_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputerM8_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputerM8 - __del__ = lambda self: None -HammingComputerM8_swigregister = _swigfaiss.HammingComputerM8_swigregister -HammingComputerM8_swigregister(HammingComputerM8) - -class HammingComputerM4(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerM4, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerM4, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss.HammingComputerM4_a_set - __swig_getmethods__["a"] = _swigfaiss.HammingComputerM4_a_get - if _newclass: - a = _swig_property(_swigfaiss.HammingComputerM4_a_get, _swigfaiss.HammingComputerM4_a_set) - __swig_setmethods__["n"] = _swigfaiss.HammingComputerM4_n_set - __swig_getmethods__["n"] = _swigfaiss.HammingComputerM4_n_get - if _newclass: - n = _swig_property(_swigfaiss.HammingComputerM4_n_get, _swigfaiss.HammingComputerM4_n_set) - - def __init__(self, *args): - this = _swigfaiss.new_HammingComputerM4(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a4, code_size): - return _swigfaiss.HammingComputerM4_set(self, a4, code_size) - - def hamming(self, b8): - return _swigfaiss.HammingComputerM4_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_HammingComputerM4 - __del__ = lambda self: None -HammingComputerM4_swigregister = _swigfaiss.HammingComputerM4_swigregister -HammingComputerM4_swigregister(HammingComputerM4) - - -def generalized_hamming_64(a): - return _swigfaiss.generalized_hamming_64(a) -generalized_hamming_64 = _swigfaiss.generalized_hamming_64 -class GenHammingComputer8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer8, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.GenHammingComputer8_a0_set - __swig_getmethods__["a0"] = _swigfaiss.GenHammingComputer8_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.GenHammingComputer8_a0_get, _swigfaiss.GenHammingComputer8_a0_set) - - def __init__(self, a, code_size): - this = _swigfaiss.new_GenHammingComputer8(a, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b): - return _swigfaiss.GenHammingComputer8_hamming(self, b) - __swig_destroy__ = _swigfaiss.delete_GenHammingComputer8 - __del__ = lambda self: None -GenHammingComputer8_swigregister = _swigfaiss.GenHammingComputer8_swigregister -GenHammingComputer8_swigregister(GenHammingComputer8) - -class GenHammingComputer16(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer16, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer16, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.GenHammingComputer16_a0_set - __swig_getmethods__["a0"] = _swigfaiss.GenHammingComputer16_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.GenHammingComputer16_a0_get, _swigfaiss.GenHammingComputer16_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.GenHammingComputer16_a1_set - __swig_getmethods__["a1"] = _swigfaiss.GenHammingComputer16_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.GenHammingComputer16_a1_get, _swigfaiss.GenHammingComputer16_a1_set) - - def __init__(self, a8, code_size): - this = _swigfaiss.new_GenHammingComputer16(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss.GenHammingComputer16_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_GenHammingComputer16 - __del__ = lambda self: None -GenHammingComputer16_swigregister = _swigfaiss.GenHammingComputer16_swigregister -GenHammingComputer16_swigregister(GenHammingComputer16) - -class GenHammingComputer32(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer32, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer32, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss.GenHammingComputer32_a0_set - __swig_getmethods__["a0"] = _swigfaiss.GenHammingComputer32_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss.GenHammingComputer32_a0_get, _swigfaiss.GenHammingComputer32_a0_set) - __swig_setmethods__["a1"] = _swigfaiss.GenHammingComputer32_a1_set - __swig_getmethods__["a1"] = _swigfaiss.GenHammingComputer32_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss.GenHammingComputer32_a1_get, _swigfaiss.GenHammingComputer32_a1_set) - __swig_setmethods__["a2"] = _swigfaiss.GenHammingComputer32_a2_set - __swig_getmethods__["a2"] = _swigfaiss.GenHammingComputer32_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss.GenHammingComputer32_a2_get, _swigfaiss.GenHammingComputer32_a2_set) - __swig_setmethods__["a3"] = _swigfaiss.GenHammingComputer32_a3_set - __swig_getmethods__["a3"] = _swigfaiss.GenHammingComputer32_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss.GenHammingComputer32_a3_get, _swigfaiss.GenHammingComputer32_a3_set) - - def __init__(self, a8, code_size): - this = _swigfaiss.new_GenHammingComputer32(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss.GenHammingComputer32_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_GenHammingComputer32 - __del__ = lambda self: None -GenHammingComputer32_swigregister = _swigfaiss.GenHammingComputer32_swigregister -GenHammingComputer32_swigregister(GenHammingComputer32) - -class GenHammingComputerM8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputerM8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputerM8, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss.GenHammingComputerM8_a_set - __swig_getmethods__["a"] = _swigfaiss.GenHammingComputerM8_a_get - if _newclass: - a = _swig_property(_swigfaiss.GenHammingComputerM8_a_get, _swigfaiss.GenHammingComputerM8_a_set) - __swig_setmethods__["n"] = _swigfaiss.GenHammingComputerM8_n_set - __swig_getmethods__["n"] = _swigfaiss.GenHammingComputerM8_n_get - if _newclass: - n = _swig_property(_swigfaiss.GenHammingComputerM8_n_get, _swigfaiss.GenHammingComputerM8_n_set) - - def __init__(self, a8, code_size): - this = _swigfaiss.new_GenHammingComputerM8(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss.GenHammingComputerM8_hamming(self, b8) - __swig_destroy__ = _swigfaiss.delete_GenHammingComputerM8 - __del__ = lambda self: None -GenHammingComputerM8_swigregister = _swigfaiss.GenHammingComputerM8_swigregister -GenHammingComputerM8_swigregister(GenHammingComputerM8) - - -def generalized_hammings_knn_hc(ha, a, b, nb, code_size, ordered=True): - return _swigfaiss.generalized_hammings_knn_hc(ha, a, b, nb, code_size, ordered) -generalized_hammings_knn_hc = _swigfaiss.generalized_hammings_knn_hc - -def get_num_gpus(): - return _swigfaiss.get_num_gpus() -get_num_gpus = _swigfaiss.get_num_gpus - -def getmillisecs(): - return _swigfaiss.getmillisecs() -getmillisecs = _swigfaiss.getmillisecs - -def get_mem_usage_kb(): - return _swigfaiss.get_mem_usage_kb() -get_mem_usage_kb = _swigfaiss.get_mem_usage_kb -class RandomGenerator(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RandomGenerator, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RandomGenerator, name) - __repr__ = _swig_repr - __swig_setmethods__["mt"] = _swigfaiss.RandomGenerator_mt_set - __swig_getmethods__["mt"] = _swigfaiss.RandomGenerator_mt_get - if _newclass: - mt = _swig_property(_swigfaiss.RandomGenerator_mt_get, _swigfaiss.RandomGenerator_mt_set) - - def rand_long(self): - return _swigfaiss.RandomGenerator_rand_long(self) - - def rand_int(self, *args): - return _swigfaiss.RandomGenerator_rand_int(self, *args) - - def rand_float(self): - return _swigfaiss.RandomGenerator_rand_float(self) - - def rand_double(self): - return _swigfaiss.RandomGenerator_rand_double(self) - - def __init__(self, seed=1234): - this = _swigfaiss.new_RandomGenerator(seed) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_RandomGenerator - __del__ = lambda self: None -RandomGenerator_swigregister = _swigfaiss.RandomGenerator_swigregister -RandomGenerator_swigregister(RandomGenerator) - - -def float_rand(x, n, seed): - return _swigfaiss.float_rand(x, n, seed) -float_rand = _swigfaiss.float_rand - -def float_randn(x, n, seed): - return _swigfaiss.float_randn(x, n, seed) -float_randn = _swigfaiss.float_randn - -def long_rand(x, n, seed): - return _swigfaiss.long_rand(x, n, seed) -long_rand = _swigfaiss.long_rand - -def byte_rand(x, n, seed): - return _swigfaiss.byte_rand(x, n, seed) -byte_rand = _swigfaiss.byte_rand - -def rand_perm(perm, n, seed): - return _swigfaiss.rand_perm(perm, n, seed) -rand_perm = _swigfaiss.rand_perm - -def fvec_L2sqr(x, y, d): - return _swigfaiss.fvec_L2sqr(x, y, d) -fvec_L2sqr = _swigfaiss.fvec_L2sqr - -def fvec_inner_product(x, y, d): - return _swigfaiss.fvec_inner_product(x, y, d) -fvec_inner_product = _swigfaiss.fvec_inner_product - -def imbalance_factor(*args): - return _swigfaiss.imbalance_factor(*args) -imbalance_factor = _swigfaiss.imbalance_factor - -def pairwise_L2sqr(d, nq, xq, nb, xb, dis, ldq=-1, ldb=-1, ldd=-1): - return _swigfaiss.pairwise_L2sqr(d, nq, xq, nb, xb, dis, ldq, ldb, ldd) -pairwise_L2sqr = _swigfaiss.pairwise_L2sqr - -def fvec_inner_products_ny(ip, x, y, d, ny): - return _swigfaiss.fvec_inner_products_ny(ip, x, y, d, ny) -fvec_inner_products_ny = _swigfaiss.fvec_inner_products_ny - -def fvec_L2sqr_ny(dis, x, y, d, ny): - return _swigfaiss.fvec_L2sqr_ny(dis, x, y, d, ny) -fvec_L2sqr_ny = _swigfaiss.fvec_L2sqr_ny - -def fvec_norm_L2sqr(x, d): - return _swigfaiss.fvec_norm_L2sqr(x, d) -fvec_norm_L2sqr = _swigfaiss.fvec_norm_L2sqr - -def fvec_norms_L2(ip, x, d, nx): - return _swigfaiss.fvec_norms_L2(ip, x, d, nx) -fvec_norms_L2 = _swigfaiss.fvec_norms_L2 - -def fvec_norms_L2sqr(ip, x, d, nx): - return _swigfaiss.fvec_norms_L2sqr(ip, x, d, nx) -fvec_norms_L2sqr = _swigfaiss.fvec_norms_L2sqr - -def fvec_renorm_L2(d, nx, x): - return _swigfaiss.fvec_renorm_L2(d, nx, x) -fvec_renorm_L2 = _swigfaiss.fvec_renorm_L2 - -def inner_product_to_L2sqr(dis, nr1, nr2, n1, n2): - return _swigfaiss.inner_product_to_L2sqr(dis, nr1, nr2, n1, n2) -inner_product_to_L2sqr = _swigfaiss.inner_product_to_L2sqr - -def fvec_inner_products_by_idx(ip, x, y, ids, d, nx, ny): - return _swigfaiss.fvec_inner_products_by_idx(ip, x, y, ids, d, nx, ny) -fvec_inner_products_by_idx = _swigfaiss.fvec_inner_products_by_idx - -def fvec_L2sqr_by_idx(dis, x, y, ids, d, nx, ny): - return _swigfaiss.fvec_L2sqr_by_idx(dis, x, y, ids, d, nx, ny) -fvec_L2sqr_by_idx = _swigfaiss.fvec_L2sqr_by_idx - -def knn_inner_product(x, y, d, nx, ny, res): - return _swigfaiss.knn_inner_product(x, y, d, nx, ny, res) -knn_inner_product = _swigfaiss.knn_inner_product - -def knn_L2sqr(x, y, d, nx, ny, res): - return _swigfaiss.knn_L2sqr(x, y, d, nx, ny, res) -knn_L2sqr = _swigfaiss.knn_L2sqr - -def knn_L2sqr_base_shift(x, y, d, nx, ny, res, base_shift): - return _swigfaiss.knn_L2sqr_base_shift(x, y, d, nx, ny, res, base_shift) -knn_L2sqr_base_shift = _swigfaiss.knn_L2sqr_base_shift - -def knn_inner_products_by_idx(x, y, ids, d, nx, ny, res): - return _swigfaiss.knn_inner_products_by_idx(x, y, ids, d, nx, ny, res) -knn_inner_products_by_idx = _swigfaiss.knn_inner_products_by_idx - -def knn_L2sqr_by_idx(x, y, ids, d, nx, ny, res): - return _swigfaiss.knn_L2sqr_by_idx(x, y, ids, d, nx, ny, res) -knn_L2sqr_by_idx = _swigfaiss.knn_L2sqr_by_idx - -def range_search_L2sqr(x, y, d, nx, ny, radius, result): - return _swigfaiss.range_search_L2sqr(x, y, d, nx, ny, radius, result) -range_search_L2sqr = _swigfaiss.range_search_L2sqr - -def range_search_inner_product(x, y, d, nx, ny, radius, result): - return _swigfaiss.range_search_inner_product(x, y, d, nx, ny, radius, result) -range_search_inner_product = _swigfaiss.range_search_inner_product - -def fvec_madd(n, a, bf, b, c): - return _swigfaiss.fvec_madd(n, a, bf, b, c) -fvec_madd = _swigfaiss.fvec_madd - -def fvec_madd_and_argmin(n, a, bf, b, c): - return _swigfaiss.fvec_madd_and_argmin(n, a, bf, b, c) -fvec_madd_and_argmin = _swigfaiss.fvec_madd_and_argmin - -def reflection(u, x, n, d, nu): - return _swigfaiss.reflection(u, x, n, d, nu) -reflection = _swigfaiss.reflection - -def km_update_centroids(x, centroids, assign, d, k, n, k_frozen): - return _swigfaiss.km_update_centroids(x, centroids, assign, d, k, n, k_frozen) -km_update_centroids = _swigfaiss.km_update_centroids - -def matrix_qr(m, n, a): - return _swigfaiss.matrix_qr(m, n, a) -matrix_qr = _swigfaiss.matrix_qr - -def ranklist_handle_ties(k, idx, dis): - return _swigfaiss.ranklist_handle_ties(k, idx, dis) -ranklist_handle_ties = _swigfaiss.ranklist_handle_ties - -def ranklist_intersection_size(k1, v1, k2, v2): - return _swigfaiss.ranklist_intersection_size(k1, v1, k2, v2) -ranklist_intersection_size = _swigfaiss.ranklist_intersection_size - -def merge_result_table_with(n, k, I0, D0, I1, D1, keep_min=True, translation=0): - return _swigfaiss.merge_result_table_with(n, k, I0, D0, I1, D1, keep_min, translation) -merge_result_table_with = _swigfaiss.merge_result_table_with - -def fvec_argsort(n, vals, perm): - return _swigfaiss.fvec_argsort(n, vals, perm) -fvec_argsort = _swigfaiss.fvec_argsort - -def fvec_argsort_parallel(n, vals, perm): - return _swigfaiss.fvec_argsort_parallel(n, vals, perm) -fvec_argsort_parallel = _swigfaiss.fvec_argsort_parallel - -def ivec_hist(n, v, vmax, hist): - return _swigfaiss.ivec_hist(n, v, vmax, hist) -ivec_hist = _swigfaiss.ivec_hist - -def bincode_hist(n, nbits, codes, hist): - return _swigfaiss.bincode_hist(n, nbits, codes, hist) -bincode_hist = _swigfaiss.bincode_hist - -def ivec_checksum(n, a): - return _swigfaiss.ivec_checksum(n, a) -ivec_checksum = _swigfaiss.ivec_checksum - -def fvecs_maybe_subsample(d, n, nmax, x, verbose=False, seed=1234): - return _swigfaiss.fvecs_maybe_subsample(d, n, nmax, x, verbose, seed) -fvecs_maybe_subsample = _swigfaiss.fvecs_maybe_subsample - -def binary_to_real(d, x_in, x_out): - return _swigfaiss.binary_to_real(d, x_in, x_out) -binary_to_real = _swigfaiss.binary_to_real - -def real_to_binary(d, x_in, x_out): - return _swigfaiss.real_to_binary(d, x_in, x_out) -real_to_binary = _swigfaiss.real_to_binary - -def hash_bytes(bytes, n): - return _swigfaiss.hash_bytes(bytes, n) -hash_bytes = _swigfaiss.hash_bytes - -def check_openmp(): - return _swigfaiss.check_openmp() -check_openmp = _swigfaiss.check_openmp -FAISS_VERSION_MAJOR = _swigfaiss.FAISS_VERSION_MAJOR -FAISS_VERSION_MINOR = _swigfaiss.FAISS_VERSION_MINOR -FAISS_VERSION_PATCH = _swigfaiss.FAISS_VERSION_PATCH -METRIC_INNER_PRODUCT = _swigfaiss.METRIC_INNER_PRODUCT -METRIC_L2 = _swigfaiss.METRIC_L2 -class Index(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Index, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Index, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss.Index_d_set - __swig_getmethods__["d"] = _swigfaiss.Index_d_get - if _newclass: - d = _swig_property(_swigfaiss.Index_d_get, _swigfaiss.Index_d_set) - __swig_setmethods__["ntotal"] = _swigfaiss.Index_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss.Index_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss.Index_ntotal_get, _swigfaiss.Index_ntotal_set) - __swig_setmethods__["verbose"] = _swigfaiss.Index_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.Index_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.Index_verbose_get, _swigfaiss.Index_verbose_set) - __swig_setmethods__["is_trained"] = _swigfaiss.Index_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss.Index_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss.Index_is_trained_get, _swigfaiss.Index_is_trained_set) - __swig_setmethods__["metric_type"] = _swigfaiss.Index_metric_type_set - __swig_getmethods__["metric_type"] = _swigfaiss.Index_metric_type_get - if _newclass: - metric_type = _swig_property(_swigfaiss.Index_metric_type_get, _swigfaiss.Index_metric_type_set) - __swig_destroy__ = _swigfaiss.delete_Index - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss.Index_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.Index_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.Index_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.Index_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss.Index_range_search(self, n, x, radius, result) - - def assign(self, n, x, labels, k=1): - return _swigfaiss.Index_assign(self, n, x, labels, k) - - def reset(self): - return _swigfaiss.Index_reset(self) - - def remove_ids(self, sel): - return _swigfaiss.Index_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss.Index_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.Index_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss.Index_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def compute_residual(self, x, residual, key): - return _swigfaiss.Index_compute_residual(self, x, residual, key) - - def display(self): - return _swigfaiss.Index_display(self) -Index_swigregister = _swigfaiss.Index_swigregister -Index_swigregister(Index) - -class ClusteringParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ClusteringParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ClusteringParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["niter"] = _swigfaiss.ClusteringParameters_niter_set - __swig_getmethods__["niter"] = _swigfaiss.ClusteringParameters_niter_get - if _newclass: - niter = _swig_property(_swigfaiss.ClusteringParameters_niter_get, _swigfaiss.ClusteringParameters_niter_set) - __swig_setmethods__["nredo"] = _swigfaiss.ClusteringParameters_nredo_set - __swig_getmethods__["nredo"] = _swigfaiss.ClusteringParameters_nredo_get - if _newclass: - nredo = _swig_property(_swigfaiss.ClusteringParameters_nredo_get, _swigfaiss.ClusteringParameters_nredo_set) - __swig_setmethods__["verbose"] = _swigfaiss.ClusteringParameters_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.ClusteringParameters_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.ClusteringParameters_verbose_get, _swigfaiss.ClusteringParameters_verbose_set) - __swig_setmethods__["spherical"] = _swigfaiss.ClusteringParameters_spherical_set - __swig_getmethods__["spherical"] = _swigfaiss.ClusteringParameters_spherical_get - if _newclass: - spherical = _swig_property(_swigfaiss.ClusteringParameters_spherical_get, _swigfaiss.ClusteringParameters_spherical_set) - __swig_setmethods__["int_centroids"] = _swigfaiss.ClusteringParameters_int_centroids_set - __swig_getmethods__["int_centroids"] = _swigfaiss.ClusteringParameters_int_centroids_get - if _newclass: - int_centroids = _swig_property(_swigfaiss.ClusteringParameters_int_centroids_get, _swigfaiss.ClusteringParameters_int_centroids_set) - __swig_setmethods__["update_index"] = _swigfaiss.ClusteringParameters_update_index_set - __swig_getmethods__["update_index"] = _swigfaiss.ClusteringParameters_update_index_get - if _newclass: - update_index = _swig_property(_swigfaiss.ClusteringParameters_update_index_get, _swigfaiss.ClusteringParameters_update_index_set) - __swig_setmethods__["frozen_centroids"] = _swigfaiss.ClusteringParameters_frozen_centroids_set - __swig_getmethods__["frozen_centroids"] = _swigfaiss.ClusteringParameters_frozen_centroids_get - if _newclass: - frozen_centroids = _swig_property(_swigfaiss.ClusteringParameters_frozen_centroids_get, _swigfaiss.ClusteringParameters_frozen_centroids_set) - __swig_setmethods__["min_points_per_centroid"] = _swigfaiss.ClusteringParameters_min_points_per_centroid_set - __swig_getmethods__["min_points_per_centroid"] = _swigfaiss.ClusteringParameters_min_points_per_centroid_get - if _newclass: - min_points_per_centroid = _swig_property(_swigfaiss.ClusteringParameters_min_points_per_centroid_get, _swigfaiss.ClusteringParameters_min_points_per_centroid_set) - __swig_setmethods__["max_points_per_centroid"] = _swigfaiss.ClusteringParameters_max_points_per_centroid_set - __swig_getmethods__["max_points_per_centroid"] = _swigfaiss.ClusteringParameters_max_points_per_centroid_get - if _newclass: - max_points_per_centroid = _swig_property(_swigfaiss.ClusteringParameters_max_points_per_centroid_get, _swigfaiss.ClusteringParameters_max_points_per_centroid_set) - __swig_setmethods__["seed"] = _swigfaiss.ClusteringParameters_seed_set - __swig_getmethods__["seed"] = _swigfaiss.ClusteringParameters_seed_get - if _newclass: - seed = _swig_property(_swigfaiss.ClusteringParameters_seed_get, _swigfaiss.ClusteringParameters_seed_set) - - def __init__(self): - this = _swigfaiss.new_ClusteringParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_ClusteringParameters - __del__ = lambda self: None -ClusteringParameters_swigregister = _swigfaiss.ClusteringParameters_swigregister -ClusteringParameters_swigregister(ClusteringParameters) - -class Clustering(ClusteringParameters): - __swig_setmethods__ = {} - for _s in [ClusteringParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, Clustering, name, value) - __swig_getmethods__ = {} - for _s in [ClusteringParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, Clustering, name) - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss.Clustering_d_set - __swig_getmethods__["d"] = _swigfaiss.Clustering_d_get - if _newclass: - d = _swig_property(_swigfaiss.Clustering_d_get, _swigfaiss.Clustering_d_set) - __swig_setmethods__["k"] = _swigfaiss.Clustering_k_set - __swig_getmethods__["k"] = _swigfaiss.Clustering_k_get - if _newclass: - k = _swig_property(_swigfaiss.Clustering_k_get, _swigfaiss.Clustering_k_set) - __swig_setmethods__["centroids"] = _swigfaiss.Clustering_centroids_set - __swig_getmethods__["centroids"] = _swigfaiss.Clustering_centroids_get - if _newclass: - centroids = _swig_property(_swigfaiss.Clustering_centroids_get, _swigfaiss.Clustering_centroids_set) - __swig_setmethods__["obj"] = _swigfaiss.Clustering_obj_set - __swig_getmethods__["obj"] = _swigfaiss.Clustering_obj_get - if _newclass: - obj = _swig_property(_swigfaiss.Clustering_obj_get, _swigfaiss.Clustering_obj_set) - - def __init__(self, *args): - this = _swigfaiss.new_Clustering(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x, index): - return _swigfaiss.Clustering_train(self, n, x, index) - - def post_process_centroids(self): - return _swigfaiss.Clustering_post_process_centroids(self) - __swig_destroy__ = _swigfaiss.delete_Clustering - __del__ = lambda self: None -Clustering_swigregister = _swigfaiss.Clustering_swigregister -Clustering_swigregister(Clustering) - - -def kmeans_clustering(d, n, k, x, centroids): - return _swigfaiss.kmeans_clustering(d, n, k, x, centroids) -kmeans_clustering = _swigfaiss.kmeans_clustering -class ProductQuantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ProductQuantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ProductQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss.ProductQuantizer_d_set - __swig_getmethods__["d"] = _swigfaiss.ProductQuantizer_d_get - if _newclass: - d = _swig_property(_swigfaiss.ProductQuantizer_d_get, _swigfaiss.ProductQuantizer_d_set) - __swig_setmethods__["M"] = _swigfaiss.ProductQuantizer_M_set - __swig_getmethods__["M"] = _swigfaiss.ProductQuantizer_M_get - if _newclass: - M = _swig_property(_swigfaiss.ProductQuantizer_M_get, _swigfaiss.ProductQuantizer_M_set) - __swig_setmethods__["nbits"] = _swigfaiss.ProductQuantizer_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss.ProductQuantizer_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss.ProductQuantizer_nbits_get, _swigfaiss.ProductQuantizer_nbits_set) - __swig_setmethods__["dsub"] = _swigfaiss.ProductQuantizer_dsub_set - __swig_getmethods__["dsub"] = _swigfaiss.ProductQuantizer_dsub_get - if _newclass: - dsub = _swig_property(_swigfaiss.ProductQuantizer_dsub_get, _swigfaiss.ProductQuantizer_dsub_set) - __swig_setmethods__["byte_per_idx"] = _swigfaiss.ProductQuantizer_byte_per_idx_set - __swig_getmethods__["byte_per_idx"] = _swigfaiss.ProductQuantizer_byte_per_idx_get - if _newclass: - byte_per_idx = _swig_property(_swigfaiss.ProductQuantizer_byte_per_idx_get, _swigfaiss.ProductQuantizer_byte_per_idx_set) - __swig_setmethods__["code_size"] = _swigfaiss.ProductQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.ProductQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.ProductQuantizer_code_size_get, _swigfaiss.ProductQuantizer_code_size_set) - __swig_setmethods__["ksub"] = _swigfaiss.ProductQuantizer_ksub_set - __swig_getmethods__["ksub"] = _swigfaiss.ProductQuantizer_ksub_get - if _newclass: - ksub = _swig_property(_swigfaiss.ProductQuantizer_ksub_get, _swigfaiss.ProductQuantizer_ksub_set) - __swig_setmethods__["verbose"] = _swigfaiss.ProductQuantizer_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.ProductQuantizer_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.ProductQuantizer_verbose_get, _swigfaiss.ProductQuantizer_verbose_set) - Train_default = _swigfaiss.ProductQuantizer_Train_default - Train_hot_start = _swigfaiss.ProductQuantizer_Train_hot_start - Train_shared = _swigfaiss.ProductQuantizer_Train_shared - Train_hypercube = _swigfaiss.ProductQuantizer_Train_hypercube - Train_hypercube_pca = _swigfaiss.ProductQuantizer_Train_hypercube_pca - __swig_setmethods__["train_type"] = _swigfaiss.ProductQuantizer_train_type_set - __swig_getmethods__["train_type"] = _swigfaiss.ProductQuantizer_train_type_get - if _newclass: - train_type = _swig_property(_swigfaiss.ProductQuantizer_train_type_get, _swigfaiss.ProductQuantizer_train_type_set) - __swig_setmethods__["cp"] = _swigfaiss.ProductQuantizer_cp_set - __swig_getmethods__["cp"] = _swigfaiss.ProductQuantizer_cp_get - if _newclass: - cp = _swig_property(_swigfaiss.ProductQuantizer_cp_get, _swigfaiss.ProductQuantizer_cp_set) - __swig_setmethods__["assign_index"] = _swigfaiss.ProductQuantizer_assign_index_set - __swig_getmethods__["assign_index"] = _swigfaiss.ProductQuantizer_assign_index_get - if _newclass: - assign_index = _swig_property(_swigfaiss.ProductQuantizer_assign_index_get, _swigfaiss.ProductQuantizer_assign_index_set) - __swig_setmethods__["centroids"] = _swigfaiss.ProductQuantizer_centroids_set - __swig_getmethods__["centroids"] = _swigfaiss.ProductQuantizer_centroids_get - if _newclass: - centroids = _swig_property(_swigfaiss.ProductQuantizer_centroids_get, _swigfaiss.ProductQuantizer_centroids_set) - - def get_centroids(self, m, i): - return _swigfaiss.ProductQuantizer_get_centroids(self, m, i) - - def train(self, n, x): - return _swigfaiss.ProductQuantizer_train(self, n, x) - - def __init__(self, *args): - this = _swigfaiss.new_ProductQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set_derived_values(self): - return _swigfaiss.ProductQuantizer_set_derived_values(self) - - def set_params(self, centroids, m): - return _swigfaiss.ProductQuantizer_set_params(self, centroids, m) - - def compute_code(self, x, code): - return _swigfaiss.ProductQuantizer_compute_code(self, x, code) - - def compute_codes(self, x, codes, n): - return _swigfaiss.ProductQuantizer_compute_codes(self, x, codes, n) - - def compute_codes_with_assign_index(self, x, codes, n): - return _swigfaiss.ProductQuantizer_compute_codes_with_assign_index(self, x, codes, n) - - def decode(self, *args): - return _swigfaiss.ProductQuantizer_decode(self, *args) - - def compute_code_from_distance_table(self, tab, code): - return _swigfaiss.ProductQuantizer_compute_code_from_distance_table(self, tab, code) - - def compute_distance_table(self, x, dis_table): - return _swigfaiss.ProductQuantizer_compute_distance_table(self, x, dis_table) - - def compute_inner_prod_table(self, x, dis_table): - return _swigfaiss.ProductQuantizer_compute_inner_prod_table(self, x, dis_table) - - def compute_distance_tables(self, nx, x, dis_tables): - return _swigfaiss.ProductQuantizer_compute_distance_tables(self, nx, x, dis_tables) - - def compute_inner_prod_tables(self, nx, x, dis_tables): - return _swigfaiss.ProductQuantizer_compute_inner_prod_tables(self, nx, x, dis_tables) - - def search(self, x, nx, codes, ncodes, res, init_finalize_heap=True): - return _swigfaiss.ProductQuantizer_search(self, x, nx, codes, ncodes, res, init_finalize_heap) - - def search_ip(self, x, nx, codes, ncodes, res, init_finalize_heap=True): - return _swigfaiss.ProductQuantizer_search_ip(self, x, nx, codes, ncodes, res, init_finalize_heap) - __swig_setmethods__["sdc_table"] = _swigfaiss.ProductQuantizer_sdc_table_set - __swig_getmethods__["sdc_table"] = _swigfaiss.ProductQuantizer_sdc_table_get - if _newclass: - sdc_table = _swig_property(_swigfaiss.ProductQuantizer_sdc_table_get, _swigfaiss.ProductQuantizer_sdc_table_set) - - def compute_sdc_table(self): - return _swigfaiss.ProductQuantizer_compute_sdc_table(self) - - def search_sdc(self, qcodes, nq, bcodes, ncodes, res, init_finalize_heap=True): - return _swigfaiss.ProductQuantizer_search_sdc(self, qcodes, nq, bcodes, ncodes, res, init_finalize_heap) - __swig_destroy__ = _swigfaiss.delete_ProductQuantizer - __del__ = lambda self: None -ProductQuantizer_swigregister = _swigfaiss.ProductQuantizer_swigregister -ProductQuantizer_swigregister(ProductQuantizer) - -class VectorTransform(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorTransform, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VectorTransform, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d_in"] = _swigfaiss.VectorTransform_d_in_set - __swig_getmethods__["d_in"] = _swigfaiss.VectorTransform_d_in_get - if _newclass: - d_in = _swig_property(_swigfaiss.VectorTransform_d_in_get, _swigfaiss.VectorTransform_d_in_set) - __swig_setmethods__["d_out"] = _swigfaiss.VectorTransform_d_out_set - __swig_getmethods__["d_out"] = _swigfaiss.VectorTransform_d_out_get - if _newclass: - d_out = _swig_property(_swigfaiss.VectorTransform_d_out_get, _swigfaiss.VectorTransform_d_out_set) - __swig_setmethods__["is_trained"] = _swigfaiss.VectorTransform_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss.VectorTransform_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss.VectorTransform_is_trained_get, _swigfaiss.VectorTransform_is_trained_set) - - def train(self, n, x): - return _swigfaiss.VectorTransform_train(self, n, x) - - def apply(self, n, x): - return _swigfaiss.VectorTransform_apply(self, n, x) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss.VectorTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss.VectorTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss.delete_VectorTransform - __del__ = lambda self: None -VectorTransform_swigregister = _swigfaiss.VectorTransform_swigregister -VectorTransform_swigregister(VectorTransform) - -class LinearTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, LinearTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, LinearTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["have_bias"] = _swigfaiss.LinearTransform_have_bias_set - __swig_getmethods__["have_bias"] = _swigfaiss.LinearTransform_have_bias_get - if _newclass: - have_bias = _swig_property(_swigfaiss.LinearTransform_have_bias_get, _swigfaiss.LinearTransform_have_bias_set) - __swig_setmethods__["is_orthonormal"] = _swigfaiss.LinearTransform_is_orthonormal_set - __swig_getmethods__["is_orthonormal"] = _swigfaiss.LinearTransform_is_orthonormal_get - if _newclass: - is_orthonormal = _swig_property(_swigfaiss.LinearTransform_is_orthonormal_get, _swigfaiss.LinearTransform_is_orthonormal_set) - __swig_setmethods__["A"] = _swigfaiss.LinearTransform_A_set - __swig_getmethods__["A"] = _swigfaiss.LinearTransform_A_get - if _newclass: - A = _swig_property(_swigfaiss.LinearTransform_A_get, _swigfaiss.LinearTransform_A_set) - __swig_setmethods__["b"] = _swigfaiss.LinearTransform_b_set - __swig_getmethods__["b"] = _swigfaiss.LinearTransform_b_get - if _newclass: - b = _swig_property(_swigfaiss.LinearTransform_b_get, _swigfaiss.LinearTransform_b_set) - - def __init__(self, d_in=0, d_out=0, have_bias=False): - this = _swigfaiss.new_LinearTransform(d_in, d_out, have_bias) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def apply_noalloc(self, n, x, xt): - return _swigfaiss.LinearTransform_apply_noalloc(self, n, x, xt) - - def transform_transpose(self, n, y, x): - return _swigfaiss.LinearTransform_transform_transpose(self, n, y, x) - - def reverse_transform(self, n, xt, x): - return _swigfaiss.LinearTransform_reverse_transform(self, n, xt, x) - - def set_is_orthonormal(self): - return _swigfaiss.LinearTransform_set_is_orthonormal(self) - __swig_setmethods__["verbose"] = _swigfaiss.LinearTransform_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.LinearTransform_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.LinearTransform_verbose_get, _swigfaiss.LinearTransform_verbose_set) - __swig_destroy__ = _swigfaiss.delete_LinearTransform - __del__ = lambda self: None -LinearTransform_swigregister = _swigfaiss.LinearTransform_swigregister -LinearTransform_swigregister(LinearTransform) - -class RandomRotationMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RandomRotationMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RandomRotationMatrix, name) - __repr__ = _swig_repr - - def init(self, seed): - return _swigfaiss.RandomRotationMatrix_init(self, seed) - - def train(self, n, x): - return _swigfaiss.RandomRotationMatrix_train(self, n, x) - - def __init__(self, *args): - this = _swigfaiss.new_RandomRotationMatrix(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_RandomRotationMatrix - __del__ = lambda self: None -RandomRotationMatrix_swigregister = _swigfaiss.RandomRotationMatrix_swigregister -RandomRotationMatrix_swigregister(RandomRotationMatrix) - -class PCAMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, PCAMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, PCAMatrix, name) - __repr__ = _swig_repr - __swig_setmethods__["eigen_power"] = _swigfaiss.PCAMatrix_eigen_power_set - __swig_getmethods__["eigen_power"] = _swigfaiss.PCAMatrix_eigen_power_get - if _newclass: - eigen_power = _swig_property(_swigfaiss.PCAMatrix_eigen_power_get, _swigfaiss.PCAMatrix_eigen_power_set) - __swig_setmethods__["random_rotation"] = _swigfaiss.PCAMatrix_random_rotation_set - __swig_getmethods__["random_rotation"] = _swigfaiss.PCAMatrix_random_rotation_get - if _newclass: - random_rotation = _swig_property(_swigfaiss.PCAMatrix_random_rotation_get, _swigfaiss.PCAMatrix_random_rotation_set) - __swig_setmethods__["max_points_per_d"] = _swigfaiss.PCAMatrix_max_points_per_d_set - __swig_getmethods__["max_points_per_d"] = _swigfaiss.PCAMatrix_max_points_per_d_get - if _newclass: - max_points_per_d = _swig_property(_swigfaiss.PCAMatrix_max_points_per_d_get, _swigfaiss.PCAMatrix_max_points_per_d_set) - __swig_setmethods__["balanced_bins"] = _swigfaiss.PCAMatrix_balanced_bins_set - __swig_getmethods__["balanced_bins"] = _swigfaiss.PCAMatrix_balanced_bins_get - if _newclass: - balanced_bins = _swig_property(_swigfaiss.PCAMatrix_balanced_bins_get, _swigfaiss.PCAMatrix_balanced_bins_set) - __swig_setmethods__["mean"] = _swigfaiss.PCAMatrix_mean_set - __swig_getmethods__["mean"] = _swigfaiss.PCAMatrix_mean_get - if _newclass: - mean = _swig_property(_swigfaiss.PCAMatrix_mean_get, _swigfaiss.PCAMatrix_mean_set) - __swig_setmethods__["eigenvalues"] = _swigfaiss.PCAMatrix_eigenvalues_set - __swig_getmethods__["eigenvalues"] = _swigfaiss.PCAMatrix_eigenvalues_get - if _newclass: - eigenvalues = _swig_property(_swigfaiss.PCAMatrix_eigenvalues_get, _swigfaiss.PCAMatrix_eigenvalues_set) - __swig_setmethods__["PCAMat"] = _swigfaiss.PCAMatrix_PCAMat_set - __swig_getmethods__["PCAMat"] = _swigfaiss.PCAMatrix_PCAMat_get - if _newclass: - PCAMat = _swig_property(_swigfaiss.PCAMatrix_PCAMat_get, _swigfaiss.PCAMatrix_PCAMat_set) - - def __init__(self, d_in=0, d_out=0, eigen_power=0, random_rotation=False): - this = _swigfaiss.new_PCAMatrix(d_in, d_out, eigen_power, random_rotation) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.PCAMatrix_train(self, n, x) - - def copy_from(self, other): - return _swigfaiss.PCAMatrix_copy_from(self, other) - - def prepare_Ab(self): - return _swigfaiss.PCAMatrix_prepare_Ab(self) - __swig_destroy__ = _swigfaiss.delete_PCAMatrix - __del__ = lambda self: None -PCAMatrix_swigregister = _swigfaiss.PCAMatrix_swigregister -PCAMatrix_swigregister(PCAMatrix) - -class OPQMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OPQMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OPQMatrix, name) - __repr__ = _swig_repr - __swig_setmethods__["M"] = _swigfaiss.OPQMatrix_M_set - __swig_getmethods__["M"] = _swigfaiss.OPQMatrix_M_get - if _newclass: - M = _swig_property(_swigfaiss.OPQMatrix_M_get, _swigfaiss.OPQMatrix_M_set) - __swig_setmethods__["niter"] = _swigfaiss.OPQMatrix_niter_set - __swig_getmethods__["niter"] = _swigfaiss.OPQMatrix_niter_get - if _newclass: - niter = _swig_property(_swigfaiss.OPQMatrix_niter_get, _swigfaiss.OPQMatrix_niter_set) - __swig_setmethods__["niter_pq"] = _swigfaiss.OPQMatrix_niter_pq_set - __swig_getmethods__["niter_pq"] = _swigfaiss.OPQMatrix_niter_pq_get - if _newclass: - niter_pq = _swig_property(_swigfaiss.OPQMatrix_niter_pq_get, _swigfaiss.OPQMatrix_niter_pq_set) - __swig_setmethods__["niter_pq_0"] = _swigfaiss.OPQMatrix_niter_pq_0_set - __swig_getmethods__["niter_pq_0"] = _swigfaiss.OPQMatrix_niter_pq_0_get - if _newclass: - niter_pq_0 = _swig_property(_swigfaiss.OPQMatrix_niter_pq_0_get, _swigfaiss.OPQMatrix_niter_pq_0_set) - __swig_setmethods__["max_train_points"] = _swigfaiss.OPQMatrix_max_train_points_set - __swig_getmethods__["max_train_points"] = _swigfaiss.OPQMatrix_max_train_points_get - if _newclass: - max_train_points = _swig_property(_swigfaiss.OPQMatrix_max_train_points_get, _swigfaiss.OPQMatrix_max_train_points_set) - __swig_setmethods__["verbose"] = _swigfaiss.OPQMatrix_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.OPQMatrix_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.OPQMatrix_verbose_get, _swigfaiss.OPQMatrix_verbose_set) - __swig_setmethods__["pq"] = _swigfaiss.OPQMatrix_pq_set - __swig_getmethods__["pq"] = _swigfaiss.OPQMatrix_pq_get - if _newclass: - pq = _swig_property(_swigfaiss.OPQMatrix_pq_get, _swigfaiss.OPQMatrix_pq_set) - - def __init__(self, d=0, M=1, d2=-1): - this = _swigfaiss.new_OPQMatrix(d, M, d2) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.OPQMatrix_train(self, n, x) - __swig_destroy__ = _swigfaiss.delete_OPQMatrix - __del__ = lambda self: None -OPQMatrix_swigregister = _swigfaiss.OPQMatrix_swigregister -OPQMatrix_swigregister(OPQMatrix) - -class RemapDimensionsTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RemapDimensionsTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RemapDimensionsTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["map"] = _swigfaiss.RemapDimensionsTransform_map_set - __swig_getmethods__["map"] = _swigfaiss.RemapDimensionsTransform_map_get - if _newclass: - map = _swig_property(_swigfaiss.RemapDimensionsTransform_map_get, _swigfaiss.RemapDimensionsTransform_map_set) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss.RemapDimensionsTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss.RemapDimensionsTransform_reverse_transform(self, n, xt, x) - - def __init__(self, *args): - this = _swigfaiss.new_RemapDimensionsTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_RemapDimensionsTransform - __del__ = lambda self: None -RemapDimensionsTransform_swigregister = _swigfaiss.RemapDimensionsTransform_swigregister -RemapDimensionsTransform_swigregister(RemapDimensionsTransform) - -class NormalizationTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, NormalizationTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, NormalizationTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["norm"] = _swigfaiss.NormalizationTransform_norm_set - __swig_getmethods__["norm"] = _swigfaiss.NormalizationTransform_norm_get - if _newclass: - norm = _swig_property(_swigfaiss.NormalizationTransform_norm_get, _swigfaiss.NormalizationTransform_norm_set) - - def __init__(self, *args): - this = _swigfaiss.new_NormalizationTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def apply_noalloc(self, n, x, xt): - return _swigfaiss.NormalizationTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss.NormalizationTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss.delete_NormalizationTransform - __del__ = lambda self: None -NormalizationTransform_swigregister = _swigfaiss.NormalizationTransform_swigregister -NormalizationTransform_swigregister(NormalizationTransform) - -class CenteringTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, CenteringTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, CenteringTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["mean"] = _swigfaiss.CenteringTransform_mean_set - __swig_getmethods__["mean"] = _swigfaiss.CenteringTransform_mean_get - if _newclass: - mean = _swig_property(_swigfaiss.CenteringTransform_mean_get, _swigfaiss.CenteringTransform_mean_set) - - def __init__(self, d=0): - this = _swigfaiss.new_CenteringTransform(d) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.CenteringTransform_train(self, n, x) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss.CenteringTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss.CenteringTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss.delete_CenteringTransform - __del__ = lambda self: None -CenteringTransform_swigregister = _swigfaiss.CenteringTransform_swigregister -CenteringTransform_swigregister(CenteringTransform) - -class IndexPreTransform(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPreTransform, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexPreTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["chain"] = _swigfaiss.IndexPreTransform_chain_set - __swig_getmethods__["chain"] = _swigfaiss.IndexPreTransform_chain_get - if _newclass: - chain = _swig_property(_swigfaiss.IndexPreTransform_chain_get, _swigfaiss.IndexPreTransform_chain_set) - __swig_setmethods__["index"] = _swigfaiss.IndexPreTransform_index_set - __swig_getmethods__["index"] = _swigfaiss.IndexPreTransform_index_get - if _newclass: - index = _swig_property(_swigfaiss.IndexPreTransform_index_get, _swigfaiss.IndexPreTransform_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexPreTransform_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexPreTransform_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexPreTransform_own_fields_get, _swigfaiss.IndexPreTransform_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexPreTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def prepend_transform(self, ltrans): - return _swigfaiss.IndexPreTransform_prepend_transform(self, ltrans) - - def train(self, n, x): - return _swigfaiss.IndexPreTransform_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexPreTransform_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexPreTransform_add_with_ids(self, n, x, xids) - - def reset(self): - return _swigfaiss.IndexPreTransform_reset(self) - - def remove_ids(self, sel): - return _swigfaiss.IndexPreTransform_remove_ids(self, sel) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexPreTransform_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexPreTransform_range_search(self, n, x, radius, result) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexPreTransform_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexPreTransform_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss.IndexPreTransform_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def apply_chain(self, n, x): - return _swigfaiss.IndexPreTransform_apply_chain(self, n, x) - - def reverse_chain(self, n, xt, x): - return _swigfaiss.IndexPreTransform_reverse_chain(self, n, xt, x) - __swig_destroy__ = _swigfaiss.delete_IndexPreTransform - __del__ = lambda self: None -IndexPreTransform_swigregister = _swigfaiss.IndexPreTransform_swigregister -IndexPreTransform_swigregister(IndexPreTransform) - -class IndexFlat(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlat, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["xb"] = _swigfaiss.IndexFlat_xb_set - __swig_getmethods__["xb"] = _swigfaiss.IndexFlat_xb_get - if _newclass: - xb = _swig_property(_swigfaiss.IndexFlat_xb_get, _swigfaiss.IndexFlat_xb_set) - - def add(self, n, x): - return _swigfaiss.IndexFlat_add(self, n, x) - - def reset(self): - return _swigfaiss.IndexFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexFlat_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexFlat_range_search(self, n, x, radius, result) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexFlat_reconstruct(self, key, recons) - - def compute_distance_subset(self, n, x, k, distances, labels): - return _swigfaiss.IndexFlat_compute_distance_subset(self, n, x, k, distances, labels) - - def remove_ids(self, sel): - return _swigfaiss.IndexFlat_remove_ids(self, sel) - - def __init__(self, *args): - this = _swigfaiss.new_IndexFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexFlat - __del__ = lambda self: None -IndexFlat_swigregister = _swigfaiss.IndexFlat_swigregister -IndexFlat_swigregister(IndexFlat) - -class IndexFlatIP(IndexFlat): - __swig_setmethods__ = {} - for _s in [IndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatIP, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatIP, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexFlatIP(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexFlatIP - __del__ = lambda self: None -IndexFlatIP_swigregister = _swigfaiss.IndexFlatIP_swigregister -IndexFlatIP_swigregister(IndexFlatIP) - -class IndexFlatL2(IndexFlat): - __swig_setmethods__ = {} - for _s in [IndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatL2, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatL2, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexFlatL2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexFlatL2 - __del__ = lambda self: None -IndexFlatL2_swigregister = _swigfaiss.IndexFlatL2_swigregister -IndexFlatL2_swigregister(IndexFlatL2) - -class IndexFlatL2BaseShift(IndexFlatL2): - __swig_setmethods__ = {} - for _s in [IndexFlatL2]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatL2BaseShift, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlatL2]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatL2BaseShift, name) - __repr__ = _swig_repr - __swig_setmethods__["shift"] = _swigfaiss.IndexFlatL2BaseShift_shift_set - __swig_getmethods__["shift"] = _swigfaiss.IndexFlatL2BaseShift_shift_get - if _newclass: - shift = _swig_property(_swigfaiss.IndexFlatL2BaseShift_shift_get, _swigfaiss.IndexFlatL2BaseShift_shift_set) - - def __init__(self, d, nshift, shift): - this = _swigfaiss.new_IndexFlatL2BaseShift(d, nshift, shift) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexFlatL2BaseShift_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss.delete_IndexFlatL2BaseShift - __del__ = lambda self: None -IndexFlatL2BaseShift_swigregister = _swigfaiss.IndexFlatL2BaseShift_swigregister -IndexFlatL2BaseShift_swigregister(IndexFlatL2BaseShift) - -class IndexRefineFlat(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexRefineFlat, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexRefineFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["refine_index"] = _swigfaiss.IndexRefineFlat_refine_index_set - __swig_getmethods__["refine_index"] = _swigfaiss.IndexRefineFlat_refine_index_get - if _newclass: - refine_index = _swig_property(_swigfaiss.IndexRefineFlat_refine_index_get, _swigfaiss.IndexRefineFlat_refine_index_set) - __swig_setmethods__["base_index"] = _swigfaiss.IndexRefineFlat_base_index_set - __swig_getmethods__["base_index"] = _swigfaiss.IndexRefineFlat_base_index_get - if _newclass: - base_index = _swig_property(_swigfaiss.IndexRefineFlat_base_index_get, _swigfaiss.IndexRefineFlat_base_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexRefineFlat_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexRefineFlat_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexRefineFlat_own_fields_get, _swigfaiss.IndexRefineFlat_own_fields_set) - __swig_setmethods__["k_factor"] = _swigfaiss.IndexRefineFlat_k_factor_set - __swig_getmethods__["k_factor"] = _swigfaiss.IndexRefineFlat_k_factor_get - if _newclass: - k_factor = _swig_property(_swigfaiss.IndexRefineFlat_k_factor_get, _swigfaiss.IndexRefineFlat_k_factor_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexRefineFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.IndexRefineFlat_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexRefineFlat_add(self, n, x) - - def reset(self): - return _swigfaiss.IndexRefineFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexRefineFlat_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss.delete_IndexRefineFlat - __del__ = lambda self: None -IndexRefineFlat_swigregister = _swigfaiss.IndexRefineFlat_swigregister -IndexRefineFlat_swigregister(IndexRefineFlat) - -class IndexFlat1D(IndexFlatL2): - __swig_setmethods__ = {} - for _s in [IndexFlatL2]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlat1D, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlatL2]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlat1D, name) - __repr__ = _swig_repr - __swig_setmethods__["continuous_update"] = _swigfaiss.IndexFlat1D_continuous_update_set - __swig_getmethods__["continuous_update"] = _swigfaiss.IndexFlat1D_continuous_update_get - if _newclass: - continuous_update = _swig_property(_swigfaiss.IndexFlat1D_continuous_update_get, _swigfaiss.IndexFlat1D_continuous_update_set) - __swig_setmethods__["perm"] = _swigfaiss.IndexFlat1D_perm_set - __swig_getmethods__["perm"] = _swigfaiss.IndexFlat1D_perm_get - if _newclass: - perm = _swig_property(_swigfaiss.IndexFlat1D_perm_get, _swigfaiss.IndexFlat1D_perm_set) - - def __init__(self, continuous_update=True): - this = _swigfaiss.new_IndexFlat1D(continuous_update) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def update_permutation(self): - return _swigfaiss.IndexFlat1D_update_permutation(self) - - def add(self, n, x): - return _swigfaiss.IndexFlat1D_add(self, n, x) - - def reset(self): - return _swigfaiss.IndexFlat1D_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexFlat1D_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss.delete_IndexFlat1D - __del__ = lambda self: None -IndexFlat1D_swigregister = _swigfaiss.IndexFlat1D_swigregister -IndexFlat1D_swigregister(IndexFlat1D) - -class IndexLSH(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexLSH, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexLSH, name) - __repr__ = _swig_repr - __swig_setmethods__["nbits"] = _swigfaiss.IndexLSH_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss.IndexLSH_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss.IndexLSH_nbits_get, _swigfaiss.IndexLSH_nbits_set) - __swig_setmethods__["bytes_per_vec"] = _swigfaiss.IndexLSH_bytes_per_vec_set - __swig_getmethods__["bytes_per_vec"] = _swigfaiss.IndexLSH_bytes_per_vec_get - if _newclass: - bytes_per_vec = _swig_property(_swigfaiss.IndexLSH_bytes_per_vec_get, _swigfaiss.IndexLSH_bytes_per_vec_set) - __swig_setmethods__["rotate_data"] = _swigfaiss.IndexLSH_rotate_data_set - __swig_getmethods__["rotate_data"] = _swigfaiss.IndexLSH_rotate_data_get - if _newclass: - rotate_data = _swig_property(_swigfaiss.IndexLSH_rotate_data_get, _swigfaiss.IndexLSH_rotate_data_set) - __swig_setmethods__["train_thresholds"] = _swigfaiss.IndexLSH_train_thresholds_set - __swig_getmethods__["train_thresholds"] = _swigfaiss.IndexLSH_train_thresholds_get - if _newclass: - train_thresholds = _swig_property(_swigfaiss.IndexLSH_train_thresholds_get, _swigfaiss.IndexLSH_train_thresholds_set) - __swig_setmethods__["rrot"] = _swigfaiss.IndexLSH_rrot_set - __swig_getmethods__["rrot"] = _swigfaiss.IndexLSH_rrot_get - if _newclass: - rrot = _swig_property(_swigfaiss.IndexLSH_rrot_get, _swigfaiss.IndexLSH_rrot_set) - __swig_setmethods__["thresholds"] = _swigfaiss.IndexLSH_thresholds_set - __swig_getmethods__["thresholds"] = _swigfaiss.IndexLSH_thresholds_get - if _newclass: - thresholds = _swig_property(_swigfaiss.IndexLSH_thresholds_get, _swigfaiss.IndexLSH_thresholds_set) - __swig_setmethods__["codes"] = _swigfaiss.IndexLSH_codes_set - __swig_getmethods__["codes"] = _swigfaiss.IndexLSH_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.IndexLSH_codes_get, _swigfaiss.IndexLSH_codes_set) - - def apply_preprocess(self, n, x): - return _swigfaiss.IndexLSH_apply_preprocess(self, n, x) - - def train(self, n, x): - return _swigfaiss.IndexLSH_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexLSH_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexLSH_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss.IndexLSH_reset(self) - - def transfer_thresholds(self, vt): - return _swigfaiss.IndexLSH_transfer_thresholds(self, vt) - __swig_destroy__ = _swigfaiss.delete_IndexLSH - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss.new_IndexLSH(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexLSH_swigregister = _swigfaiss.IndexLSH_swigregister -IndexLSH_swigregister(IndexLSH) - -class SimulatedAnnealingParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, SimulatedAnnealingParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, SimulatedAnnealingParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["init_temperature"] = _swigfaiss.SimulatedAnnealingParameters_init_temperature_set - __swig_getmethods__["init_temperature"] = _swigfaiss.SimulatedAnnealingParameters_init_temperature_get - if _newclass: - init_temperature = _swig_property(_swigfaiss.SimulatedAnnealingParameters_init_temperature_get, _swigfaiss.SimulatedAnnealingParameters_init_temperature_set) - __swig_setmethods__["temperature_decay"] = _swigfaiss.SimulatedAnnealingParameters_temperature_decay_set - __swig_getmethods__["temperature_decay"] = _swigfaiss.SimulatedAnnealingParameters_temperature_decay_get - if _newclass: - temperature_decay = _swig_property(_swigfaiss.SimulatedAnnealingParameters_temperature_decay_get, _swigfaiss.SimulatedAnnealingParameters_temperature_decay_set) - __swig_setmethods__["n_iter"] = _swigfaiss.SimulatedAnnealingParameters_n_iter_set - __swig_getmethods__["n_iter"] = _swigfaiss.SimulatedAnnealingParameters_n_iter_get - if _newclass: - n_iter = _swig_property(_swigfaiss.SimulatedAnnealingParameters_n_iter_get, _swigfaiss.SimulatedAnnealingParameters_n_iter_set) - __swig_setmethods__["n_redo"] = _swigfaiss.SimulatedAnnealingParameters_n_redo_set - __swig_getmethods__["n_redo"] = _swigfaiss.SimulatedAnnealingParameters_n_redo_get - if _newclass: - n_redo = _swig_property(_swigfaiss.SimulatedAnnealingParameters_n_redo_get, _swigfaiss.SimulatedAnnealingParameters_n_redo_set) - __swig_setmethods__["seed"] = _swigfaiss.SimulatedAnnealingParameters_seed_set - __swig_getmethods__["seed"] = _swigfaiss.SimulatedAnnealingParameters_seed_get - if _newclass: - seed = _swig_property(_swigfaiss.SimulatedAnnealingParameters_seed_get, _swigfaiss.SimulatedAnnealingParameters_seed_set) - __swig_setmethods__["verbose"] = _swigfaiss.SimulatedAnnealingParameters_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.SimulatedAnnealingParameters_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.SimulatedAnnealingParameters_verbose_get, _swigfaiss.SimulatedAnnealingParameters_verbose_set) - __swig_setmethods__["only_bit_flips"] = _swigfaiss.SimulatedAnnealingParameters_only_bit_flips_set - __swig_getmethods__["only_bit_flips"] = _swigfaiss.SimulatedAnnealingParameters_only_bit_flips_get - if _newclass: - only_bit_flips = _swig_property(_swigfaiss.SimulatedAnnealingParameters_only_bit_flips_get, _swigfaiss.SimulatedAnnealingParameters_only_bit_flips_set) - __swig_setmethods__["init_random"] = _swigfaiss.SimulatedAnnealingParameters_init_random_set - __swig_getmethods__["init_random"] = _swigfaiss.SimulatedAnnealingParameters_init_random_get - if _newclass: - init_random = _swig_property(_swigfaiss.SimulatedAnnealingParameters_init_random_get, _swigfaiss.SimulatedAnnealingParameters_init_random_set) - - def __init__(self): - this = _swigfaiss.new_SimulatedAnnealingParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_SimulatedAnnealingParameters - __del__ = lambda self: None -SimulatedAnnealingParameters_swigregister = _swigfaiss.SimulatedAnnealingParameters_swigregister -SimulatedAnnealingParameters_swigregister(SimulatedAnnealingParameters) - -class PermutationObjective(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, PermutationObjective, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, PermutationObjective, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["n"] = _swigfaiss.PermutationObjective_n_set - __swig_getmethods__["n"] = _swigfaiss.PermutationObjective_n_get - if _newclass: - n = _swig_property(_swigfaiss.PermutationObjective_n_get, _swigfaiss.PermutationObjective_n_set) - - def compute_cost(self, perm): - return _swigfaiss.PermutationObjective_compute_cost(self, perm) - - def cost_update(self, perm, iw, jw): - return _swigfaiss.PermutationObjective_cost_update(self, perm, iw, jw) - __swig_destroy__ = _swigfaiss.delete_PermutationObjective - __del__ = lambda self: None -PermutationObjective_swigregister = _swigfaiss.PermutationObjective_swigregister -PermutationObjective_swigregister(PermutationObjective) - -class ReproduceDistancesObjective(PermutationObjective): - __swig_setmethods__ = {} - for _s in [PermutationObjective]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ReproduceDistancesObjective, name, value) - __swig_getmethods__ = {} - for _s in [PermutationObjective]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ReproduceDistancesObjective, name) - __repr__ = _swig_repr - __swig_setmethods__["dis_weight_factor"] = _swigfaiss.ReproduceDistancesObjective_dis_weight_factor_set - __swig_getmethods__["dis_weight_factor"] = _swigfaiss.ReproduceDistancesObjective_dis_weight_factor_get - if _newclass: - dis_weight_factor = _swig_property(_swigfaiss.ReproduceDistancesObjective_dis_weight_factor_get, _swigfaiss.ReproduceDistancesObjective_dis_weight_factor_set) - if _newclass: - sqr = staticmethod(_swigfaiss.ReproduceDistancesObjective_sqr) - else: - sqr = _swigfaiss.ReproduceDistancesObjective_sqr - - def dis_weight(self, x): - return _swigfaiss.ReproduceDistancesObjective_dis_weight(self, x) - __swig_setmethods__["source_dis"] = _swigfaiss.ReproduceDistancesObjective_source_dis_set - __swig_getmethods__["source_dis"] = _swigfaiss.ReproduceDistancesObjective_source_dis_get - if _newclass: - source_dis = _swig_property(_swigfaiss.ReproduceDistancesObjective_source_dis_get, _swigfaiss.ReproduceDistancesObjective_source_dis_set) - __swig_setmethods__["target_dis"] = _swigfaiss.ReproduceDistancesObjective_target_dis_set - __swig_getmethods__["target_dis"] = _swigfaiss.ReproduceDistancesObjective_target_dis_get - if _newclass: - target_dis = _swig_property(_swigfaiss.ReproduceDistancesObjective_target_dis_get, _swigfaiss.ReproduceDistancesObjective_target_dis_set) - __swig_setmethods__["weights"] = _swigfaiss.ReproduceDistancesObjective_weights_set - __swig_getmethods__["weights"] = _swigfaiss.ReproduceDistancesObjective_weights_get - if _newclass: - weights = _swig_property(_swigfaiss.ReproduceDistancesObjective_weights_get, _swigfaiss.ReproduceDistancesObjective_weights_set) - - def get_source_dis(self, i, j): - return _swigfaiss.ReproduceDistancesObjective_get_source_dis(self, i, j) - - def compute_cost(self, perm): - return _swigfaiss.ReproduceDistancesObjective_compute_cost(self, perm) - - def cost_update(self, perm, iw, jw): - return _swigfaiss.ReproduceDistancesObjective_cost_update(self, perm, iw, jw) - - def __init__(self, n, source_dis_in, target_dis_in, dis_weight_factor): - this = _swigfaiss.new_ReproduceDistancesObjective(n, source_dis_in, target_dis_in, dis_weight_factor) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - if _newclass: - compute_mean_stdev = staticmethod(_swigfaiss.ReproduceDistancesObjective_compute_mean_stdev) - else: - compute_mean_stdev = _swigfaiss.ReproduceDistancesObjective_compute_mean_stdev - - def set_affine_target_dis(self, source_dis_in): - return _swigfaiss.ReproduceDistancesObjective_set_affine_target_dis(self, source_dis_in) - __swig_destroy__ = _swigfaiss.delete_ReproduceDistancesObjective - __del__ = lambda self: None -ReproduceDistancesObjective_swigregister = _swigfaiss.ReproduceDistancesObjective_swigregister -ReproduceDistancesObjective_swigregister(ReproduceDistancesObjective) - -def ReproduceDistancesObjective_sqr(x): - return _swigfaiss.ReproduceDistancesObjective_sqr(x) -ReproduceDistancesObjective_sqr = _swigfaiss.ReproduceDistancesObjective_sqr - -def ReproduceDistancesObjective_compute_mean_stdev(tab, n2, mean_out, stddev_out): - return _swigfaiss.ReproduceDistancesObjective_compute_mean_stdev(tab, n2, mean_out, stddev_out) -ReproduceDistancesObjective_compute_mean_stdev = _swigfaiss.ReproduceDistancesObjective_compute_mean_stdev - -class SimulatedAnnealingOptimizer(SimulatedAnnealingParameters): - __swig_setmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, SimulatedAnnealingOptimizer, name, value) - __swig_getmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, SimulatedAnnealingOptimizer, name) - __repr__ = _swig_repr - __swig_setmethods__["obj"] = _swigfaiss.SimulatedAnnealingOptimizer_obj_set - __swig_getmethods__["obj"] = _swigfaiss.SimulatedAnnealingOptimizer_obj_get - if _newclass: - obj = _swig_property(_swigfaiss.SimulatedAnnealingOptimizer_obj_get, _swigfaiss.SimulatedAnnealingOptimizer_obj_set) - __swig_setmethods__["n"] = _swigfaiss.SimulatedAnnealingOptimizer_n_set - __swig_getmethods__["n"] = _swigfaiss.SimulatedAnnealingOptimizer_n_get - if _newclass: - n = _swig_property(_swigfaiss.SimulatedAnnealingOptimizer_n_get, _swigfaiss.SimulatedAnnealingOptimizer_n_set) - __swig_setmethods__["logfile"] = _swigfaiss.SimulatedAnnealingOptimizer_logfile_set - __swig_getmethods__["logfile"] = _swigfaiss.SimulatedAnnealingOptimizer_logfile_get - if _newclass: - logfile = _swig_property(_swigfaiss.SimulatedAnnealingOptimizer_logfile_get, _swigfaiss.SimulatedAnnealingOptimizer_logfile_set) - - def __init__(self, obj, p): - this = _swigfaiss.new_SimulatedAnnealingOptimizer(obj, p) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["rnd"] = _swigfaiss.SimulatedAnnealingOptimizer_rnd_set - __swig_getmethods__["rnd"] = _swigfaiss.SimulatedAnnealingOptimizer_rnd_get - if _newclass: - rnd = _swig_property(_swigfaiss.SimulatedAnnealingOptimizer_rnd_get, _swigfaiss.SimulatedAnnealingOptimizer_rnd_set) - __swig_setmethods__["init_cost"] = _swigfaiss.SimulatedAnnealingOptimizer_init_cost_set - __swig_getmethods__["init_cost"] = _swigfaiss.SimulatedAnnealingOptimizer_init_cost_get - if _newclass: - init_cost = _swig_property(_swigfaiss.SimulatedAnnealingOptimizer_init_cost_get, _swigfaiss.SimulatedAnnealingOptimizer_init_cost_set) - - def optimize(self, perm): - return _swigfaiss.SimulatedAnnealingOptimizer_optimize(self, perm) - - def run_optimization(self, best_perm): - return _swigfaiss.SimulatedAnnealingOptimizer_run_optimization(self, best_perm) - __swig_destroy__ = _swigfaiss.delete_SimulatedAnnealingOptimizer - __del__ = lambda self: None -SimulatedAnnealingOptimizer_swigregister = _swigfaiss.SimulatedAnnealingOptimizer_swigregister -SimulatedAnnealingOptimizer_swigregister(SimulatedAnnealingOptimizer) - -class PolysemousTraining(SimulatedAnnealingParameters): - __swig_setmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, PolysemousTraining, name, value) - __swig_getmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, PolysemousTraining, name) - __repr__ = _swig_repr - OT_None = _swigfaiss.PolysemousTraining_OT_None - OT_ReproduceDistances_affine = _swigfaiss.PolysemousTraining_OT_ReproduceDistances_affine - OT_Ranking_weighted_diff = _swigfaiss.PolysemousTraining_OT_Ranking_weighted_diff - __swig_setmethods__["optimization_type"] = _swigfaiss.PolysemousTraining_optimization_type_set - __swig_getmethods__["optimization_type"] = _swigfaiss.PolysemousTraining_optimization_type_get - if _newclass: - optimization_type = _swig_property(_swigfaiss.PolysemousTraining_optimization_type_get, _swigfaiss.PolysemousTraining_optimization_type_set) - __swig_setmethods__["ntrain_permutation"] = _swigfaiss.PolysemousTraining_ntrain_permutation_set - __swig_getmethods__["ntrain_permutation"] = _swigfaiss.PolysemousTraining_ntrain_permutation_get - if _newclass: - ntrain_permutation = _swig_property(_swigfaiss.PolysemousTraining_ntrain_permutation_get, _swigfaiss.PolysemousTraining_ntrain_permutation_set) - __swig_setmethods__["dis_weight_factor"] = _swigfaiss.PolysemousTraining_dis_weight_factor_set - __swig_getmethods__["dis_weight_factor"] = _swigfaiss.PolysemousTraining_dis_weight_factor_get - if _newclass: - dis_weight_factor = _swig_property(_swigfaiss.PolysemousTraining_dis_weight_factor_get, _swigfaiss.PolysemousTraining_dis_weight_factor_set) - __swig_setmethods__["log_pattern"] = _swigfaiss.PolysemousTraining_log_pattern_set - __swig_getmethods__["log_pattern"] = _swigfaiss.PolysemousTraining_log_pattern_get - if _newclass: - log_pattern = _swig_property(_swigfaiss.PolysemousTraining_log_pattern_get, _swigfaiss.PolysemousTraining_log_pattern_set) - - def __init__(self): - this = _swigfaiss.new_PolysemousTraining() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def optimize_pq_for_hamming(self, pq, n, x): - return _swigfaiss.PolysemousTraining_optimize_pq_for_hamming(self, pq, n, x) - - def optimize_ranking(self, pq, n, x): - return _swigfaiss.PolysemousTraining_optimize_ranking(self, pq, n, x) - - def optimize_reproduce_distances(self, pq): - return _swigfaiss.PolysemousTraining_optimize_reproduce_distances(self, pq) - __swig_destroy__ = _swigfaiss.delete_PolysemousTraining - __del__ = lambda self: None -PolysemousTraining_swigregister = _swigfaiss.PolysemousTraining_swigregister -PolysemousTraining_swigregister(PolysemousTraining) - -class IndexPQ(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPQ, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexPQ, name) - __repr__ = _swig_repr - __swig_setmethods__["pq"] = _swigfaiss.IndexPQ_pq_set - __swig_getmethods__["pq"] = _swigfaiss.IndexPQ_pq_get - if _newclass: - pq = _swig_property(_swigfaiss.IndexPQ_pq_get, _swigfaiss.IndexPQ_pq_set) - __swig_setmethods__["codes"] = _swigfaiss.IndexPQ_codes_set - __swig_getmethods__["codes"] = _swigfaiss.IndexPQ_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.IndexPQ_codes_get, _swigfaiss.IndexPQ_codes_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.IndexPQ_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexPQ_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexPQ_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss.IndexPQ_reset(self) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexPQ_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexPQ_reconstruct(self, key, recons) - - def remove_ids(self, sel): - return _swigfaiss.IndexPQ_remove_ids(self, sel) - __swig_setmethods__["do_polysemous_training"] = _swigfaiss.IndexPQ_do_polysemous_training_set - __swig_getmethods__["do_polysemous_training"] = _swigfaiss.IndexPQ_do_polysemous_training_get - if _newclass: - do_polysemous_training = _swig_property(_swigfaiss.IndexPQ_do_polysemous_training_get, _swigfaiss.IndexPQ_do_polysemous_training_set) - __swig_setmethods__["polysemous_training"] = _swigfaiss.IndexPQ_polysemous_training_set - __swig_getmethods__["polysemous_training"] = _swigfaiss.IndexPQ_polysemous_training_get - if _newclass: - polysemous_training = _swig_property(_swigfaiss.IndexPQ_polysemous_training_get, _swigfaiss.IndexPQ_polysemous_training_set) - ST_PQ = _swigfaiss.IndexPQ_ST_PQ - ST_HE = _swigfaiss.IndexPQ_ST_HE - ST_generalized_HE = _swigfaiss.IndexPQ_ST_generalized_HE - ST_SDC = _swigfaiss.IndexPQ_ST_SDC - ST_polysemous = _swigfaiss.IndexPQ_ST_polysemous - ST_polysemous_generalize = _swigfaiss.IndexPQ_ST_polysemous_generalize - __swig_setmethods__["search_type"] = _swigfaiss.IndexPQ_search_type_set - __swig_getmethods__["search_type"] = _swigfaiss.IndexPQ_search_type_get - if _newclass: - search_type = _swig_property(_swigfaiss.IndexPQ_search_type_get, _swigfaiss.IndexPQ_search_type_set) - __swig_setmethods__["encode_signs"] = _swigfaiss.IndexPQ_encode_signs_set - __swig_getmethods__["encode_signs"] = _swigfaiss.IndexPQ_encode_signs_get - if _newclass: - encode_signs = _swig_property(_swigfaiss.IndexPQ_encode_signs_get, _swigfaiss.IndexPQ_encode_signs_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss.IndexPQ_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss.IndexPQ_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss.IndexPQ_polysemous_ht_get, _swigfaiss.IndexPQ_polysemous_ht_set) - - def search_core_polysemous(self, n, x, k, distances, labels): - return _swigfaiss.IndexPQ_search_core_polysemous(self, n, x, k, distances, labels) - - def hamming_distance_histogram(self, n, x, nb, xb, dist_histogram): - return _swigfaiss.IndexPQ_hamming_distance_histogram(self, n, x, nb, xb, dist_histogram) - - def hamming_distance_table(self, n, x, dis): - return _swigfaiss.IndexPQ_hamming_distance_table(self, n, x, dis) - __swig_destroy__ = _swigfaiss.delete_IndexPQ - __del__ = lambda self: None -IndexPQ_swigregister = _swigfaiss.IndexPQ_swigregister -IndexPQ_swigregister(IndexPQ) - -class IndexPQStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPQStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexPQStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss.IndexPQStats_nq_set - __swig_getmethods__["nq"] = _swigfaiss.IndexPQStats_nq_get - if _newclass: - nq = _swig_property(_swigfaiss.IndexPQStats_nq_get, _swigfaiss.IndexPQStats_nq_set) - __swig_setmethods__["ncode"] = _swigfaiss.IndexPQStats_ncode_set - __swig_getmethods__["ncode"] = _swigfaiss.IndexPQStats_ncode_get - if _newclass: - ncode = _swig_property(_swigfaiss.IndexPQStats_ncode_get, _swigfaiss.IndexPQStats_ncode_set) - __swig_setmethods__["n_hamming_pass"] = _swigfaiss.IndexPQStats_n_hamming_pass_set - __swig_getmethods__["n_hamming_pass"] = _swigfaiss.IndexPQStats_n_hamming_pass_get - if _newclass: - n_hamming_pass = _swig_property(_swigfaiss.IndexPQStats_n_hamming_pass_get, _swigfaiss.IndexPQStats_n_hamming_pass_set) - - def __init__(self): - this = _swigfaiss.new_IndexPQStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss.IndexPQStats_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexPQStats - __del__ = lambda self: None -IndexPQStats_swigregister = _swigfaiss.IndexPQStats_swigregister -IndexPQStats_swigregister(IndexPQStats) - -class MultiIndexQuantizer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, MultiIndexQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, MultiIndexQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["pq"] = _swigfaiss.MultiIndexQuantizer_pq_set - __swig_getmethods__["pq"] = _swigfaiss.MultiIndexQuantizer_pq_get - if _newclass: - pq = _swig_property(_swigfaiss.MultiIndexQuantizer_pq_get, _swigfaiss.MultiIndexQuantizer_pq_set) - - def train(self, n, x): - return _swigfaiss.MultiIndexQuantizer_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.MultiIndexQuantizer_search(self, n, x, k, distances, labels) - - def add(self, n, x): - return _swigfaiss.MultiIndexQuantizer_add(self, n, x) - - def reset(self): - return _swigfaiss.MultiIndexQuantizer_reset(self) - - def __init__(self, *args): - this = _swigfaiss.new_MultiIndexQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reconstruct(self, key, recons): - return _swigfaiss.MultiIndexQuantizer_reconstruct(self, key, recons) - __swig_destroy__ = _swigfaiss.delete_MultiIndexQuantizer - __del__ = lambda self: None -MultiIndexQuantizer_swigregister = _swigfaiss.MultiIndexQuantizer_swigregister -MultiIndexQuantizer_swigregister(MultiIndexQuantizer) - -class MultiIndexQuantizer2(MultiIndexQuantizer): - __swig_setmethods__ = {} - for _s in [MultiIndexQuantizer]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, MultiIndexQuantizer2, name, value) - __swig_getmethods__ = {} - for _s in [MultiIndexQuantizer]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, MultiIndexQuantizer2, name) - __repr__ = _swig_repr - __swig_setmethods__["assign_indexes"] = _swigfaiss.MultiIndexQuantizer2_assign_indexes_set - __swig_getmethods__["assign_indexes"] = _swigfaiss.MultiIndexQuantizer2_assign_indexes_get - if _newclass: - assign_indexes = _swig_property(_swigfaiss.MultiIndexQuantizer2_assign_indexes_get, _swigfaiss.MultiIndexQuantizer2_assign_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss.MultiIndexQuantizer2_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.MultiIndexQuantizer2_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.MultiIndexQuantizer2_own_fields_get, _swigfaiss.MultiIndexQuantizer2_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss.new_MultiIndexQuantizer2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.MultiIndexQuantizer2_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.MultiIndexQuantizer2_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss.delete_MultiIndexQuantizer2 - __del__ = lambda self: None -MultiIndexQuantizer2_swigregister = _swigfaiss.MultiIndexQuantizer2_swigregister -MultiIndexQuantizer2_swigregister(MultiIndexQuantizer2) - -class InvertedLists(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InvertedLists, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InvertedLists, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["nlist"] = _swigfaiss.InvertedLists_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss.InvertedLists_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss.InvertedLists_nlist_get, _swigfaiss.InvertedLists_nlist_set) - __swig_setmethods__["code_size"] = _swigfaiss.InvertedLists_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.InvertedLists_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.InvertedLists_code_size_get, _swigfaiss.InvertedLists_code_size_set) - - def list_size(self, list_no): - return _swigfaiss.InvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss.InvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss.InvertedLists_get_ids(self, list_no) - - def release_codes(self, codes): - return _swigfaiss.InvertedLists_release_codes(self, codes) - - def release_ids(self, ids): - return _swigfaiss.InvertedLists_release_ids(self, ids) - - def get_single_id(self, list_no, offset): - return _swigfaiss.InvertedLists_get_single_id(self, list_no, offset) - - def get_single_code(self, list_no, offset): - return _swigfaiss.InvertedLists_get_single_code(self, list_no, offset) - - def prefetch_lists(self, list_nos, nlist): - return _swigfaiss.InvertedLists_prefetch_lists(self, list_nos, nlist) - - def add_entry(self, list_no, theid, code): - return _swigfaiss.InvertedLists_add_entry(self, list_no, theid, code) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss.InvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entry(self, list_no, offset, id, code): - return _swigfaiss.InvertedLists_update_entry(self, list_no, offset, id, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss.InvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss.InvertedLists_resize(self, list_no, new_size) - - def reset(self): - return _swigfaiss.InvertedLists_reset(self) - - def merge_from(self, oivf, add_id): - return _swigfaiss.InvertedLists_merge_from(self, oivf, add_id) - __swig_destroy__ = _swigfaiss.delete_InvertedLists - __del__ = lambda self: None - - def imbalance_factor(self): - return _swigfaiss.InvertedLists_imbalance_factor(self) - - def print_stats(self): - return _swigfaiss.InvertedLists_print_stats(self) -InvertedLists_swigregister = _swigfaiss.InvertedLists_swigregister -InvertedLists_swigregister(InvertedLists) - -class ArrayInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ArrayInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ArrayInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["codes"] = _swigfaiss.ArrayInvertedLists_codes_set - __swig_getmethods__["codes"] = _swigfaiss.ArrayInvertedLists_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.ArrayInvertedLists_codes_get, _swigfaiss.ArrayInvertedLists_codes_set) - __swig_setmethods__["ids"] = _swigfaiss.ArrayInvertedLists_ids_set - __swig_getmethods__["ids"] = _swigfaiss.ArrayInvertedLists_ids_get - if _newclass: - ids = _swig_property(_swigfaiss.ArrayInvertedLists_ids_get, _swigfaiss.ArrayInvertedLists_ids_set) - - def __init__(self, nlist, code_size): - this = _swigfaiss.new_ArrayInvertedLists(nlist, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def list_size(self, list_no): - return _swigfaiss.ArrayInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss.ArrayInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss.ArrayInvertedLists_get_ids(self, list_no) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss.ArrayInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss.ArrayInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss.ArrayInvertedLists_resize(self, list_no, new_size) - __swig_destroy__ = _swigfaiss.delete_ArrayInvertedLists - __del__ = lambda self: None -ArrayInvertedLists_swigregister = _swigfaiss.ArrayInvertedLists_swigregister -ArrayInvertedLists_swigregister(ArrayInvertedLists) - -class ConcatenatedInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ConcatenatedInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ConcatenatedInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["ils"] = _swigfaiss.ConcatenatedInvertedLists_ils_set - __swig_getmethods__["ils"] = _swigfaiss.ConcatenatedInvertedLists_ils_get - if _newclass: - ils = _swig_property(_swigfaiss.ConcatenatedInvertedLists_ils_get, _swigfaiss.ConcatenatedInvertedLists_ils_set) - - def __init__(self, nil, ils): - this = _swigfaiss.new_ConcatenatedInvertedLists(nil, ils) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def list_size(self, list_no): - return _swigfaiss.ConcatenatedInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss.ConcatenatedInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss.ConcatenatedInvertedLists_get_ids(self, list_no) - - def release_codes(self, codes): - return _swigfaiss.ConcatenatedInvertedLists_release_codes(self, codes) - - def release_ids(self, ids): - return _swigfaiss.ConcatenatedInvertedLists_release_ids(self, ids) - - def get_single_id(self, list_no, offset): - return _swigfaiss.ConcatenatedInvertedLists_get_single_id(self, list_no, offset) - - def get_single_code(self, list_no, offset): - return _swigfaiss.ConcatenatedInvertedLists_get_single_code(self, list_no, offset) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss.ConcatenatedInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss.ConcatenatedInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss.ConcatenatedInvertedLists_resize(self, list_no, new_size) - __swig_destroy__ = _swigfaiss.delete_ConcatenatedInvertedLists - __del__ = lambda self: None -ConcatenatedInvertedLists_swigregister = _swigfaiss.ConcatenatedInvertedLists_swigregister -ConcatenatedInvertedLists_swigregister(ConcatenatedInvertedLists) - -class Level1Quantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Level1Quantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Level1Quantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["quantizer"] = _swigfaiss.Level1Quantizer_quantizer_set - __swig_getmethods__["quantizer"] = _swigfaiss.Level1Quantizer_quantizer_get - if _newclass: - quantizer = _swig_property(_swigfaiss.Level1Quantizer_quantizer_get, _swigfaiss.Level1Quantizer_quantizer_set) - __swig_setmethods__["nlist"] = _swigfaiss.Level1Quantizer_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss.Level1Quantizer_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss.Level1Quantizer_nlist_get, _swigfaiss.Level1Quantizer_nlist_set) - __swig_setmethods__["quantizer_trains_alone"] = _swigfaiss.Level1Quantizer_quantizer_trains_alone_set - __swig_getmethods__["quantizer_trains_alone"] = _swigfaiss.Level1Quantizer_quantizer_trains_alone_get - if _newclass: - quantizer_trains_alone = _swig_property(_swigfaiss.Level1Quantizer_quantizer_trains_alone_get, _swigfaiss.Level1Quantizer_quantizer_trains_alone_set) - __swig_setmethods__["own_fields"] = _swigfaiss.Level1Quantizer_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.Level1Quantizer_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.Level1Quantizer_own_fields_get, _swigfaiss.Level1Quantizer_own_fields_set) - __swig_setmethods__["cp"] = _swigfaiss.Level1Quantizer_cp_set - __swig_getmethods__["cp"] = _swigfaiss.Level1Quantizer_cp_get - if _newclass: - cp = _swig_property(_swigfaiss.Level1Quantizer_cp_get, _swigfaiss.Level1Quantizer_cp_set) - __swig_setmethods__["clustering_index"] = _swigfaiss.Level1Quantizer_clustering_index_set - __swig_getmethods__["clustering_index"] = _swigfaiss.Level1Quantizer_clustering_index_get - if _newclass: - clustering_index = _swig_property(_swigfaiss.Level1Quantizer_clustering_index_get, _swigfaiss.Level1Quantizer_clustering_index_set) - - def train_q1(self, n, x, verbose, metric_type): - return _swigfaiss.Level1Quantizer_train_q1(self, n, x, verbose, metric_type) - - def __init__(self, *args): - this = _swigfaiss.new_Level1Quantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_Level1Quantizer - __del__ = lambda self: None -Level1Quantizer_swigregister = _swigfaiss.Level1Quantizer_swigregister -Level1Quantizer_swigregister(Level1Quantizer) - -class IVFSearchParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IVFSearchParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IVFSearchParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["nprobe"] = _swigfaiss.IVFSearchParameters_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss.IVFSearchParameters_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss.IVFSearchParameters_nprobe_get, _swigfaiss.IVFSearchParameters_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss.IVFSearchParameters_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss.IVFSearchParameters_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss.IVFSearchParameters_max_codes_get, _swigfaiss.IVFSearchParameters_max_codes_set) - __swig_destroy__ = _swigfaiss.delete_IVFSearchParameters - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss.new_IVFSearchParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IVFSearchParameters_swigregister = _swigfaiss.IVFSearchParameters_swigregister -IVFSearchParameters_swigregister(IVFSearchParameters) - -class IndexIVF(Index, Level1Quantizer): - __swig_setmethods__ = {} - for _s in [Index, Level1Quantizer]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVF, name, value) - __swig_getmethods__ = {} - for _s in [Index, Level1Quantizer]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVF, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["invlists"] = _swigfaiss.IndexIVF_invlists_set - __swig_getmethods__["invlists"] = _swigfaiss.IndexIVF_invlists_get - if _newclass: - invlists = _swig_property(_swigfaiss.IndexIVF_invlists_get, _swigfaiss.IndexIVF_invlists_set) - __swig_setmethods__["own_invlists"] = _swigfaiss.IndexIVF_own_invlists_set - __swig_getmethods__["own_invlists"] = _swigfaiss.IndexIVF_own_invlists_get - if _newclass: - own_invlists = _swig_property(_swigfaiss.IndexIVF_own_invlists_get, _swigfaiss.IndexIVF_own_invlists_set) - __swig_setmethods__["code_size"] = _swigfaiss.IndexIVF_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.IndexIVF_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.IndexIVF_code_size_get, _swigfaiss.IndexIVF_code_size_set) - __swig_setmethods__["nprobe"] = _swigfaiss.IndexIVF_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss.IndexIVF_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss.IndexIVF_nprobe_get, _swigfaiss.IndexIVF_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss.IndexIVF_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss.IndexIVF_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss.IndexIVF_max_codes_get, _swigfaiss.IndexIVF_max_codes_set) - __swig_setmethods__["maintain_direct_map"] = _swigfaiss.IndexIVF_maintain_direct_map_set - __swig_getmethods__["maintain_direct_map"] = _swigfaiss.IndexIVF_maintain_direct_map_get - if _newclass: - maintain_direct_map = _swig_property(_swigfaiss.IndexIVF_maintain_direct_map_get, _swigfaiss.IndexIVF_maintain_direct_map_set) - __swig_setmethods__["direct_map"] = _swigfaiss.IndexIVF_direct_map_set - __swig_getmethods__["direct_map"] = _swigfaiss.IndexIVF_direct_map_get - if _newclass: - direct_map = _swig_property(_swigfaiss.IndexIVF_direct_map_get, _swigfaiss.IndexIVF_direct_map_set) - - def reset(self): - return _swigfaiss.IndexIVF_reset(self) - - def train(self, n, x): - return _swigfaiss.IndexIVF_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexIVF_add(self, n, x) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss.IndexIVF_encode_vectors(self, n, x, list_nos, codes) - - def train_residual(self, n, x): - return _swigfaiss.IndexIVF_train_residual(self, n, x) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss.IndexIVF_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexIVF_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexIVF_range_search(self, n, x, radius, result) - - def get_InvertedListScanner(self, store_pairs=False): - return _swigfaiss.IndexIVF_get_InvertedListScanner(self, store_pairs) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexIVF_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexIVF_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss.IndexIVF_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVF_reconstruct_from_offset(self, list_no, offset, recons) - - def remove_ids(self, sel): - return _swigfaiss.IndexIVF_remove_ids(self, sel) - - def check_compatible_for_merge(self, other): - return _swigfaiss.IndexIVF_check_compatible_for_merge(self, other) - - def merge_from(self, other, add_id): - return _swigfaiss.IndexIVF_merge_from(self, other, add_id) - - def copy_subset_to(self, other, subset_type, a1, a2): - return _swigfaiss.IndexIVF_copy_subset_to(self, other, subset_type, a1, a2) - __swig_destroy__ = _swigfaiss.delete_IndexIVF - __del__ = lambda self: None - - def get_list_size(self, list_no): - return _swigfaiss.IndexIVF_get_list_size(self, list_no) - - def make_direct_map(self, new_maintain_direct_map=True): - return _swigfaiss.IndexIVF_make_direct_map(self, new_maintain_direct_map) - - def replace_invlists(self, il, own=False): - return _swigfaiss.IndexIVF_replace_invlists(self, il, own) -IndexIVF_swigregister = _swigfaiss.IndexIVF_swigregister -IndexIVF_swigregister(IndexIVF) - -class IndexIVFStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss.IndexIVFStats_nq_set - __swig_getmethods__["nq"] = _swigfaiss.IndexIVFStats_nq_get - if _newclass: - nq = _swig_property(_swigfaiss.IndexIVFStats_nq_get, _swigfaiss.IndexIVFStats_nq_set) - __swig_setmethods__["nlist"] = _swigfaiss.IndexIVFStats_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss.IndexIVFStats_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss.IndexIVFStats_nlist_get, _swigfaiss.IndexIVFStats_nlist_set) - __swig_setmethods__["ndis"] = _swigfaiss.IndexIVFStats_ndis_set - __swig_getmethods__["ndis"] = _swigfaiss.IndexIVFStats_ndis_get - if _newclass: - ndis = _swig_property(_swigfaiss.IndexIVFStats_ndis_get, _swigfaiss.IndexIVFStats_ndis_set) - __swig_setmethods__["nheap_updates"] = _swigfaiss.IndexIVFStats_nheap_updates_set - __swig_getmethods__["nheap_updates"] = _swigfaiss.IndexIVFStats_nheap_updates_get - if _newclass: - nheap_updates = _swig_property(_swigfaiss.IndexIVFStats_nheap_updates_get, _swigfaiss.IndexIVFStats_nheap_updates_set) - __swig_setmethods__["quantization_time"] = _swigfaiss.IndexIVFStats_quantization_time_set - __swig_getmethods__["quantization_time"] = _swigfaiss.IndexIVFStats_quantization_time_get - if _newclass: - quantization_time = _swig_property(_swigfaiss.IndexIVFStats_quantization_time_get, _swigfaiss.IndexIVFStats_quantization_time_set) - __swig_setmethods__["search_time"] = _swigfaiss.IndexIVFStats_search_time_set - __swig_getmethods__["search_time"] = _swigfaiss.IndexIVFStats_search_time_get - if _newclass: - search_time = _swig_property(_swigfaiss.IndexIVFStats_search_time_get, _swigfaiss.IndexIVFStats_search_time_set) - - def __init__(self): - this = _swigfaiss.new_IndexIVFStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss.IndexIVFStats_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexIVFStats - __del__ = lambda self: None -IndexIVFStats_swigregister = _swigfaiss.IndexIVFStats_swigregister -IndexIVFStats_swigregister(IndexIVFStats) - - -def check_compatible_for_merge(index1, index2): - return _swigfaiss.check_compatible_for_merge(index1, index2) -check_compatible_for_merge = _swigfaiss.check_compatible_for_merge - -def extract_index_ivf(*args): - return _swigfaiss.extract_index_ivf(*args) -extract_index_ivf = _swigfaiss.extract_index_ivf - -def merge_into(index0, index1, shift_ids): - return _swigfaiss.merge_into(index0, index1, shift_ids) -merge_into = _swigfaiss.merge_into - -def search_centroid(index, x, n, centroid_ids): - return _swigfaiss.search_centroid(index, x, n, centroid_ids) -search_centroid = _swigfaiss.search_centroid - -def search_and_return_centroids(index, n, xin, k, distances, labels, query_centroid_ids, result_centroid_ids): - return _swigfaiss.search_and_return_centroids(index, n, xin, k, distances, labels, query_centroid_ids, result_centroid_ids) -search_and_return_centroids = _swigfaiss.search_and_return_centroids -class SlidingIndexWindow(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, SlidingIndexWindow, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, SlidingIndexWindow, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss.SlidingIndexWindow_index_set - __swig_getmethods__["index"] = _swigfaiss.SlidingIndexWindow_index_get - if _newclass: - index = _swig_property(_swigfaiss.SlidingIndexWindow_index_get, _swigfaiss.SlidingIndexWindow_index_set) - __swig_setmethods__["ils"] = _swigfaiss.SlidingIndexWindow_ils_set - __swig_getmethods__["ils"] = _swigfaiss.SlidingIndexWindow_ils_get - if _newclass: - ils = _swig_property(_swigfaiss.SlidingIndexWindow_ils_get, _swigfaiss.SlidingIndexWindow_ils_set) - __swig_setmethods__["n_slice"] = _swigfaiss.SlidingIndexWindow_n_slice_set - __swig_getmethods__["n_slice"] = _swigfaiss.SlidingIndexWindow_n_slice_get - if _newclass: - n_slice = _swig_property(_swigfaiss.SlidingIndexWindow_n_slice_get, _swigfaiss.SlidingIndexWindow_n_slice_set) - __swig_setmethods__["nlist"] = _swigfaiss.SlidingIndexWindow_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss.SlidingIndexWindow_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss.SlidingIndexWindow_nlist_get, _swigfaiss.SlidingIndexWindow_nlist_set) - __swig_setmethods__["sizes"] = _swigfaiss.SlidingIndexWindow_sizes_set - __swig_getmethods__["sizes"] = _swigfaiss.SlidingIndexWindow_sizes_get - if _newclass: - sizes = _swig_property(_swigfaiss.SlidingIndexWindow_sizes_get, _swigfaiss.SlidingIndexWindow_sizes_set) - - def __init__(self, index): - this = _swigfaiss.new_SlidingIndexWindow(index) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def step(self, sub_index, remove_oldest): - return _swigfaiss.SlidingIndexWindow_step(self, sub_index, remove_oldest) - __swig_destroy__ = _swigfaiss.delete_SlidingIndexWindow - __del__ = lambda self: None -SlidingIndexWindow_swigregister = _swigfaiss.SlidingIndexWindow_swigregister -SlidingIndexWindow_swigregister(SlidingIndexWindow) - - -def get_invlist_range(index, i0, i1): - return _swigfaiss.get_invlist_range(index, i0, i1) -get_invlist_range = _swigfaiss.get_invlist_range - -def set_invlist_range(index, i0, i1, src): - return _swigfaiss.set_invlist_range(index, i0, i1, src) -set_invlist_range = _swigfaiss.set_invlist_range - -def search_with_parameters(index, n, x, k, distances, labels, params): - return _swigfaiss.search_with_parameters(index, n, x, k, distances, labels, params) -search_with_parameters = _swigfaiss.search_with_parameters -class ScalarQuantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ScalarQuantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ScalarQuantizer, name) - __repr__ = _swig_repr - QT_8bit = _swigfaiss.ScalarQuantizer_QT_8bit - QT_4bit = _swigfaiss.ScalarQuantizer_QT_4bit - QT_8bit_uniform = _swigfaiss.ScalarQuantizer_QT_8bit_uniform - QT_4bit_uniform = _swigfaiss.ScalarQuantizer_QT_4bit_uniform - QT_fp16 = _swigfaiss.ScalarQuantizer_QT_fp16 - QT_8bit_direct = _swigfaiss.ScalarQuantizer_QT_8bit_direct - __swig_setmethods__["qtype"] = _swigfaiss.ScalarQuantizer_qtype_set - __swig_getmethods__["qtype"] = _swigfaiss.ScalarQuantizer_qtype_get - if _newclass: - qtype = _swig_property(_swigfaiss.ScalarQuantizer_qtype_get, _swigfaiss.ScalarQuantizer_qtype_set) - RS_minmax = _swigfaiss.ScalarQuantizer_RS_minmax - RS_meanstd = _swigfaiss.ScalarQuantizer_RS_meanstd - RS_quantiles = _swigfaiss.ScalarQuantizer_RS_quantiles - RS_optim = _swigfaiss.ScalarQuantizer_RS_optim - __swig_setmethods__["rangestat"] = _swigfaiss.ScalarQuantizer_rangestat_set - __swig_getmethods__["rangestat"] = _swigfaiss.ScalarQuantizer_rangestat_get - if _newclass: - rangestat = _swig_property(_swigfaiss.ScalarQuantizer_rangestat_get, _swigfaiss.ScalarQuantizer_rangestat_set) - __swig_setmethods__["rangestat_arg"] = _swigfaiss.ScalarQuantizer_rangestat_arg_set - __swig_getmethods__["rangestat_arg"] = _swigfaiss.ScalarQuantizer_rangestat_arg_get - if _newclass: - rangestat_arg = _swig_property(_swigfaiss.ScalarQuantizer_rangestat_arg_get, _swigfaiss.ScalarQuantizer_rangestat_arg_set) - __swig_setmethods__["d"] = _swigfaiss.ScalarQuantizer_d_set - __swig_getmethods__["d"] = _swigfaiss.ScalarQuantizer_d_get - if _newclass: - d = _swig_property(_swigfaiss.ScalarQuantizer_d_get, _swigfaiss.ScalarQuantizer_d_set) - __swig_setmethods__["code_size"] = _swigfaiss.ScalarQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.ScalarQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.ScalarQuantizer_code_size_get, _swigfaiss.ScalarQuantizer_code_size_set) - __swig_setmethods__["trained"] = _swigfaiss.ScalarQuantizer_trained_set - __swig_getmethods__["trained"] = _swigfaiss.ScalarQuantizer_trained_get - if _newclass: - trained = _swig_property(_swigfaiss.ScalarQuantizer_trained_get, _swigfaiss.ScalarQuantizer_trained_set) - - def __init__(self, *args): - this = _swigfaiss.new_ScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.ScalarQuantizer_train(self, n, x) - - def compute_codes(self, x, codes, n): - return _swigfaiss.ScalarQuantizer_compute_codes(self, x, codes, n) - - def decode(self, code, x, n): - return _swigfaiss.ScalarQuantizer_decode(self, code, x, n) - - def get_distance_computer(self, *args): - return _swigfaiss.ScalarQuantizer_get_distance_computer(self, *args) - __swig_destroy__ = _swigfaiss.delete_ScalarQuantizer - __del__ = lambda self: None -ScalarQuantizer_swigregister = _swigfaiss.ScalarQuantizer_swigregister -ScalarQuantizer_swigregister(ScalarQuantizer) - -class IndexScalarQuantizer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexScalarQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexScalarQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["sq"] = _swigfaiss.IndexScalarQuantizer_sq_set - __swig_getmethods__["sq"] = _swigfaiss.IndexScalarQuantizer_sq_get - if _newclass: - sq = _swig_property(_swigfaiss.IndexScalarQuantizer_sq_get, _swigfaiss.IndexScalarQuantizer_sq_set) - __swig_setmethods__["codes"] = _swigfaiss.IndexScalarQuantizer_codes_set - __swig_getmethods__["codes"] = _swigfaiss.IndexScalarQuantizer_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.IndexScalarQuantizer_codes_get, _swigfaiss.IndexScalarQuantizer_codes_set) - __swig_setmethods__["code_size"] = _swigfaiss.IndexScalarQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.IndexScalarQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.IndexScalarQuantizer_code_size_get, _swigfaiss.IndexScalarQuantizer_code_size_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.IndexScalarQuantizer_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexScalarQuantizer_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexScalarQuantizer_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss.IndexScalarQuantizer_reset(self) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexScalarQuantizer_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexScalarQuantizer_reconstruct(self, key, recons) - - def get_distance_computer(self): - return _swigfaiss.IndexScalarQuantizer_get_distance_computer(self) - __swig_destroy__ = _swigfaiss.delete_IndexScalarQuantizer - __del__ = lambda self: None -IndexScalarQuantizer_swigregister = _swigfaiss.IndexScalarQuantizer_swigregister -IndexScalarQuantizer_swigregister(IndexScalarQuantizer) - -class IndexIVFScalarQuantizer(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFScalarQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFScalarQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["sq"] = _swigfaiss.IndexIVFScalarQuantizer_sq_set - __swig_getmethods__["sq"] = _swigfaiss.IndexIVFScalarQuantizer_sq_get - if _newclass: - sq = _swig_property(_swigfaiss.IndexIVFScalarQuantizer_sq_get, _swigfaiss.IndexIVFScalarQuantizer_sq_set) - __swig_setmethods__["by_residual"] = _swigfaiss.IndexIVFScalarQuantizer_by_residual_set - __swig_getmethods__["by_residual"] = _swigfaiss.IndexIVFScalarQuantizer_by_residual_get - if _newclass: - by_residual = _swig_property(_swigfaiss.IndexIVFScalarQuantizer_by_residual_get, _swigfaiss.IndexIVFScalarQuantizer_by_residual_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexIVFScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train_residual(self, n, x): - return _swigfaiss.IndexIVFScalarQuantizer_train_residual(self, n, x) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss.IndexIVFScalarQuantizer_encode_vectors(self, n, x, list_nos, codes) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIVFScalarQuantizer_add_with_ids(self, n, x, xids) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss.IndexIVFScalarQuantizer_get_InvertedListScanner(self, store_pairs) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVFScalarQuantizer_reconstruct_from_offset(self, list_no, offset, recons) - __swig_destroy__ = _swigfaiss.delete_IndexIVFScalarQuantizer - __del__ = lambda self: None -IndexIVFScalarQuantizer_swigregister = _swigfaiss.IndexIVFScalarQuantizer_swigregister -IndexIVFScalarQuantizer_swigregister(IndexIVFScalarQuantizer) - -class HNSW(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HNSW, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HNSW, name) - __repr__ = _swig_repr - __swig_setmethods__["assign_probas"] = _swigfaiss.HNSW_assign_probas_set - __swig_getmethods__["assign_probas"] = _swigfaiss.HNSW_assign_probas_get - if _newclass: - assign_probas = _swig_property(_swigfaiss.HNSW_assign_probas_get, _swigfaiss.HNSW_assign_probas_set) - __swig_setmethods__["cum_nneighbor_per_level"] = _swigfaiss.HNSW_cum_nneighbor_per_level_set - __swig_getmethods__["cum_nneighbor_per_level"] = _swigfaiss.HNSW_cum_nneighbor_per_level_get - if _newclass: - cum_nneighbor_per_level = _swig_property(_swigfaiss.HNSW_cum_nneighbor_per_level_get, _swigfaiss.HNSW_cum_nneighbor_per_level_set) - __swig_setmethods__["levels"] = _swigfaiss.HNSW_levels_set - __swig_getmethods__["levels"] = _swigfaiss.HNSW_levels_get - if _newclass: - levels = _swig_property(_swigfaiss.HNSW_levels_get, _swigfaiss.HNSW_levels_set) - __swig_setmethods__["offsets"] = _swigfaiss.HNSW_offsets_set - __swig_getmethods__["offsets"] = _swigfaiss.HNSW_offsets_get - if _newclass: - offsets = _swig_property(_swigfaiss.HNSW_offsets_get, _swigfaiss.HNSW_offsets_set) - __swig_setmethods__["neighbors"] = _swigfaiss.HNSW_neighbors_set - __swig_getmethods__["neighbors"] = _swigfaiss.HNSW_neighbors_get - if _newclass: - neighbors = _swig_property(_swigfaiss.HNSW_neighbors_get, _swigfaiss.HNSW_neighbors_set) - __swig_setmethods__["entry_point"] = _swigfaiss.HNSW_entry_point_set - __swig_getmethods__["entry_point"] = _swigfaiss.HNSW_entry_point_get - if _newclass: - entry_point = _swig_property(_swigfaiss.HNSW_entry_point_get, _swigfaiss.HNSW_entry_point_set) - __swig_setmethods__["rng"] = _swigfaiss.HNSW_rng_set - __swig_getmethods__["rng"] = _swigfaiss.HNSW_rng_get - if _newclass: - rng = _swig_property(_swigfaiss.HNSW_rng_get, _swigfaiss.HNSW_rng_set) - __swig_setmethods__["max_level"] = _swigfaiss.HNSW_max_level_set - __swig_getmethods__["max_level"] = _swigfaiss.HNSW_max_level_get - if _newclass: - max_level = _swig_property(_swigfaiss.HNSW_max_level_get, _swigfaiss.HNSW_max_level_set) - __swig_setmethods__["efConstruction"] = _swigfaiss.HNSW_efConstruction_set - __swig_getmethods__["efConstruction"] = _swigfaiss.HNSW_efConstruction_get - if _newclass: - efConstruction = _swig_property(_swigfaiss.HNSW_efConstruction_get, _swigfaiss.HNSW_efConstruction_set) - __swig_setmethods__["efSearch"] = _swigfaiss.HNSW_efSearch_set - __swig_getmethods__["efSearch"] = _swigfaiss.HNSW_efSearch_get - if _newclass: - efSearch = _swig_property(_swigfaiss.HNSW_efSearch_get, _swigfaiss.HNSW_efSearch_set) - __swig_setmethods__["check_relative_distance"] = _swigfaiss.HNSW_check_relative_distance_set - __swig_getmethods__["check_relative_distance"] = _swigfaiss.HNSW_check_relative_distance_get - if _newclass: - check_relative_distance = _swig_property(_swigfaiss.HNSW_check_relative_distance_get, _swigfaiss.HNSW_check_relative_distance_set) - __swig_setmethods__["upper_beam"] = _swigfaiss.HNSW_upper_beam_set - __swig_getmethods__["upper_beam"] = _swigfaiss.HNSW_upper_beam_get - if _newclass: - upper_beam = _swig_property(_swigfaiss.HNSW_upper_beam_get, _swigfaiss.HNSW_upper_beam_set) - __swig_setmethods__["search_bounded_queue"] = _swigfaiss.HNSW_search_bounded_queue_set - __swig_getmethods__["search_bounded_queue"] = _swigfaiss.HNSW_search_bounded_queue_get - if _newclass: - search_bounded_queue = _swig_property(_swigfaiss.HNSW_search_bounded_queue_get, _swigfaiss.HNSW_search_bounded_queue_set) - - def set_default_probas(self, M, levelMult): - return _swigfaiss.HNSW_set_default_probas(self, M, levelMult) - - def set_nb_neighbors(self, level_no, n): - return _swigfaiss.HNSW_set_nb_neighbors(self, level_no, n) - - def nb_neighbors(self, layer_no): - return _swigfaiss.HNSW_nb_neighbors(self, layer_no) - - def cum_nb_neighbors(self, layer_no): - return _swigfaiss.HNSW_cum_nb_neighbors(self, layer_no) - - def neighbor_range(self, no, layer_no, begin, end): - return _swigfaiss.HNSW_neighbor_range(self, no, layer_no, begin, end) - - def __init__(self, M=32): - this = _swigfaiss.new_HNSW(M) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def random_level(self): - return _swigfaiss.HNSW_random_level(self) - - def fill_with_random_links(self, n): - return _swigfaiss.HNSW_fill_with_random_links(self, n) - - def add_links_starting_from(self, ptdis, pt_id, nearest, d_nearest, level, locks, vt): - return _swigfaiss.HNSW_add_links_starting_from(self, ptdis, pt_id, nearest, d_nearest, level, locks, vt) - - def add_with_locks(self, ptdis, pt_level, pt_id, locks, vt): - return _swigfaiss.HNSW_add_with_locks(self, ptdis, pt_level, pt_id, locks, vt) - - def search_from_candidates(self, qdis, k, I, D, candidates, vt, level, nres_in=0): - return _swigfaiss.HNSW_search_from_candidates(self, qdis, k, I, D, candidates, vt, level, nres_in) - - def search_from_candidate_unbounded(self, node, qdis, ef, vt): - return _swigfaiss.HNSW_search_from_candidate_unbounded(self, node, qdis, ef, vt) - - def search(self, qdis, k, I, D, vt): - return _swigfaiss.HNSW_search(self, qdis, k, I, D, vt) - - def reset(self): - return _swigfaiss.HNSW_reset(self) - - def clear_neighbor_tables(self, level): - return _swigfaiss.HNSW_clear_neighbor_tables(self, level) - - def print_neighbor_stats(self, level): - return _swigfaiss.HNSW_print_neighbor_stats(self, level) - - def prepare_level_tab(self, n, preset_levels=False): - return _swigfaiss.HNSW_prepare_level_tab(self, n, preset_levels) - if _newclass: - shrink_neighbor_list = staticmethod(_swigfaiss.HNSW_shrink_neighbor_list) - else: - shrink_neighbor_list = _swigfaiss.HNSW_shrink_neighbor_list - __swig_destroy__ = _swigfaiss.delete_HNSW - __del__ = lambda self: None -HNSW_swigregister = _swigfaiss.HNSW_swigregister -HNSW_swigregister(HNSW) - -def HNSW_shrink_neighbor_list(qdis, input, output, max_size): - return _swigfaiss.HNSW_shrink_neighbor_list(qdis, input, output, max_size) -HNSW_shrink_neighbor_list = _swigfaiss.HNSW_shrink_neighbor_list - -class VisitedTable(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VisitedTable, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VisitedTable, name) - __repr__ = _swig_repr - __swig_setmethods__["visited"] = _swigfaiss.VisitedTable_visited_set - __swig_getmethods__["visited"] = _swigfaiss.VisitedTable_visited_get - if _newclass: - visited = _swig_property(_swigfaiss.VisitedTable_visited_get, _swigfaiss.VisitedTable_visited_set) - __swig_setmethods__["visno"] = _swigfaiss.VisitedTable_visno_set - __swig_getmethods__["visno"] = _swigfaiss.VisitedTable_visno_get - if _newclass: - visno = _swig_property(_swigfaiss.VisitedTable_visno_get, _swigfaiss.VisitedTable_visno_set) - - def __init__(self, size): - this = _swigfaiss.new_VisitedTable(size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, no): - return _swigfaiss.VisitedTable_set(self, no) - - def get(self, no): - return _swigfaiss.VisitedTable_get(self, no) - - def advance(self): - return _swigfaiss.VisitedTable_advance(self) - __swig_destroy__ = _swigfaiss.delete_VisitedTable - __del__ = lambda self: None -VisitedTable_swigregister = _swigfaiss.VisitedTable_swigregister -VisitedTable_swigregister(VisitedTable) - -class HNSWStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HNSWStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HNSWStats, name) - __repr__ = _swig_repr - __swig_setmethods__["n1"] = _swigfaiss.HNSWStats_n1_set - __swig_getmethods__["n1"] = _swigfaiss.HNSWStats_n1_get - if _newclass: - n1 = _swig_property(_swigfaiss.HNSWStats_n1_get, _swigfaiss.HNSWStats_n1_set) - __swig_setmethods__["n2"] = _swigfaiss.HNSWStats_n2_set - __swig_getmethods__["n2"] = _swigfaiss.HNSWStats_n2_get - if _newclass: - n2 = _swig_property(_swigfaiss.HNSWStats_n2_get, _swigfaiss.HNSWStats_n2_set) - __swig_setmethods__["n3"] = _swigfaiss.HNSWStats_n3_set - __swig_getmethods__["n3"] = _swigfaiss.HNSWStats_n3_get - if _newclass: - n3 = _swig_property(_swigfaiss.HNSWStats_n3_get, _swigfaiss.HNSWStats_n3_set) - __swig_setmethods__["ndis"] = _swigfaiss.HNSWStats_ndis_set - __swig_getmethods__["ndis"] = _swigfaiss.HNSWStats_ndis_get - if _newclass: - ndis = _swig_property(_swigfaiss.HNSWStats_ndis_get, _swigfaiss.HNSWStats_ndis_set) - __swig_setmethods__["nreorder"] = _swigfaiss.HNSWStats_nreorder_set - __swig_getmethods__["nreorder"] = _swigfaiss.HNSWStats_nreorder_get - if _newclass: - nreorder = _swig_property(_swigfaiss.HNSWStats_nreorder_get, _swigfaiss.HNSWStats_nreorder_set) - __swig_setmethods__["view"] = _swigfaiss.HNSWStats_view_set - __swig_getmethods__["view"] = _swigfaiss.HNSWStats_view_get - if _newclass: - view = _swig_property(_swigfaiss.HNSWStats_view_get, _swigfaiss.HNSWStats_view_set) - - def __init__(self): - this = _swigfaiss.new_HNSWStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss.HNSWStats_reset(self) - __swig_destroy__ = _swigfaiss.delete_HNSWStats - __del__ = lambda self: None -HNSWStats_swigregister = _swigfaiss.HNSWStats_swigregister -HNSWStats_swigregister(HNSWStats) - -class ReconstructFromNeighbors(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ReconstructFromNeighbors, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ReconstructFromNeighbors, name) - __repr__ = _swig_repr - __swig_getmethods__["index"] = _swigfaiss.ReconstructFromNeighbors_index_get - if _newclass: - index = _swig_property(_swigfaiss.ReconstructFromNeighbors_index_get) - __swig_setmethods__["M"] = _swigfaiss.ReconstructFromNeighbors_M_set - __swig_getmethods__["M"] = _swigfaiss.ReconstructFromNeighbors_M_get - if _newclass: - M = _swig_property(_swigfaiss.ReconstructFromNeighbors_M_get, _swigfaiss.ReconstructFromNeighbors_M_set) - __swig_setmethods__["k"] = _swigfaiss.ReconstructFromNeighbors_k_set - __swig_getmethods__["k"] = _swigfaiss.ReconstructFromNeighbors_k_get - if _newclass: - k = _swig_property(_swigfaiss.ReconstructFromNeighbors_k_get, _swigfaiss.ReconstructFromNeighbors_k_set) - __swig_setmethods__["nsq"] = _swigfaiss.ReconstructFromNeighbors_nsq_set - __swig_getmethods__["nsq"] = _swigfaiss.ReconstructFromNeighbors_nsq_get - if _newclass: - nsq = _swig_property(_swigfaiss.ReconstructFromNeighbors_nsq_get, _swigfaiss.ReconstructFromNeighbors_nsq_set) - __swig_setmethods__["code_size"] = _swigfaiss.ReconstructFromNeighbors_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.ReconstructFromNeighbors_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.ReconstructFromNeighbors_code_size_get, _swigfaiss.ReconstructFromNeighbors_code_size_set) - __swig_setmethods__["k_reorder"] = _swigfaiss.ReconstructFromNeighbors_k_reorder_set - __swig_getmethods__["k_reorder"] = _swigfaiss.ReconstructFromNeighbors_k_reorder_get - if _newclass: - k_reorder = _swig_property(_swigfaiss.ReconstructFromNeighbors_k_reorder_get, _swigfaiss.ReconstructFromNeighbors_k_reorder_set) - __swig_setmethods__["codebook"] = _swigfaiss.ReconstructFromNeighbors_codebook_set - __swig_getmethods__["codebook"] = _swigfaiss.ReconstructFromNeighbors_codebook_get - if _newclass: - codebook = _swig_property(_swigfaiss.ReconstructFromNeighbors_codebook_get, _swigfaiss.ReconstructFromNeighbors_codebook_set) - __swig_setmethods__["codes"] = _swigfaiss.ReconstructFromNeighbors_codes_set - __swig_getmethods__["codes"] = _swigfaiss.ReconstructFromNeighbors_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.ReconstructFromNeighbors_codes_get, _swigfaiss.ReconstructFromNeighbors_codes_set) - __swig_setmethods__["ntotal"] = _swigfaiss.ReconstructFromNeighbors_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss.ReconstructFromNeighbors_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss.ReconstructFromNeighbors_ntotal_get, _swigfaiss.ReconstructFromNeighbors_ntotal_set) - __swig_setmethods__["d"] = _swigfaiss.ReconstructFromNeighbors_d_set - __swig_getmethods__["d"] = _swigfaiss.ReconstructFromNeighbors_d_get - if _newclass: - d = _swig_property(_swigfaiss.ReconstructFromNeighbors_d_get, _swigfaiss.ReconstructFromNeighbors_d_set) - __swig_setmethods__["dsub"] = _swigfaiss.ReconstructFromNeighbors_dsub_set - __swig_getmethods__["dsub"] = _swigfaiss.ReconstructFromNeighbors_dsub_get - if _newclass: - dsub = _swig_property(_swigfaiss.ReconstructFromNeighbors_dsub_get, _swigfaiss.ReconstructFromNeighbors_dsub_set) - - def __init__(self, index, k=256, nsq=1): - this = _swigfaiss.new_ReconstructFromNeighbors(index, k, nsq) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_codes(self, n, x): - return _swigfaiss.ReconstructFromNeighbors_add_codes(self, n, x) - - def compute_distances(self, n, shortlist, query, distances): - return _swigfaiss.ReconstructFromNeighbors_compute_distances(self, n, shortlist, query, distances) - - def estimate_code(self, x, i, code): - return _swigfaiss.ReconstructFromNeighbors_estimate_code(self, x, i, code) - - def reconstruct(self, i, x, tmp): - return _swigfaiss.ReconstructFromNeighbors_reconstruct(self, i, x, tmp) - - def reconstruct_n(self, n0, ni, x): - return _swigfaiss.ReconstructFromNeighbors_reconstruct_n(self, n0, ni, x) - - def get_neighbor_table(self, i, out): - return _swigfaiss.ReconstructFromNeighbors_get_neighbor_table(self, i, out) - __swig_destroy__ = _swigfaiss.delete_ReconstructFromNeighbors - __del__ = lambda self: None -ReconstructFromNeighbors_swigregister = _swigfaiss.ReconstructFromNeighbors_swigregister -ReconstructFromNeighbors_swigregister(ReconstructFromNeighbors) - -class IndexHNSW(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSW, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSW, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["hnsw"] = _swigfaiss.IndexHNSW_hnsw_set - __swig_getmethods__["hnsw"] = _swigfaiss.IndexHNSW_hnsw_get - if _newclass: - hnsw = _swig_property(_swigfaiss.IndexHNSW_hnsw_get, _swigfaiss.IndexHNSW_hnsw_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexHNSW_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexHNSW_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexHNSW_own_fields_get, _swigfaiss.IndexHNSW_own_fields_set) - __swig_setmethods__["storage"] = _swigfaiss.IndexHNSW_storage_set - __swig_getmethods__["storage"] = _swigfaiss.IndexHNSW_storage_get - if _newclass: - storage = _swig_property(_swigfaiss.IndexHNSW_storage_get, _swigfaiss.IndexHNSW_storage_set) - __swig_setmethods__["reconstruct_from_neighbors"] = _swigfaiss.IndexHNSW_reconstruct_from_neighbors_set - __swig_getmethods__["reconstruct_from_neighbors"] = _swigfaiss.IndexHNSW_reconstruct_from_neighbors_get - if _newclass: - reconstruct_from_neighbors = _swig_property(_swigfaiss.IndexHNSW_reconstruct_from_neighbors_get, _swigfaiss.IndexHNSW_reconstruct_from_neighbors_set) - __swig_destroy__ = _swigfaiss.delete_IndexHNSW - __del__ = lambda self: None - - def get_distance_computer(self): - return _swigfaiss.IndexHNSW_get_distance_computer(self) - - def add(self, n, x): - return _swigfaiss.IndexHNSW_add(self, n, x) - - def train(self, n, x): - return _swigfaiss.IndexHNSW_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexHNSW_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexHNSW_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss.IndexHNSW_reset(self) - - def shrink_level_0_neighbors(self, size): - return _swigfaiss.IndexHNSW_shrink_level_0_neighbors(self, size) - - def search_level_0(self, n, x, k, nearest, nearest_d, distances, labels, nprobe=1, search_type=1): - return _swigfaiss.IndexHNSW_search_level_0(self, n, x, k, nearest, nearest_d, distances, labels, nprobe, search_type) - - def init_level_0_from_knngraph(self, k, D, I): - return _swigfaiss.IndexHNSW_init_level_0_from_knngraph(self, k, D, I) - - def init_level_0_from_entry_points(self, npt, points, nearests): - return _swigfaiss.IndexHNSW_init_level_0_from_entry_points(self, npt, points, nearests) - - def reorder_links(self): - return _swigfaiss.IndexHNSW_reorder_links(self) - - def link_singletons(self): - return _swigfaiss.IndexHNSW_link_singletons(self) -IndexHNSW_swigregister = _swigfaiss.IndexHNSW_swigregister -IndexHNSW_swigregister(IndexHNSW) - -class IndexHNSWFlat(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWFlat, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexHNSWFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss.IndexHNSWFlat_get_distance_computer(self) - __swig_destroy__ = _swigfaiss.delete_IndexHNSWFlat - __del__ = lambda self: None -IndexHNSWFlat_swigregister = _swigfaiss.IndexHNSWFlat_swigregister -IndexHNSWFlat_swigregister(IndexHNSWFlat) - -class IndexHNSWPQ(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWPQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWPQ, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexHNSWPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss.IndexHNSWPQ_train(self, n, x) - - def get_distance_computer(self): - return _swigfaiss.IndexHNSWPQ_get_distance_computer(self) - __swig_destroy__ = _swigfaiss.delete_IndexHNSWPQ - __del__ = lambda self: None -IndexHNSWPQ_swigregister = _swigfaiss.IndexHNSWPQ_swigregister -IndexHNSWPQ_swigregister(IndexHNSWPQ) - -class IndexHNSWSQ(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWSQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWSQ, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexHNSWSQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss.IndexHNSWSQ_get_distance_computer(self) - __swig_destroy__ = _swigfaiss.delete_IndexHNSWSQ - __del__ = lambda self: None -IndexHNSWSQ_swigregister = _swigfaiss.IndexHNSWSQ_swigregister -IndexHNSWSQ_swigregister(IndexHNSWSQ) - -class IndexHNSW2Level(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSW2Level, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSW2Level, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss.new_IndexHNSW2Level(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss.IndexHNSW2Level_get_distance_computer(self) - - def flip_to_ivf(self): - return _swigfaiss.IndexHNSW2Level_flip_to_ivf(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexHNSW2Level_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss.delete_IndexHNSW2Level - __del__ = lambda self: None -IndexHNSW2Level_swigregister = _swigfaiss.IndexHNSW2Level_swigregister -IndexHNSW2Level_swigregister(IndexHNSW2Level) - -class IndexIVFFlat(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFFlat, name) - __repr__ = _swig_repr - - def add_core(self, n, x, xids, precomputed_idx): - return _swigfaiss.IndexIVFFlat_add_core(self, n, x, xids, precomputed_idx) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIVFFlat_add_with_ids(self, n, x, xids) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss.IndexIVFFlat_encode_vectors(self, n, x, list_nos, codes) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss.IndexIVFFlat_get_InvertedListScanner(self, store_pairs) - - def update_vectors(self, nv, idx, v): - return _swigfaiss.IndexIVFFlat_update_vectors(self, nv, idx, v) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVFFlat_reconstruct_from_offset(self, list_no, offset, recons) - - def __init__(self, *args): - this = _swigfaiss.new_IndexIVFFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexIVFFlat - __del__ = lambda self: None -IndexIVFFlat_swigregister = _swigfaiss.IndexIVFFlat_swigregister -IndexIVFFlat_swigregister(IndexIVFFlat) - -class IndexIVFFlatDedup(IndexIVFFlat): - __swig_setmethods__ = {} - for _s in [IndexIVFFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFFlatDedup, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVFFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFFlatDedup, name) - __repr__ = _swig_repr - __swig_setmethods__["instances"] = _swigfaiss.IndexIVFFlatDedup_instances_set - __swig_getmethods__["instances"] = _swigfaiss.IndexIVFFlatDedup_instances_get - if _newclass: - instances = _swig_property(_swigfaiss.IndexIVFFlatDedup_instances_get, _swigfaiss.IndexIVFFlatDedup_instances_set) - - def train(self, n, x): - return _swigfaiss.IndexIVFFlatDedup_train(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIVFFlatDedup_add_with_ids(self, n, x, xids) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss.IndexIVFFlatDedup_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def remove_ids(self, sel): - return _swigfaiss.IndexIVFFlatDedup_remove_ids(self, sel) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexIVFFlatDedup_range_search(self, n, x, radius, result) - - def update_vectors(self, nv, idx, v): - return _swigfaiss.IndexIVFFlatDedup_update_vectors(self, nv, idx, v) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVFFlatDedup_reconstruct_from_offset(self, list_no, offset, recons) - - def __init__(self, *args): - this = _swigfaiss.new_IndexIVFFlatDedup(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexIVFFlatDedup - __del__ = lambda self: None -IndexIVFFlatDedup_swigregister = _swigfaiss.IndexIVFFlatDedup_swigregister -IndexIVFFlatDedup_swigregister(IndexIVFFlatDedup) - -class OnDiskInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OnDiskInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OnDiskInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["lists"] = _swigfaiss.OnDiskInvertedLists_lists_set - __swig_getmethods__["lists"] = _swigfaiss.OnDiskInvertedLists_lists_get - if _newclass: - lists = _swig_property(_swigfaiss.OnDiskInvertedLists_lists_get, _swigfaiss.OnDiskInvertedLists_lists_set) - __swig_setmethods__["slots"] = _swigfaiss.OnDiskInvertedLists_slots_set - __swig_getmethods__["slots"] = _swigfaiss.OnDiskInvertedLists_slots_get - if _newclass: - slots = _swig_property(_swigfaiss.OnDiskInvertedLists_slots_get, _swigfaiss.OnDiskInvertedLists_slots_set) - __swig_setmethods__["filename"] = _swigfaiss.OnDiskInvertedLists_filename_set - __swig_getmethods__["filename"] = _swigfaiss.OnDiskInvertedLists_filename_get - if _newclass: - filename = _swig_property(_swigfaiss.OnDiskInvertedLists_filename_get, _swigfaiss.OnDiskInvertedLists_filename_set) - __swig_setmethods__["totsize"] = _swigfaiss.OnDiskInvertedLists_totsize_set - __swig_getmethods__["totsize"] = _swigfaiss.OnDiskInvertedLists_totsize_get - if _newclass: - totsize = _swig_property(_swigfaiss.OnDiskInvertedLists_totsize_get, _swigfaiss.OnDiskInvertedLists_totsize_set) - __swig_setmethods__["ptr"] = _swigfaiss.OnDiskInvertedLists_ptr_set - __swig_getmethods__["ptr"] = _swigfaiss.OnDiskInvertedLists_ptr_get - if _newclass: - ptr = _swig_property(_swigfaiss.OnDiskInvertedLists_ptr_get, _swigfaiss.OnDiskInvertedLists_ptr_set) - __swig_setmethods__["read_only"] = _swigfaiss.OnDiskInvertedLists_read_only_set - __swig_getmethods__["read_only"] = _swigfaiss.OnDiskInvertedLists_read_only_get - if _newclass: - read_only = _swig_property(_swigfaiss.OnDiskInvertedLists_read_only_get, _swigfaiss.OnDiskInvertedLists_read_only_set) - - def list_size(self, list_no): - return _swigfaiss.OnDiskInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss.OnDiskInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss.OnDiskInvertedLists_get_ids(self, list_no) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss.OnDiskInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss.OnDiskInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss.OnDiskInvertedLists_resize(self, list_no, new_size) - - def merge_from(self, ils, n_il): - return _swigfaiss.OnDiskInvertedLists_merge_from(self, ils, n_il) - - def prefetch_lists(self, list_nos, nlist): - return _swigfaiss.OnDiskInvertedLists_prefetch_lists(self, list_nos, nlist) - __swig_destroy__ = _swigfaiss.delete_OnDiskInvertedLists - __del__ = lambda self: None - __swig_setmethods__["locks"] = _swigfaiss.OnDiskInvertedLists_locks_set - __swig_getmethods__["locks"] = _swigfaiss.OnDiskInvertedLists_locks_get - if _newclass: - locks = _swig_property(_swigfaiss.OnDiskInvertedLists_locks_get, _swigfaiss.OnDiskInvertedLists_locks_set) - __swig_setmethods__["pf"] = _swigfaiss.OnDiskInvertedLists_pf_set - __swig_getmethods__["pf"] = _swigfaiss.OnDiskInvertedLists_pf_get - if _newclass: - pf = _swig_property(_swigfaiss.OnDiskInvertedLists_pf_get, _swigfaiss.OnDiskInvertedLists_pf_set) - - def do_mmap(self): - return _swigfaiss.OnDiskInvertedLists_do_mmap(self) - - def update_totsize(self, new_totsize): - return _swigfaiss.OnDiskInvertedLists_update_totsize(self, new_totsize) - - def resize_locked(self, list_no, new_size): - return _swigfaiss.OnDiskInvertedLists_resize_locked(self, list_no, new_size) - - def allocate_slot(self, capacity): - return _swigfaiss.OnDiskInvertedLists_allocate_slot(self, capacity) - - def free_slot(self, offset, capacity): - return _swigfaiss.OnDiskInvertedLists_free_slot(self, offset, capacity) - - def __init__(self, *args): - this = _swigfaiss.new_OnDiskInvertedLists(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -OnDiskInvertedLists_swigregister = _swigfaiss.OnDiskInvertedLists_swigregister -OnDiskInvertedLists_swigregister(OnDiskInvertedLists) - -class IVFPQSearchParameters(IVFSearchParameters): - __swig_setmethods__ = {} - for _s in [IVFSearchParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IVFPQSearchParameters, name, value) - __swig_getmethods__ = {} - for _s in [IVFSearchParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IVFPQSearchParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["scan_table_threshold"] = _swigfaiss.IVFPQSearchParameters_scan_table_threshold_set - __swig_getmethods__["scan_table_threshold"] = _swigfaiss.IVFPQSearchParameters_scan_table_threshold_get - if _newclass: - scan_table_threshold = _swig_property(_swigfaiss.IVFPQSearchParameters_scan_table_threshold_get, _swigfaiss.IVFPQSearchParameters_scan_table_threshold_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss.IVFPQSearchParameters_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss.IVFPQSearchParameters_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss.IVFPQSearchParameters_polysemous_ht_get, _swigfaiss.IVFPQSearchParameters_polysemous_ht_set) - __swig_destroy__ = _swigfaiss.delete_IVFPQSearchParameters - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss.new_IVFPQSearchParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IVFPQSearchParameters_swigregister = _swigfaiss.IVFPQSearchParameters_swigregister -IVFPQSearchParameters_swigregister(IVFPQSearchParameters) - -class IndexIVFPQ(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQ, name) - __repr__ = _swig_repr - __swig_setmethods__["by_residual"] = _swigfaiss.IndexIVFPQ_by_residual_set - __swig_getmethods__["by_residual"] = _swigfaiss.IndexIVFPQ_by_residual_get - if _newclass: - by_residual = _swig_property(_swigfaiss.IndexIVFPQ_by_residual_get, _swigfaiss.IndexIVFPQ_by_residual_set) - __swig_setmethods__["pq"] = _swigfaiss.IndexIVFPQ_pq_set - __swig_getmethods__["pq"] = _swigfaiss.IndexIVFPQ_pq_get - if _newclass: - pq = _swig_property(_swigfaiss.IndexIVFPQ_pq_get, _swigfaiss.IndexIVFPQ_pq_set) - __swig_setmethods__["do_polysemous_training"] = _swigfaiss.IndexIVFPQ_do_polysemous_training_set - __swig_getmethods__["do_polysemous_training"] = _swigfaiss.IndexIVFPQ_do_polysemous_training_get - if _newclass: - do_polysemous_training = _swig_property(_swigfaiss.IndexIVFPQ_do_polysemous_training_get, _swigfaiss.IndexIVFPQ_do_polysemous_training_set) - __swig_setmethods__["polysemous_training"] = _swigfaiss.IndexIVFPQ_polysemous_training_set - __swig_getmethods__["polysemous_training"] = _swigfaiss.IndexIVFPQ_polysemous_training_get - if _newclass: - polysemous_training = _swig_property(_swigfaiss.IndexIVFPQ_polysemous_training_get, _swigfaiss.IndexIVFPQ_polysemous_training_set) - __swig_setmethods__["scan_table_threshold"] = _swigfaiss.IndexIVFPQ_scan_table_threshold_set - __swig_getmethods__["scan_table_threshold"] = _swigfaiss.IndexIVFPQ_scan_table_threshold_get - if _newclass: - scan_table_threshold = _swig_property(_swigfaiss.IndexIVFPQ_scan_table_threshold_get, _swigfaiss.IndexIVFPQ_scan_table_threshold_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss.IndexIVFPQ_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss.IndexIVFPQ_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss.IndexIVFPQ_polysemous_ht_get, _swigfaiss.IndexIVFPQ_polysemous_ht_set) - __swig_setmethods__["use_precomputed_table"] = _swigfaiss.IndexIVFPQ_use_precomputed_table_set - __swig_getmethods__["use_precomputed_table"] = _swigfaiss.IndexIVFPQ_use_precomputed_table_get - if _newclass: - use_precomputed_table = _swig_property(_swigfaiss.IndexIVFPQ_use_precomputed_table_get, _swigfaiss.IndexIVFPQ_use_precomputed_table_set) - __swig_setmethods__["precomputed_table_max_bytes"] = _swigfaiss.IndexIVFPQ_precomputed_table_max_bytes_set - __swig_getmethods__["precomputed_table_max_bytes"] = _swigfaiss.IndexIVFPQ_precomputed_table_max_bytes_get - if _newclass: - precomputed_table_max_bytes = _swig_property(_swigfaiss.IndexIVFPQ_precomputed_table_max_bytes_get, _swigfaiss.IndexIVFPQ_precomputed_table_max_bytes_set) - __swig_setmethods__["precomputed_table"] = _swigfaiss.IndexIVFPQ_precomputed_table_set - __swig_getmethods__["precomputed_table"] = _swigfaiss.IndexIVFPQ_precomputed_table_get - if _newclass: - precomputed_table = _swig_property(_swigfaiss.IndexIVFPQ_precomputed_table_get, _swigfaiss.IndexIVFPQ_precomputed_table_set) - - def add_with_ids(self, n, x, xids=None): - return _swigfaiss.IndexIVFPQ_add_with_ids(self, n, x, xids) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss.IndexIVFPQ_encode_vectors(self, n, x, list_nos, codes) - - def add_core_o(self, n, x, xids, residuals_2, precomputed_idx=None): - return _swigfaiss.IndexIVFPQ_add_core_o(self, n, x, xids, residuals_2, precomputed_idx) - - def train_residual(self, n, x): - return _swigfaiss.IndexIVFPQ_train_residual(self, n, x) - - def train_residual_o(self, n, x, residuals_2): - return _swigfaiss.IndexIVFPQ_train_residual_o(self, n, x, residuals_2) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVFPQ_reconstruct_from_offset(self, list_no, offset, recons) - - def find_duplicates(self, ids, lims): - return _swigfaiss.IndexIVFPQ_find_duplicates(self, ids, lims) - - def encode(self, key, x, code): - return _swigfaiss.IndexIVFPQ_encode(self, key, x, code) - - def encode_multiple(self, n, keys, x, codes, compute_keys=False): - return _swigfaiss.IndexIVFPQ_encode_multiple(self, n, keys, x, codes, compute_keys) - - def decode_multiple(self, n, keys, xcodes, x): - return _swigfaiss.IndexIVFPQ_decode_multiple(self, n, keys, xcodes, x) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss.IndexIVFPQ_get_InvertedListScanner(self, store_pairs) - - def precompute_table(self): - return _swigfaiss.IndexIVFPQ_precompute_table(self) - - def __init__(self, *args): - this = _swigfaiss.new_IndexIVFPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexIVFPQ - __del__ = lambda self: None -IndexIVFPQ_swigregister = _swigfaiss.IndexIVFPQ_swigregister -IndexIVFPQ_swigregister(IndexIVFPQ) - -class IndexIVFPQStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nrefine"] = _swigfaiss.IndexIVFPQStats_nrefine_set - __swig_getmethods__["nrefine"] = _swigfaiss.IndexIVFPQStats_nrefine_get - if _newclass: - nrefine = _swig_property(_swigfaiss.IndexIVFPQStats_nrefine_get, _swigfaiss.IndexIVFPQStats_nrefine_set) - __swig_setmethods__["n_hamming_pass"] = _swigfaiss.IndexIVFPQStats_n_hamming_pass_set - __swig_getmethods__["n_hamming_pass"] = _swigfaiss.IndexIVFPQStats_n_hamming_pass_get - if _newclass: - n_hamming_pass = _swig_property(_swigfaiss.IndexIVFPQStats_n_hamming_pass_get, _swigfaiss.IndexIVFPQStats_n_hamming_pass_set) - __swig_setmethods__["search_cycles"] = _swigfaiss.IndexIVFPQStats_search_cycles_set - __swig_getmethods__["search_cycles"] = _swigfaiss.IndexIVFPQStats_search_cycles_get - if _newclass: - search_cycles = _swig_property(_swigfaiss.IndexIVFPQStats_search_cycles_get, _swigfaiss.IndexIVFPQStats_search_cycles_set) - __swig_setmethods__["refine_cycles"] = _swigfaiss.IndexIVFPQStats_refine_cycles_set - __swig_getmethods__["refine_cycles"] = _swigfaiss.IndexIVFPQStats_refine_cycles_get - if _newclass: - refine_cycles = _swig_property(_swigfaiss.IndexIVFPQStats_refine_cycles_get, _swigfaiss.IndexIVFPQStats_refine_cycles_set) - - def __init__(self): - this = _swigfaiss.new_IndexIVFPQStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss.IndexIVFPQStats_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexIVFPQStats - __del__ = lambda self: None -IndexIVFPQStats_swigregister = _swigfaiss.IndexIVFPQStats_swigregister -IndexIVFPQStats_swigregister(IndexIVFPQStats) - -class IndexIVFPQR(IndexIVFPQ): - __swig_setmethods__ = {} - for _s in [IndexIVFPQ]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQR, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVFPQ]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQR, name) - __repr__ = _swig_repr - __swig_setmethods__["refine_pq"] = _swigfaiss.IndexIVFPQR_refine_pq_set - __swig_getmethods__["refine_pq"] = _swigfaiss.IndexIVFPQR_refine_pq_get - if _newclass: - refine_pq = _swig_property(_swigfaiss.IndexIVFPQR_refine_pq_get, _swigfaiss.IndexIVFPQR_refine_pq_set) - __swig_setmethods__["refine_codes"] = _swigfaiss.IndexIVFPQR_refine_codes_set - __swig_getmethods__["refine_codes"] = _swigfaiss.IndexIVFPQR_refine_codes_get - if _newclass: - refine_codes = _swig_property(_swigfaiss.IndexIVFPQR_refine_codes_get, _swigfaiss.IndexIVFPQR_refine_codes_set) - __swig_setmethods__["k_factor"] = _swigfaiss.IndexIVFPQR_k_factor_set - __swig_getmethods__["k_factor"] = _swigfaiss.IndexIVFPQR_k_factor_get - if _newclass: - k_factor = _swig_property(_swigfaiss.IndexIVFPQR_k_factor_get, _swigfaiss.IndexIVFPQR_k_factor_set) - - def reset(self): - return _swigfaiss.IndexIVFPQR_reset(self) - - def remove_ids(self, sel): - return _swigfaiss.IndexIVFPQR_remove_ids(self, sel) - - def train_residual(self, n, x): - return _swigfaiss.IndexIVFPQR_train_residual(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIVFPQR_add_with_ids(self, n, x, xids) - - def add_core(self, n, x, xids, precomputed_idx=None): - return _swigfaiss.IndexIVFPQR_add_core(self, n, x, xids, precomputed_idx) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexIVFPQR_reconstruct_from_offset(self, list_no, offset, recons) - - def merge_from(self, other, add_id): - return _swigfaiss.IndexIVFPQR_merge_from(self, other, add_id) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss.IndexIVFPQR_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def __init__(self, *args): - this = _swigfaiss.new_IndexIVFPQR(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexIVFPQR - __del__ = lambda self: None -IndexIVFPQR_swigregister = _swigfaiss.IndexIVFPQR_swigregister -IndexIVFPQR_swigregister(IndexIVFPQR) - -class Index2Layer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, Index2Layer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, Index2Layer, name) - __repr__ = _swig_repr - __swig_setmethods__["q1"] = _swigfaiss.Index2Layer_q1_set - __swig_getmethods__["q1"] = _swigfaiss.Index2Layer_q1_get - if _newclass: - q1 = _swig_property(_swigfaiss.Index2Layer_q1_get, _swigfaiss.Index2Layer_q1_set) - __swig_setmethods__["pq"] = _swigfaiss.Index2Layer_pq_set - __swig_getmethods__["pq"] = _swigfaiss.Index2Layer_pq_get - if _newclass: - pq = _swig_property(_swigfaiss.Index2Layer_pq_get, _swigfaiss.Index2Layer_pq_set) - __swig_setmethods__["codes"] = _swigfaiss.Index2Layer_codes_set - __swig_getmethods__["codes"] = _swigfaiss.Index2Layer_codes_get - if _newclass: - codes = _swig_property(_swigfaiss.Index2Layer_codes_get, _swigfaiss.Index2Layer_codes_set) - __swig_setmethods__["code_size_1"] = _swigfaiss.Index2Layer_code_size_1_set - __swig_getmethods__["code_size_1"] = _swigfaiss.Index2Layer_code_size_1_get - if _newclass: - code_size_1 = _swig_property(_swigfaiss.Index2Layer_code_size_1_get, _swigfaiss.Index2Layer_code_size_1_set) - __swig_setmethods__["code_size_2"] = _swigfaiss.Index2Layer_code_size_2_set - __swig_getmethods__["code_size_2"] = _swigfaiss.Index2Layer_code_size_2_get - if _newclass: - code_size_2 = _swig_property(_swigfaiss.Index2Layer_code_size_2_get, _swigfaiss.Index2Layer_code_size_2_set) - __swig_setmethods__["code_size"] = _swigfaiss.Index2Layer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.Index2Layer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.Index2Layer_code_size_get, _swigfaiss.Index2Layer_code_size_set) - - def __init__(self, *args): - this = _swigfaiss.new_Index2Layer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_Index2Layer - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss.Index2Layer_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.Index2Layer_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.Index2Layer_search(self, n, x, k, distances, labels) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.Index2Layer_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss.Index2Layer_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss.Index2Layer_reset(self) - - def transfer_to_IVFPQ(self, other): - return _swigfaiss.Index2Layer_transfer_to_IVFPQ(self, other) -Index2Layer_swigregister = _swigfaiss.Index2Layer_swigregister -Index2Layer_swigregister(Index2Layer) - -class IndexBinary(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinary, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinary, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss.IndexBinary_d_set - __swig_getmethods__["d"] = _swigfaiss.IndexBinary_d_get - if _newclass: - d = _swig_property(_swigfaiss.IndexBinary_d_get, _swigfaiss.IndexBinary_d_set) - __swig_setmethods__["code_size"] = _swigfaiss.IndexBinary_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss.IndexBinary_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss.IndexBinary_code_size_get, _swigfaiss.IndexBinary_code_size_set) - __swig_setmethods__["ntotal"] = _swigfaiss.IndexBinary_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss.IndexBinary_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss.IndexBinary_ntotal_get, _swigfaiss.IndexBinary_ntotal_set) - __swig_setmethods__["verbose"] = _swigfaiss.IndexBinary_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.IndexBinary_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.IndexBinary_verbose_get, _swigfaiss.IndexBinary_verbose_set) - __swig_setmethods__["is_trained"] = _swigfaiss.IndexBinary_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss.IndexBinary_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss.IndexBinary_is_trained_get, _swigfaiss.IndexBinary_is_trained_set) - __swig_setmethods__["metric_type"] = _swigfaiss.IndexBinary_metric_type_set - __swig_getmethods__["metric_type"] = _swigfaiss.IndexBinary_metric_type_get - if _newclass: - metric_type = _swig_property(_swigfaiss.IndexBinary_metric_type_get, _swigfaiss.IndexBinary_metric_type_set) - __swig_destroy__ = _swigfaiss.delete_IndexBinary - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss.IndexBinary_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexBinary_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexBinary_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinary_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexBinary_range_search(self, n, x, radius, result) - - def assign(self, n, x, labels, k=1): - return _swigfaiss.IndexBinary_assign(self, n, x, labels, k) - - def reset(self): - return _swigfaiss.IndexBinary_reset(self) - - def remove_ids(self, sel): - return _swigfaiss.IndexBinary_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexBinary_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexBinary_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss.IndexBinary_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def display(self): - return _swigfaiss.IndexBinary_display(self) -IndexBinary_swigregister = _swigfaiss.IndexBinary_swigregister -IndexBinary_swigregister(IndexBinary) - -class IndexBinaryFlat(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["xb"] = _swigfaiss.IndexBinaryFlat_xb_set - __swig_getmethods__["xb"] = _swigfaiss.IndexBinaryFlat_xb_get - if _newclass: - xb = _swig_property(_swigfaiss.IndexBinaryFlat_xb_get, _swigfaiss.IndexBinaryFlat_xb_set) - __swig_setmethods__["use_heap"] = _swigfaiss.IndexBinaryFlat_use_heap_set - __swig_getmethods__["use_heap"] = _swigfaiss.IndexBinaryFlat_use_heap_get - if _newclass: - use_heap = _swig_property(_swigfaiss.IndexBinaryFlat_use_heap_get, _swigfaiss.IndexBinaryFlat_use_heap_set) - __swig_setmethods__["query_batch_size"] = _swigfaiss.IndexBinaryFlat_query_batch_size_set - __swig_getmethods__["query_batch_size"] = _swigfaiss.IndexBinaryFlat_query_batch_size_get - if _newclass: - query_batch_size = _swig_property(_swigfaiss.IndexBinaryFlat_query_batch_size_get, _swigfaiss.IndexBinaryFlat_query_batch_size_set) - - def add(self, n, x): - return _swigfaiss.IndexBinaryFlat_add(self, n, x) - - def reset(self): - return _swigfaiss.IndexBinaryFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryFlat_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexBinaryFlat_reconstruct(self, key, recons) - - def remove_ids(self, sel): - return _swigfaiss.IndexBinaryFlat_remove_ids(self, sel) - - def __init__(self, *args): - this = _swigfaiss.new_IndexBinaryFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexBinaryFlat - __del__ = lambda self: None -IndexBinaryFlat_swigregister = _swigfaiss.IndexBinaryFlat_swigregister -IndexBinaryFlat_swigregister(IndexBinaryFlat) - -class IndexBinaryIVF(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryIVF, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryIVF, name) - __repr__ = _swig_repr - __swig_setmethods__["invlists"] = _swigfaiss.IndexBinaryIVF_invlists_set - __swig_getmethods__["invlists"] = _swigfaiss.IndexBinaryIVF_invlists_get - if _newclass: - invlists = _swig_property(_swigfaiss.IndexBinaryIVF_invlists_get, _swigfaiss.IndexBinaryIVF_invlists_set) - __swig_setmethods__["own_invlists"] = _swigfaiss.IndexBinaryIVF_own_invlists_set - __swig_getmethods__["own_invlists"] = _swigfaiss.IndexBinaryIVF_own_invlists_get - if _newclass: - own_invlists = _swig_property(_swigfaiss.IndexBinaryIVF_own_invlists_get, _swigfaiss.IndexBinaryIVF_own_invlists_set) - __swig_setmethods__["nprobe"] = _swigfaiss.IndexBinaryIVF_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss.IndexBinaryIVF_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss.IndexBinaryIVF_nprobe_get, _swigfaiss.IndexBinaryIVF_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss.IndexBinaryIVF_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss.IndexBinaryIVF_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss.IndexBinaryIVF_max_codes_get, _swigfaiss.IndexBinaryIVF_max_codes_set) - __swig_setmethods__["use_heap"] = _swigfaiss.IndexBinaryIVF_use_heap_set - __swig_getmethods__["use_heap"] = _swigfaiss.IndexBinaryIVF_use_heap_get - if _newclass: - use_heap = _swig_property(_swigfaiss.IndexBinaryIVF_use_heap_get, _swigfaiss.IndexBinaryIVF_use_heap_set) - __swig_setmethods__["maintain_direct_map"] = _swigfaiss.IndexBinaryIVF_maintain_direct_map_set - __swig_getmethods__["maintain_direct_map"] = _swigfaiss.IndexBinaryIVF_maintain_direct_map_get - if _newclass: - maintain_direct_map = _swig_property(_swigfaiss.IndexBinaryIVF_maintain_direct_map_get, _swigfaiss.IndexBinaryIVF_maintain_direct_map_set) - __swig_setmethods__["direct_map"] = _swigfaiss.IndexBinaryIVF_direct_map_set - __swig_getmethods__["direct_map"] = _swigfaiss.IndexBinaryIVF_direct_map_get - if _newclass: - direct_map = _swig_property(_swigfaiss.IndexBinaryIVF_direct_map_get, _swigfaiss.IndexBinaryIVF_direct_map_set) - __swig_setmethods__["quantizer"] = _swigfaiss.IndexBinaryIVF_quantizer_set - __swig_getmethods__["quantizer"] = _swigfaiss.IndexBinaryIVF_quantizer_get - if _newclass: - quantizer = _swig_property(_swigfaiss.IndexBinaryIVF_quantizer_get, _swigfaiss.IndexBinaryIVF_quantizer_set) - __swig_setmethods__["nlist"] = _swigfaiss.IndexBinaryIVF_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss.IndexBinaryIVF_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss.IndexBinaryIVF_nlist_get, _swigfaiss.IndexBinaryIVF_nlist_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexBinaryIVF_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexBinaryIVF_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexBinaryIVF_own_fields_get, _swigfaiss.IndexBinaryIVF_own_fields_set) - __swig_setmethods__["cp"] = _swigfaiss.IndexBinaryIVF_cp_set - __swig_getmethods__["cp"] = _swigfaiss.IndexBinaryIVF_cp_get - if _newclass: - cp = _swig_property(_swigfaiss.IndexBinaryIVF_cp_get, _swigfaiss.IndexBinaryIVF_cp_set) - __swig_setmethods__["clustering_index"] = _swigfaiss.IndexBinaryIVF_clustering_index_set - __swig_getmethods__["clustering_index"] = _swigfaiss.IndexBinaryIVF_clustering_index_get - if _newclass: - clustering_index = _swig_property(_swigfaiss.IndexBinaryIVF_clustering_index_get, _swigfaiss.IndexBinaryIVF_clustering_index_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexBinaryIVF(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexBinaryIVF - __del__ = lambda self: None - - def reset(self): - return _swigfaiss.IndexBinaryIVF_reset(self) - - def train(self, n, x): - return _swigfaiss.IndexBinaryIVF_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexBinaryIVF_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexBinaryIVF_add_with_ids(self, n, x, xids) - - def add_core(self, n, x, xids, precomputed_idx): - return _swigfaiss.IndexBinaryIVF_add_core(self, n, x, xids, precomputed_idx) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss.IndexBinaryIVF_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def get_InvertedListScanner(self, store_pairs=False): - return _swigfaiss.IndexBinaryIVF_get_InvertedListScanner(self, store_pairs) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryIVF_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexBinaryIVF_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss.IndexBinaryIVF_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss.IndexBinaryIVF_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss.IndexBinaryIVF_reconstruct_from_offset(self, list_no, offset, recons) - - def remove_ids(self, sel): - return _swigfaiss.IndexBinaryIVF_remove_ids(self, sel) - - def merge_from(self, other, add_id): - return _swigfaiss.IndexBinaryIVF_merge_from(self, other, add_id) - - def get_list_size(self, list_no): - return _swigfaiss.IndexBinaryIVF_get_list_size(self, list_no) - - def make_direct_map(self, new_maintain_direct_map=True): - return _swigfaiss.IndexBinaryIVF_make_direct_map(self, new_maintain_direct_map) - - def replace_invlists(self, il, own=False): - return _swigfaiss.IndexBinaryIVF_replace_invlists(self, il, own) -IndexBinaryIVF_swigregister = _swigfaiss.IndexBinaryIVF_swigregister -IndexBinaryIVF_swigregister(IndexBinaryIVF) - -class IndexBinaryFromFloat(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryFromFloat, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryFromFloat, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss.IndexBinaryFromFloat_index_set - __swig_getmethods__["index"] = _swigfaiss.IndexBinaryFromFloat_index_get - if _newclass: - index = _swig_property(_swigfaiss.IndexBinaryFromFloat_index_get, _swigfaiss.IndexBinaryFromFloat_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexBinaryFromFloat_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexBinaryFromFloat_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexBinaryFromFloat_own_fields_get, _swigfaiss.IndexBinaryFromFloat_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexBinaryFromFloat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexBinaryFromFloat - __del__ = lambda self: None - - def add(self, n, x): - return _swigfaiss.IndexBinaryFromFloat_add(self, n, x) - - def reset(self): - return _swigfaiss.IndexBinaryFromFloat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryFromFloat_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss.IndexBinaryFromFloat_train(self, n, x) -IndexBinaryFromFloat_swigregister = _swigfaiss.IndexBinaryFromFloat_swigregister -IndexBinaryFromFloat_swigregister(IndexBinaryFromFloat) - -class IndexBinaryHNSW(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryHNSW, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryHNSW, name) - __repr__ = _swig_repr - __swig_setmethods__["hnsw"] = _swigfaiss.IndexBinaryHNSW_hnsw_set - __swig_getmethods__["hnsw"] = _swigfaiss.IndexBinaryHNSW_hnsw_get - if _newclass: - hnsw = _swig_property(_swigfaiss.IndexBinaryHNSW_hnsw_get, _swigfaiss.IndexBinaryHNSW_hnsw_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexBinaryHNSW_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexBinaryHNSW_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexBinaryHNSW_own_fields_get, _swigfaiss.IndexBinaryHNSW_own_fields_set) - __swig_setmethods__["storage"] = _swigfaiss.IndexBinaryHNSW_storage_set - __swig_getmethods__["storage"] = _swigfaiss.IndexBinaryHNSW_storage_get - if _newclass: - storage = _swig_property(_swigfaiss.IndexBinaryHNSW_storage_get, _swigfaiss.IndexBinaryHNSW_storage_set) - - def __init__(self, *args): - this = _swigfaiss.new_IndexBinaryHNSW(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexBinaryHNSW - __del__ = lambda self: None - - def get_distance_computer(self): - return _swigfaiss.IndexBinaryHNSW_get_distance_computer(self) - - def add(self, n, x): - return _swigfaiss.IndexBinaryHNSW_add(self, n, x) - - def train(self, n, x): - return _swigfaiss.IndexBinaryHNSW_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryHNSW_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexBinaryHNSW_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss.IndexBinaryHNSW_reset(self) -IndexBinaryHNSW_swigregister = _swigfaiss.IndexBinaryHNSW_swigregister -IndexBinaryHNSW_swigregister(IndexBinaryHNSW) - -class IndexShards(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexShards, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexShards, name) - __repr__ = _swig_repr - __swig_setmethods__["shard_indexes"] = _swigfaiss.IndexShards_shard_indexes_set - __swig_getmethods__["shard_indexes"] = _swigfaiss.IndexShards_shard_indexes_get - if _newclass: - shard_indexes = _swig_property(_swigfaiss.IndexShards_shard_indexes_get, _swigfaiss.IndexShards_shard_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexShards_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexShards_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexShards_own_fields_get, _swigfaiss.IndexShards_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss.IndexShards_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss.IndexShards_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss.IndexShards_threaded_get, _swigfaiss.IndexShards_threaded_set) - __swig_setmethods__["successive_ids"] = _swigfaiss.IndexShards_successive_ids_set - __swig_getmethods__["successive_ids"] = _swigfaiss.IndexShards_successive_ids_get - if _newclass: - successive_ids = _swig_property(_swigfaiss.IndexShards_successive_ids_get, _swigfaiss.IndexShards_successive_ids_set) - - def __init__(self, d, threaded=False, successive_ids=True): - this = _swigfaiss.new_IndexShards(d, threaded, successive_ids) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_shard(self, arg2): - return _swigfaiss.IndexShards_add_shard(self, arg2) - - def sync_with_shard_indexes(self): - return _swigfaiss.IndexShards_sync_with_shard_indexes(self) - - def at(self, i): - return _swigfaiss.IndexShards_at(self, i) - - def add(self, n, x): - return _swigfaiss.IndexShards_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexShards_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexShards_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss.IndexShards_train(self, n, x) - - def reset(self): - return _swigfaiss.IndexShards_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexShards - __del__ = lambda self: None -IndexShards_swigregister = _swigfaiss.IndexShards_swigregister -IndexShards_swigregister(IndexShards) - -class IndexBinaryShards(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryShards, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryShards, name) - __repr__ = _swig_repr - __swig_setmethods__["shard_indexes"] = _swigfaiss.IndexBinaryShards_shard_indexes_set - __swig_getmethods__["shard_indexes"] = _swigfaiss.IndexBinaryShards_shard_indexes_get - if _newclass: - shard_indexes = _swig_property(_swigfaiss.IndexBinaryShards_shard_indexes_get, _swigfaiss.IndexBinaryShards_shard_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexBinaryShards_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexBinaryShards_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexBinaryShards_own_fields_get, _swigfaiss.IndexBinaryShards_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss.IndexBinaryShards_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss.IndexBinaryShards_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss.IndexBinaryShards_threaded_get, _swigfaiss.IndexBinaryShards_threaded_set) - __swig_setmethods__["successive_ids"] = _swigfaiss.IndexBinaryShards_successive_ids_set - __swig_getmethods__["successive_ids"] = _swigfaiss.IndexBinaryShards_successive_ids_get - if _newclass: - successive_ids = _swig_property(_swigfaiss.IndexBinaryShards_successive_ids_get, _swigfaiss.IndexBinaryShards_successive_ids_set) - - def __init__(self, d, threaded=False, successive_ids=True): - this = _swigfaiss.new_IndexBinaryShards(d, threaded, successive_ids) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_shard(self, arg2): - return _swigfaiss.IndexBinaryShards_add_shard(self, arg2) - - def sync_with_shard_indexes(self): - return _swigfaiss.IndexBinaryShards_sync_with_shard_indexes(self) - - def at(self, i): - return _swigfaiss.IndexBinaryShards_at(self, i) - - def add(self, n, x): - return _swigfaiss.IndexBinaryShards_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexBinaryShards_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryShards_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss.IndexBinaryShards_train(self, n, x) - - def reset(self): - return _swigfaiss.IndexBinaryShards_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexBinaryShards - __del__ = lambda self: None -IndexBinaryShards_swigregister = _swigfaiss.IndexBinaryShards_swigregister -IndexBinaryShards_swigregister(IndexBinaryShards) - -class IndexReplicas(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexReplicas, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexReplicas, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_IndexReplicas() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexReplicas - __del__ = lambda self: None - - def addIndex(self, index): - return _swigfaiss.IndexReplicas_addIndex(self, index) - - def removeIndex(self, index): - return _swigfaiss.IndexReplicas_removeIndex(self, index) - - def runOnIndex(self, f): - return _swigfaiss.IndexReplicas_runOnIndex(self, f) - - def reset(self): - return _swigfaiss.IndexReplicas_reset(self) - - def train(self, n, x): - return _swigfaiss.IndexReplicas_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexReplicas_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexReplicas_search(self, n, x, k, distances, labels) - - def reconstruct(self, arg2, v): - return _swigfaiss.IndexReplicas_reconstruct(self, arg2, v) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexReplicas_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexReplicas_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexReplicas_own_fields_get, _swigfaiss.IndexReplicas_own_fields_set) - - def count(self): - return _swigfaiss.IndexReplicas_count(self) - - def at(self, *args): - return _swigfaiss.IndexReplicas_at(self, *args) -IndexReplicas_swigregister = _swigfaiss.IndexReplicas_swigregister -IndexReplicas_swigregister(IndexReplicas) - -class IndexBinaryReplicas(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryReplicas, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryReplicas, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss.new_IndexBinaryReplicas() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_IndexBinaryReplicas - __del__ = lambda self: None - - def addIndex(self, index): - return _swigfaiss.IndexBinaryReplicas_addIndex(self, index) - - def removeIndex(self, index): - return _swigfaiss.IndexBinaryReplicas_removeIndex(self, index) - - def runOnIndex(self, f): - return _swigfaiss.IndexBinaryReplicas_runOnIndex(self, f) - - def reset(self): - return _swigfaiss.IndexBinaryReplicas_reset(self) - - def train(self, n, x): - return _swigfaiss.IndexBinaryReplicas_train(self, n, x) - - def add(self, n, x): - return _swigfaiss.IndexBinaryReplicas_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexBinaryReplicas_search(self, n, x, k, distances, labels) - - def reconstruct(self, arg2, v): - return _swigfaiss.IndexBinaryReplicas_reconstruct(self, arg2, v) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexBinaryReplicas_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexBinaryReplicas_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexBinaryReplicas_own_fields_get, _swigfaiss.IndexBinaryReplicas_own_fields_set) - - def count(self): - return _swigfaiss.IndexBinaryReplicas_count(self) - - def at(self, *args): - return _swigfaiss.IndexBinaryReplicas_at(self, *args) -IndexBinaryReplicas_swigregister = _swigfaiss.IndexBinaryReplicas_swigregister -IndexBinaryReplicas_swigregister(IndexBinaryReplicas) - -class IndexIDMap(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIDMap, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIDMap, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss.IndexIDMap_index_set - __swig_getmethods__["index"] = _swigfaiss.IndexIDMap_index_get - if _newclass: - index = _swig_property(_swigfaiss.IndexIDMap_index_get, _swigfaiss.IndexIDMap_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss.IndexIDMap_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexIDMap_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexIDMap_own_fields_get, _swigfaiss.IndexIDMap_own_fields_set) - __swig_setmethods__["id_map"] = _swigfaiss.IndexIDMap_id_map_set - __swig_getmethods__["id_map"] = _swigfaiss.IndexIDMap_id_map_get - if _newclass: - id_map = _swig_property(_swigfaiss.IndexIDMap_id_map_get, _swigfaiss.IndexIDMap_id_map_set) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIDMap_add_with_ids(self, n, x, xids) - - def add(self, n, x): - return _swigfaiss.IndexIDMap_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexIDMap_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss.IndexIDMap_train(self, n, x) - - def reset(self): - return _swigfaiss.IndexIDMap_reset(self) - - def remove_ids(self, sel): - return _swigfaiss.IndexIDMap_remove_ids(self, sel) - - def range_search(self, n, x, radius, result): - return _swigfaiss.IndexIDMap_range_search(self, n, x, radius, result) - __swig_destroy__ = _swigfaiss.delete_IndexIDMap - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss.new_IndexIDMap(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexIDMap_swigregister = _swigfaiss.IndexIDMap_swigregister -IndexIDMap_swigregister(IndexIDMap) - -class IndexIDMap2(IndexIDMap): - __swig_setmethods__ = {} - for _s in [IndexIDMap]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIDMap2, name, value) - __swig_getmethods__ = {} - for _s in [IndexIDMap]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIDMap2, name) - __repr__ = _swig_repr - __swig_setmethods__["rev_map"] = _swigfaiss.IndexIDMap2_rev_map_set - __swig_getmethods__["rev_map"] = _swigfaiss.IndexIDMap2_rev_map_get - if _newclass: - rev_map = _swig_property(_swigfaiss.IndexIDMap2_rev_map_get, _swigfaiss.IndexIDMap2_rev_map_set) - - def construct_rev_map(self): - return _swigfaiss.IndexIDMap2_construct_rev_map(self) - - def add_with_ids(self, n, x, xids): - return _swigfaiss.IndexIDMap2_add_with_ids(self, n, x, xids) - - def remove_ids(self, sel): - return _swigfaiss.IndexIDMap2_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss.IndexIDMap2_reconstruct(self, key, recons) - __swig_destroy__ = _swigfaiss.delete_IndexIDMap2 - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss.new_IndexIDMap2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexIDMap2_swigregister = _swigfaiss.IndexIDMap2_swigregister -IndexIDMap2_swigregister(IndexIDMap2) - -class IndexSplitVectors(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexSplitVectors, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexSplitVectors, name) - __repr__ = _swig_repr - __swig_setmethods__["own_fields"] = _swigfaiss.IndexSplitVectors_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss.IndexSplitVectors_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss.IndexSplitVectors_own_fields_get, _swigfaiss.IndexSplitVectors_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss.IndexSplitVectors_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss.IndexSplitVectors_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss.IndexSplitVectors_threaded_get, _swigfaiss.IndexSplitVectors_threaded_set) - __swig_setmethods__["sub_indexes"] = _swigfaiss.IndexSplitVectors_sub_indexes_set - __swig_getmethods__["sub_indexes"] = _swigfaiss.IndexSplitVectors_sub_indexes_get - if _newclass: - sub_indexes = _swig_property(_swigfaiss.IndexSplitVectors_sub_indexes_get, _swigfaiss.IndexSplitVectors_sub_indexes_set) - __swig_setmethods__["sum_d"] = _swigfaiss.IndexSplitVectors_sum_d_set - __swig_getmethods__["sum_d"] = _swigfaiss.IndexSplitVectors_sum_d_get - if _newclass: - sum_d = _swig_property(_swigfaiss.IndexSplitVectors_sum_d_get, _swigfaiss.IndexSplitVectors_sum_d_set) - - def __init__(self, d, threaded=False): - this = _swigfaiss.new_IndexSplitVectors(d, threaded) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_sub_index(self, arg2): - return _swigfaiss.IndexSplitVectors_add_sub_index(self, arg2) - - def sync_with_sub_indexes(self): - return _swigfaiss.IndexSplitVectors_sync_with_sub_indexes(self) - - def add(self, n, x): - return _swigfaiss.IndexSplitVectors_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss.IndexSplitVectors_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss.IndexSplitVectors_train(self, n, x) - - def reset(self): - return _swigfaiss.IndexSplitVectors_reset(self) - __swig_destroy__ = _swigfaiss.delete_IndexSplitVectors - __del__ = lambda self: None -IndexSplitVectors_swigregister = _swigfaiss.IndexSplitVectors_swigregister -IndexSplitVectors_swigregister(IndexSplitVectors) - - -def downcast_index(index): - return _swigfaiss.downcast_index(index) -downcast_index = _swigfaiss.downcast_index - -def downcast_VectorTransform(vt): - return _swigfaiss.downcast_VectorTransform(vt) -downcast_VectorTransform = _swigfaiss.downcast_VectorTransform - -def downcast_IndexBinary(index): - return _swigfaiss.downcast_IndexBinary(index) -downcast_IndexBinary = _swigfaiss.downcast_IndexBinary - -def write_index(*args): - return _swigfaiss.write_index(*args) -write_index = _swigfaiss.write_index - -def write_index_binary(*args): - return _swigfaiss.write_index_binary(*args) -write_index_binary = _swigfaiss.write_index_binary - -def read_index(*args): - return _swigfaiss.read_index(*args) -read_index = _swigfaiss.read_index - -def read_index_binary(*args): - return _swigfaiss.read_index_binary(*args) -read_index_binary = _swigfaiss.read_index_binary - -def write_VectorTransform(vt, fname): - return _swigfaiss.write_VectorTransform(vt, fname) -write_VectorTransform = _swigfaiss.write_VectorTransform - -def read_VectorTransform(fname): - return _swigfaiss.read_VectorTransform(fname) -read_VectorTransform = _swigfaiss.read_VectorTransform - -def read_ProductQuantizer(*args): - return _swigfaiss.read_ProductQuantizer(*args) -read_ProductQuantizer = _swigfaiss.read_ProductQuantizer - -def write_ProductQuantizer(*args): - return _swigfaiss.write_ProductQuantizer(*args) -write_ProductQuantizer = _swigfaiss.write_ProductQuantizer - -def write_InvertedLists(ils, f): - return _swigfaiss.write_InvertedLists(ils, f) -write_InvertedLists = _swigfaiss.write_InvertedLists - -def read_InvertedLists(reader, io_flags=0): - return _swigfaiss.read_InvertedLists(reader, io_flags) -read_InvertedLists = _swigfaiss.read_InvertedLists - -def clone_index(arg1): - return _swigfaiss.clone_index(arg1) -clone_index = _swigfaiss.clone_index -class Cloner(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Cloner, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Cloner, name) - __repr__ = _swig_repr - - def clone_VectorTransform(self, arg2): - return _swigfaiss.Cloner_clone_VectorTransform(self, arg2) - - def clone_Index(self, arg2): - return _swigfaiss.Cloner_clone_Index(self, arg2) - - def clone_IndexIVF(self, arg2): - return _swigfaiss.Cloner_clone_IndexIVF(self, arg2) - __swig_destroy__ = _swigfaiss.delete_Cloner - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss.new_Cloner() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -Cloner_swigregister = _swigfaiss.Cloner_swigregister -Cloner_swigregister(Cloner) -IO_FLAG_MMAP = cvar.IO_FLAG_MMAP -IO_FLAG_READ_ONLY = cvar.IO_FLAG_READ_ONLY -IO_FLAG_ONDISK_SAME_DIR = cvar.IO_FLAG_ONDISK_SAME_DIR - -class AutoTuneCriterion(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, AutoTuneCriterion, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, AutoTuneCriterion, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss.AutoTuneCriterion_nq_set - __swig_getmethods__["nq"] = _swigfaiss.AutoTuneCriterion_nq_get - if _newclass: - nq = _swig_property(_swigfaiss.AutoTuneCriterion_nq_get, _swigfaiss.AutoTuneCriterion_nq_set) - __swig_setmethods__["nnn"] = _swigfaiss.AutoTuneCriterion_nnn_set - __swig_getmethods__["nnn"] = _swigfaiss.AutoTuneCriterion_nnn_get - if _newclass: - nnn = _swig_property(_swigfaiss.AutoTuneCriterion_nnn_get, _swigfaiss.AutoTuneCriterion_nnn_set) - __swig_setmethods__["gt_nnn"] = _swigfaiss.AutoTuneCriterion_gt_nnn_set - __swig_getmethods__["gt_nnn"] = _swigfaiss.AutoTuneCriterion_gt_nnn_get - if _newclass: - gt_nnn = _swig_property(_swigfaiss.AutoTuneCriterion_gt_nnn_get, _swigfaiss.AutoTuneCriterion_gt_nnn_set) - __swig_setmethods__["gt_D"] = _swigfaiss.AutoTuneCriterion_gt_D_set - __swig_getmethods__["gt_D"] = _swigfaiss.AutoTuneCriterion_gt_D_get - if _newclass: - gt_D = _swig_property(_swigfaiss.AutoTuneCriterion_gt_D_get, _swigfaiss.AutoTuneCriterion_gt_D_set) - __swig_setmethods__["gt_I"] = _swigfaiss.AutoTuneCriterion_gt_I_set - __swig_getmethods__["gt_I"] = _swigfaiss.AutoTuneCriterion_gt_I_get - if _newclass: - gt_I = _swig_property(_swigfaiss.AutoTuneCriterion_gt_I_get, _swigfaiss.AutoTuneCriterion_gt_I_set) - - def set_groundtruth(self, gt_nnn, gt_D_in, gt_I_in): - return _swigfaiss.AutoTuneCriterion_set_groundtruth(self, gt_nnn, gt_D_in, gt_I_in) - - def evaluate(self, D, I): - return _swigfaiss.AutoTuneCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss.delete_AutoTuneCriterion - __del__ = lambda self: None -AutoTuneCriterion_swigregister = _swigfaiss.AutoTuneCriterion_swigregister -AutoTuneCriterion_swigregister(AutoTuneCriterion) - -class OneRecallAtRCriterion(AutoTuneCriterion): - __swig_setmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OneRecallAtRCriterion, name, value) - __swig_getmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OneRecallAtRCriterion, name) - __repr__ = _swig_repr - __swig_setmethods__["R"] = _swigfaiss.OneRecallAtRCriterion_R_set - __swig_getmethods__["R"] = _swigfaiss.OneRecallAtRCriterion_R_get - if _newclass: - R = _swig_property(_swigfaiss.OneRecallAtRCriterion_R_get, _swigfaiss.OneRecallAtRCriterion_R_set) - - def __init__(self, nq, R): - this = _swigfaiss.new_OneRecallAtRCriterion(nq, R) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def evaluate(self, D, I): - return _swigfaiss.OneRecallAtRCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss.delete_OneRecallAtRCriterion - __del__ = lambda self: None -OneRecallAtRCriterion_swigregister = _swigfaiss.OneRecallAtRCriterion_swigregister -OneRecallAtRCriterion_swigregister(OneRecallAtRCriterion) - -class IntersectionCriterion(AutoTuneCriterion): - __swig_setmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IntersectionCriterion, name, value) - __swig_getmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IntersectionCriterion, name) - __repr__ = _swig_repr - __swig_setmethods__["R"] = _swigfaiss.IntersectionCriterion_R_set - __swig_getmethods__["R"] = _swigfaiss.IntersectionCriterion_R_get - if _newclass: - R = _swig_property(_swigfaiss.IntersectionCriterion_R_get, _swigfaiss.IntersectionCriterion_R_set) - - def __init__(self, nq, R): - this = _swigfaiss.new_IntersectionCriterion(nq, R) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def evaluate(self, D, I): - return _swigfaiss.IntersectionCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss.delete_IntersectionCriterion - __del__ = lambda self: None -IntersectionCriterion_swigregister = _swigfaiss.IntersectionCriterion_swigregister -IntersectionCriterion_swigregister(IntersectionCriterion) - -class OperatingPoint(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPoint, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPoint, name) - __repr__ = _swig_repr - __swig_setmethods__["perf"] = _swigfaiss.OperatingPoint_perf_set - __swig_getmethods__["perf"] = _swigfaiss.OperatingPoint_perf_get - if _newclass: - perf = _swig_property(_swigfaiss.OperatingPoint_perf_get, _swigfaiss.OperatingPoint_perf_set) - __swig_setmethods__["t"] = _swigfaiss.OperatingPoint_t_set - __swig_getmethods__["t"] = _swigfaiss.OperatingPoint_t_get - if _newclass: - t = _swig_property(_swigfaiss.OperatingPoint_t_get, _swigfaiss.OperatingPoint_t_set) - __swig_setmethods__["key"] = _swigfaiss.OperatingPoint_key_set - __swig_getmethods__["key"] = _swigfaiss.OperatingPoint_key_get - if _newclass: - key = _swig_property(_swigfaiss.OperatingPoint_key_get, _swigfaiss.OperatingPoint_key_set) - __swig_setmethods__["cno"] = _swigfaiss.OperatingPoint_cno_set - __swig_getmethods__["cno"] = _swigfaiss.OperatingPoint_cno_get - if _newclass: - cno = _swig_property(_swigfaiss.OperatingPoint_cno_get, _swigfaiss.OperatingPoint_cno_set) - - def __init__(self): - this = _swigfaiss.new_OperatingPoint() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_OperatingPoint - __del__ = lambda self: None -OperatingPoint_swigregister = _swigfaiss.OperatingPoint_swigregister -OperatingPoint_swigregister(OperatingPoint) - -class OperatingPoints(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPoints, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPoints, name) - __repr__ = _swig_repr - __swig_setmethods__["all_pts"] = _swigfaiss.OperatingPoints_all_pts_set - __swig_getmethods__["all_pts"] = _swigfaiss.OperatingPoints_all_pts_get - if _newclass: - all_pts = _swig_property(_swigfaiss.OperatingPoints_all_pts_get, _swigfaiss.OperatingPoints_all_pts_set) - __swig_setmethods__["optimal_pts"] = _swigfaiss.OperatingPoints_optimal_pts_set - __swig_getmethods__["optimal_pts"] = _swigfaiss.OperatingPoints_optimal_pts_get - if _newclass: - optimal_pts = _swig_property(_swigfaiss.OperatingPoints_optimal_pts_get, _swigfaiss.OperatingPoints_optimal_pts_set) - - def __init__(self): - this = _swigfaiss.new_OperatingPoints() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def merge_with(self, *args): - return _swigfaiss.OperatingPoints_merge_with(self, *args) - - def clear(self): - return _swigfaiss.OperatingPoints_clear(self) - - def add(self, perf, t, key, cno=0): - return _swigfaiss.OperatingPoints_add(self, perf, t, key, cno) - - def t_for_perf(self, perf): - return _swigfaiss.OperatingPoints_t_for_perf(self, perf) - - def display(self, only_optimal=True): - return _swigfaiss.OperatingPoints_display(self, only_optimal) - - def all_to_gnuplot(self, fname): - return _swigfaiss.OperatingPoints_all_to_gnuplot(self, fname) - - def optimal_to_gnuplot(self, fname): - return _swigfaiss.OperatingPoints_optimal_to_gnuplot(self, fname) - __swig_destroy__ = _swigfaiss.delete_OperatingPoints - __del__ = lambda self: None -OperatingPoints_swigregister = _swigfaiss.OperatingPoints_swigregister -OperatingPoints_swigregister(OperatingPoints) - -class ParameterRange(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ParameterRange, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ParameterRange, name) - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss.ParameterRange_name_set - __swig_getmethods__["name"] = _swigfaiss.ParameterRange_name_get - if _newclass: - name = _swig_property(_swigfaiss.ParameterRange_name_get, _swigfaiss.ParameterRange_name_set) - __swig_setmethods__["values"] = _swigfaiss.ParameterRange_values_set - __swig_getmethods__["values"] = _swigfaiss.ParameterRange_values_get - if _newclass: - values = _swig_property(_swigfaiss.ParameterRange_values_get, _swigfaiss.ParameterRange_values_set) - - def __init__(self): - this = _swigfaiss.new_ParameterRange() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_ParameterRange - __del__ = lambda self: None -ParameterRange_swigregister = _swigfaiss.ParameterRange_swigregister -ParameterRange_swigregister(ParameterRange) - -class ParameterSpace(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ParameterSpace, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ParameterSpace, name) - __repr__ = _swig_repr - __swig_setmethods__["parameter_ranges"] = _swigfaiss.ParameterSpace_parameter_ranges_set - __swig_getmethods__["parameter_ranges"] = _swigfaiss.ParameterSpace_parameter_ranges_get - if _newclass: - parameter_ranges = _swig_property(_swigfaiss.ParameterSpace_parameter_ranges_get, _swigfaiss.ParameterSpace_parameter_ranges_set) - __swig_setmethods__["verbose"] = _swigfaiss.ParameterSpace_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss.ParameterSpace_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss.ParameterSpace_verbose_get, _swigfaiss.ParameterSpace_verbose_set) - __swig_setmethods__["n_experiments"] = _swigfaiss.ParameterSpace_n_experiments_set - __swig_getmethods__["n_experiments"] = _swigfaiss.ParameterSpace_n_experiments_get - if _newclass: - n_experiments = _swig_property(_swigfaiss.ParameterSpace_n_experiments_get, _swigfaiss.ParameterSpace_n_experiments_set) - __swig_setmethods__["batchsize"] = _swigfaiss.ParameterSpace_batchsize_set - __swig_getmethods__["batchsize"] = _swigfaiss.ParameterSpace_batchsize_get - if _newclass: - batchsize = _swig_property(_swigfaiss.ParameterSpace_batchsize_get, _swigfaiss.ParameterSpace_batchsize_set) - __swig_setmethods__["thread_over_batches"] = _swigfaiss.ParameterSpace_thread_over_batches_set - __swig_getmethods__["thread_over_batches"] = _swigfaiss.ParameterSpace_thread_over_batches_get - if _newclass: - thread_over_batches = _swig_property(_swigfaiss.ParameterSpace_thread_over_batches_get, _swigfaiss.ParameterSpace_thread_over_batches_set) - __swig_setmethods__["min_test_duration"] = _swigfaiss.ParameterSpace_min_test_duration_set - __swig_getmethods__["min_test_duration"] = _swigfaiss.ParameterSpace_min_test_duration_get - if _newclass: - min_test_duration = _swig_property(_swigfaiss.ParameterSpace_min_test_duration_get, _swigfaiss.ParameterSpace_min_test_duration_set) - - def __init__(self): - this = _swigfaiss.new_ParameterSpace() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def n_combinations(self): - return _swigfaiss.ParameterSpace_n_combinations(self) - - def combination_ge(self, c1, c2): - return _swigfaiss.ParameterSpace_combination_ge(self, c1, c2) - - def combination_name(self, cno): - return _swigfaiss.ParameterSpace_combination_name(self, cno) - - def display(self): - return _swigfaiss.ParameterSpace_display(self) - - def add_range(self, name): - return _swigfaiss.ParameterSpace_add_range(self, name) - - def initialize(self, index): - return _swigfaiss.ParameterSpace_initialize(self, index) - - def set_index_parameters(self, *args): - return _swigfaiss.ParameterSpace_set_index_parameters(self, *args) - - def set_index_parameter(self, index, name, val): - return _swigfaiss.ParameterSpace_set_index_parameter(self, index, name, val) - - def update_bounds(self, cno, op, upper_bound_perf, lower_bound_t): - return _swigfaiss.ParameterSpace_update_bounds(self, cno, op, upper_bound_perf, lower_bound_t) - - def explore(self, index, nq, xq, crit, ops): - return _swigfaiss.ParameterSpace_explore(self, index, nq, xq, crit, ops) - __swig_destroy__ = _swigfaiss.delete_ParameterSpace - __del__ = lambda self: None -ParameterSpace_swigregister = _swigfaiss.ParameterSpace_swigregister -ParameterSpace_swigregister(ParameterSpace) - - -def index_factory(*args): - return _swigfaiss.index_factory(*args) -index_factory = _swigfaiss.index_factory - -def index_binary_factory(d, description): - return _swigfaiss.index_binary_factory(d, description) -index_binary_factory = _swigfaiss.index_binary_factory -class MatrixStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, MatrixStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, MatrixStats, name) - __repr__ = _swig_repr - - def __init__(self, n, d, x): - this = _swigfaiss.new_MatrixStats(n, d, x) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["comments"] = _swigfaiss.MatrixStats_comments_set - __swig_getmethods__["comments"] = _swigfaiss.MatrixStats_comments_get - if _newclass: - comments = _swig_property(_swigfaiss.MatrixStats_comments_get, _swigfaiss.MatrixStats_comments_set) - __swig_setmethods__["n"] = _swigfaiss.MatrixStats_n_set - __swig_getmethods__["n"] = _swigfaiss.MatrixStats_n_get - if _newclass: - n = _swig_property(_swigfaiss.MatrixStats_n_get, _swigfaiss.MatrixStats_n_set) - __swig_setmethods__["d"] = _swigfaiss.MatrixStats_d_set - __swig_getmethods__["d"] = _swigfaiss.MatrixStats_d_get - if _newclass: - d = _swig_property(_swigfaiss.MatrixStats_d_get, _swigfaiss.MatrixStats_d_set) - __swig_setmethods__["n_collision"] = _swigfaiss.MatrixStats_n_collision_set - __swig_getmethods__["n_collision"] = _swigfaiss.MatrixStats_n_collision_get - if _newclass: - n_collision = _swig_property(_swigfaiss.MatrixStats_n_collision_get, _swigfaiss.MatrixStats_n_collision_set) - __swig_setmethods__["n_valid"] = _swigfaiss.MatrixStats_n_valid_set - __swig_getmethods__["n_valid"] = _swigfaiss.MatrixStats_n_valid_get - if _newclass: - n_valid = _swig_property(_swigfaiss.MatrixStats_n_valid_get, _swigfaiss.MatrixStats_n_valid_set) - __swig_setmethods__["n0"] = _swigfaiss.MatrixStats_n0_set - __swig_getmethods__["n0"] = _swigfaiss.MatrixStats_n0_get - if _newclass: - n0 = _swig_property(_swigfaiss.MatrixStats_n0_get, _swigfaiss.MatrixStats_n0_set) - __swig_setmethods__["min_norm2"] = _swigfaiss.MatrixStats_min_norm2_set - __swig_getmethods__["min_norm2"] = _swigfaiss.MatrixStats_min_norm2_get - if _newclass: - min_norm2 = _swig_property(_swigfaiss.MatrixStats_min_norm2_get, _swigfaiss.MatrixStats_min_norm2_set) - __swig_setmethods__["max_norm2"] = _swigfaiss.MatrixStats_max_norm2_set - __swig_getmethods__["max_norm2"] = _swigfaiss.MatrixStats_max_norm2_get - if _newclass: - max_norm2 = _swig_property(_swigfaiss.MatrixStats_max_norm2_get, _swigfaiss.MatrixStats_max_norm2_set) - __swig_setmethods__["per_dim_stats"] = _swigfaiss.MatrixStats_per_dim_stats_set - __swig_getmethods__["per_dim_stats"] = _swigfaiss.MatrixStats_per_dim_stats_get - if _newclass: - per_dim_stats = _swig_property(_swigfaiss.MatrixStats_per_dim_stats_get, _swigfaiss.MatrixStats_per_dim_stats_set) - __swig_setmethods__["occurrences"] = _swigfaiss.MatrixStats_occurrences_set - __swig_getmethods__["occurrences"] = _swigfaiss.MatrixStats_occurrences_get - if _newclass: - occurrences = _swig_property(_swigfaiss.MatrixStats_occurrences_get, _swigfaiss.MatrixStats_occurrences_set) - __swig_setmethods__["buf"] = _swigfaiss.MatrixStats_buf_set - __swig_getmethods__["buf"] = _swigfaiss.MatrixStats_buf_get - if _newclass: - buf = _swig_property(_swigfaiss.MatrixStats_buf_get, _swigfaiss.MatrixStats_buf_set) - __swig_setmethods__["nbuf"] = _swigfaiss.MatrixStats_nbuf_set - __swig_getmethods__["nbuf"] = _swigfaiss.MatrixStats_nbuf_get - if _newclass: - nbuf = _swig_property(_swigfaiss.MatrixStats_nbuf_get, _swigfaiss.MatrixStats_nbuf_set) - - def do_comment(self, fmt): - return _swigfaiss.MatrixStats_do_comment(self, fmt) - __swig_destroy__ = _swigfaiss.delete_MatrixStats - __del__ = lambda self: None -MatrixStats_swigregister = _swigfaiss.MatrixStats_swigregister -MatrixStats_swigregister(MatrixStats) - - -def swig_ptr(a): - return _swigfaiss.swig_ptr(a) -swig_ptr = _swigfaiss.swig_ptr - -def rev_swig_ptr(*args): - return _swigfaiss.rev_swig_ptr(*args) -rev_swig_ptr = _swigfaiss.rev_swig_ptr -class float_minheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, float_minheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, float_minheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss.float_minheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss.float_minheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss.float_minheap_array_t_nh_get, _swigfaiss.float_minheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss.float_minheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss.float_minheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss.float_minheap_array_t_k_get, _swigfaiss.float_minheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss.float_minheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss.float_minheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss.float_minheap_array_t_ids_get, _swigfaiss.float_minheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss.float_minheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss.float_minheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss.float_minheap_array_t_val_get, _swigfaiss.float_minheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss.float_minheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss.float_minheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss.float_minheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss.float_minheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss.float_minheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss.float_minheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss.float_minheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss.new_float_minheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_float_minheap_array_t - __del__ = lambda self: None -float_minheap_array_t_swigregister = _swigfaiss.float_minheap_array_t_swigregister -float_minheap_array_t_swigregister(float_minheap_array_t) - -class int_minheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, int_minheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, int_minheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss.int_minheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss.int_minheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss.int_minheap_array_t_nh_get, _swigfaiss.int_minheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss.int_minheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss.int_minheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss.int_minheap_array_t_k_get, _swigfaiss.int_minheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss.int_minheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss.int_minheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss.int_minheap_array_t_ids_get, _swigfaiss.int_minheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss.int_minheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss.int_minheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss.int_minheap_array_t_val_get, _swigfaiss.int_minheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss.int_minheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss.int_minheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss.int_minheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss.int_minheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss.int_minheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss.int_minheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss.int_minheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss.new_int_minheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_int_minheap_array_t - __del__ = lambda self: None -int_minheap_array_t_swigregister = _swigfaiss.int_minheap_array_t_swigregister -int_minheap_array_t_swigregister(int_minheap_array_t) - -class float_maxheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, float_maxheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, float_maxheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss.float_maxheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss.float_maxheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss.float_maxheap_array_t_nh_get, _swigfaiss.float_maxheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss.float_maxheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss.float_maxheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss.float_maxheap_array_t_k_get, _swigfaiss.float_maxheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss.float_maxheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss.float_maxheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss.float_maxheap_array_t_ids_get, _swigfaiss.float_maxheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss.float_maxheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss.float_maxheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss.float_maxheap_array_t_val_get, _swigfaiss.float_maxheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss.float_maxheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss.float_maxheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss.float_maxheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss.float_maxheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss.float_maxheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss.float_maxheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss.float_maxheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss.new_float_maxheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_float_maxheap_array_t - __del__ = lambda self: None -float_maxheap_array_t_swigregister = _swigfaiss.float_maxheap_array_t_swigregister -float_maxheap_array_t_swigregister(float_maxheap_array_t) - -class int_maxheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, int_maxheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, int_maxheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss.int_maxheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss.int_maxheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss.int_maxheap_array_t_nh_get, _swigfaiss.int_maxheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss.int_maxheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss.int_maxheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss.int_maxheap_array_t_k_get, _swigfaiss.int_maxheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss.int_maxheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss.int_maxheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss.int_maxheap_array_t_ids_get, _swigfaiss.int_maxheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss.int_maxheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss.int_maxheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss.int_maxheap_array_t_val_get, _swigfaiss.int_maxheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss.int_maxheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss.int_maxheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss.int_maxheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss.int_maxheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss.int_maxheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss.int_maxheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss.int_maxheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss.new_int_maxheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_int_maxheap_array_t - __del__ = lambda self: None -int_maxheap_array_t_swigregister = _swigfaiss.int_maxheap_array_t_swigregister -int_maxheap_array_t_swigregister(int_maxheap_array_t) - - -def omp_set_num_threads(num_threads): - return _swigfaiss.omp_set_num_threads(num_threads) -omp_set_num_threads = _swigfaiss.omp_set_num_threads - -def omp_get_max_threads(): - return _swigfaiss.omp_get_max_threads() -omp_get_max_threads = _swigfaiss.omp_get_max_threads - -def memcpy(dest, src, n): - return _swigfaiss.memcpy(dest, src, n) -memcpy = _swigfaiss.memcpy - -def cast_integer_to_float_ptr(x): - return _swigfaiss.cast_integer_to_float_ptr(x) -cast_integer_to_float_ptr = _swigfaiss.cast_integer_to_float_ptr - -def cast_integer_to_long_ptr(x): - return _swigfaiss.cast_integer_to_long_ptr(x) -cast_integer_to_long_ptr = _swigfaiss.cast_integer_to_long_ptr - -def cast_integer_to_int_ptr(x): - return _swigfaiss.cast_integer_to_int_ptr(x) -cast_integer_to_int_ptr = _swigfaiss.cast_integer_to_int_ptr -class RangeSearchResult(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeSearchResult, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RangeSearchResult, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss.RangeSearchResult_nq_set - __swig_getmethods__["nq"] = _swigfaiss.RangeSearchResult_nq_get - if _newclass: - nq = _swig_property(_swigfaiss.RangeSearchResult_nq_get, _swigfaiss.RangeSearchResult_nq_set) - __swig_setmethods__["lims"] = _swigfaiss.RangeSearchResult_lims_set - __swig_getmethods__["lims"] = _swigfaiss.RangeSearchResult_lims_get - if _newclass: - lims = _swig_property(_swigfaiss.RangeSearchResult_lims_get, _swigfaiss.RangeSearchResult_lims_set) - __swig_setmethods__["labels"] = _swigfaiss.RangeSearchResult_labels_set - __swig_getmethods__["labels"] = _swigfaiss.RangeSearchResult_labels_get - if _newclass: - labels = _swig_property(_swigfaiss.RangeSearchResult_labels_get, _swigfaiss.RangeSearchResult_labels_set) - __swig_setmethods__["distances"] = _swigfaiss.RangeSearchResult_distances_set - __swig_getmethods__["distances"] = _swigfaiss.RangeSearchResult_distances_get - if _newclass: - distances = _swig_property(_swigfaiss.RangeSearchResult_distances_get, _swigfaiss.RangeSearchResult_distances_set) - __swig_setmethods__["buffer_size"] = _swigfaiss.RangeSearchResult_buffer_size_set - __swig_getmethods__["buffer_size"] = _swigfaiss.RangeSearchResult_buffer_size_get - if _newclass: - buffer_size = _swig_property(_swigfaiss.RangeSearchResult_buffer_size_get, _swigfaiss.RangeSearchResult_buffer_size_set) - - def __init__(self, nq, alloc_lims=True): - this = _swigfaiss.new_RangeSearchResult(nq, alloc_lims) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def do_allocation(self): - return _swigfaiss.RangeSearchResult_do_allocation(self) - __swig_destroy__ = _swigfaiss.delete_RangeSearchResult - __del__ = lambda self: None -RangeSearchResult_swigregister = _swigfaiss.RangeSearchResult_swigregister -RangeSearchResult_swigregister(RangeSearchResult) - -class IDSelector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IDSelector, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def is_member(self, id): - return _swigfaiss.IDSelector_is_member(self, id) - __swig_destroy__ = _swigfaiss.delete_IDSelector - __del__ = lambda self: None -IDSelector_swigregister = _swigfaiss.IDSelector_swigregister -IDSelector_swigregister(IDSelector) - -class IDSelectorRange(IDSelector): - __swig_setmethods__ = {} - for _s in [IDSelector]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelectorRange, name, value) - __swig_getmethods__ = {} - for _s in [IDSelector]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IDSelectorRange, name) - __repr__ = _swig_repr - __swig_setmethods__["imin"] = _swigfaiss.IDSelectorRange_imin_set - __swig_getmethods__["imin"] = _swigfaiss.IDSelectorRange_imin_get - if _newclass: - imin = _swig_property(_swigfaiss.IDSelectorRange_imin_get, _swigfaiss.IDSelectorRange_imin_set) - __swig_setmethods__["imax"] = _swigfaiss.IDSelectorRange_imax_set - __swig_getmethods__["imax"] = _swigfaiss.IDSelectorRange_imax_get - if _newclass: - imax = _swig_property(_swigfaiss.IDSelectorRange_imax_get, _swigfaiss.IDSelectorRange_imax_set) - - def __init__(self, imin, imax): - this = _swigfaiss.new_IDSelectorRange(imin, imax) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def is_member(self, id): - return _swigfaiss.IDSelectorRange_is_member(self, id) - __swig_destroy__ = _swigfaiss.delete_IDSelectorRange - __del__ = lambda self: None -IDSelectorRange_swigregister = _swigfaiss.IDSelectorRange_swigregister -IDSelectorRange_swigregister(IDSelectorRange) - -class IDSelectorBatch(IDSelector): - __swig_setmethods__ = {} - for _s in [IDSelector]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelectorBatch, name, value) - __swig_getmethods__ = {} - for _s in [IDSelector]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IDSelectorBatch, name) - __repr__ = _swig_repr - __swig_setmethods__["nbits"] = _swigfaiss.IDSelectorBatch_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss.IDSelectorBatch_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss.IDSelectorBatch_nbits_get, _swigfaiss.IDSelectorBatch_nbits_set) - __swig_setmethods__["mask"] = _swigfaiss.IDSelectorBatch_mask_set - __swig_getmethods__["mask"] = _swigfaiss.IDSelectorBatch_mask_get - if _newclass: - mask = _swig_property(_swigfaiss.IDSelectorBatch_mask_get, _swigfaiss.IDSelectorBatch_mask_set) - - def __init__(self, n, indices): - this = _swigfaiss.new_IDSelectorBatch(n, indices) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def is_member(self, id): - return _swigfaiss.IDSelectorBatch_is_member(self, id) - __swig_destroy__ = _swigfaiss.delete_IDSelectorBatch - __del__ = lambda self: None -IDSelectorBatch_swigregister = _swigfaiss.IDSelectorBatch_swigregister -IDSelectorBatch_swigregister(IDSelectorBatch) - -class BufferList(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, BufferList, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, BufferList, name) - __repr__ = _swig_repr - __swig_setmethods__["buffer_size"] = _swigfaiss.BufferList_buffer_size_set - __swig_getmethods__["buffer_size"] = _swigfaiss.BufferList_buffer_size_get - if _newclass: - buffer_size = _swig_property(_swigfaiss.BufferList_buffer_size_get, _swigfaiss.BufferList_buffer_size_set) - __swig_setmethods__["buffers"] = _swigfaiss.BufferList_buffers_set - __swig_getmethods__["buffers"] = _swigfaiss.BufferList_buffers_get - if _newclass: - buffers = _swig_property(_swigfaiss.BufferList_buffers_get, _swigfaiss.BufferList_buffers_set) - __swig_setmethods__["wp"] = _swigfaiss.BufferList_wp_set - __swig_getmethods__["wp"] = _swigfaiss.BufferList_wp_get - if _newclass: - wp = _swig_property(_swigfaiss.BufferList_wp_get, _swigfaiss.BufferList_wp_set) - - def __init__(self, buffer_size): - this = _swigfaiss.new_BufferList(buffer_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_BufferList - __del__ = lambda self: None - - def append_buffer(self): - return _swigfaiss.BufferList_append_buffer(self) - - def add(self, id, dis): - return _swigfaiss.BufferList_add(self, id, dis) - - def copy_range(self, ofs, n, dest_ids, dest_dis): - return _swigfaiss.BufferList_copy_range(self, ofs, n, dest_ids, dest_dis) -BufferList_swigregister = _swigfaiss.BufferList_swigregister -BufferList_swigregister(BufferList) - -class RangeQueryResult(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeQueryResult, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RangeQueryResult, name) - __repr__ = _swig_repr - __swig_setmethods__["qno"] = _swigfaiss.RangeQueryResult_qno_set - __swig_getmethods__["qno"] = _swigfaiss.RangeQueryResult_qno_get - if _newclass: - qno = _swig_property(_swigfaiss.RangeQueryResult_qno_get, _swigfaiss.RangeQueryResult_qno_set) - __swig_setmethods__["nres"] = _swigfaiss.RangeQueryResult_nres_set - __swig_getmethods__["nres"] = _swigfaiss.RangeQueryResult_nres_get - if _newclass: - nres = _swig_property(_swigfaiss.RangeQueryResult_nres_get, _swigfaiss.RangeQueryResult_nres_set) - __swig_setmethods__["pres"] = _swigfaiss.RangeQueryResult_pres_set - __swig_getmethods__["pres"] = _swigfaiss.RangeQueryResult_pres_get - if _newclass: - pres = _swig_property(_swigfaiss.RangeQueryResult_pres_get, _swigfaiss.RangeQueryResult_pres_set) - - def add(self, dis, id): - return _swigfaiss.RangeQueryResult_add(self, dis, id) - - def __init__(self): - this = _swigfaiss.new_RangeQueryResult() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_RangeQueryResult - __del__ = lambda self: None -RangeQueryResult_swigregister = _swigfaiss.RangeQueryResult_swigregister -RangeQueryResult_swigregister(RangeQueryResult) - -class RangeSearchPartialResult(BufferList): - __swig_setmethods__ = {} - for _s in [BufferList]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeSearchPartialResult, name, value) - __swig_getmethods__ = {} - for _s in [BufferList]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RangeSearchPartialResult, name) - __repr__ = _swig_repr - __swig_setmethods__["res"] = _swigfaiss.RangeSearchPartialResult_res_set - __swig_getmethods__["res"] = _swigfaiss.RangeSearchPartialResult_res_get - if _newclass: - res = _swig_property(_swigfaiss.RangeSearchPartialResult_res_get, _swigfaiss.RangeSearchPartialResult_res_set) - - def __init__(self, res_in): - this = _swigfaiss.new_RangeSearchPartialResult(res_in) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["queries"] = _swigfaiss.RangeSearchPartialResult_queries_set - __swig_getmethods__["queries"] = _swigfaiss.RangeSearchPartialResult_queries_get - if _newclass: - queries = _swig_property(_swigfaiss.RangeSearchPartialResult_queries_get, _swigfaiss.RangeSearchPartialResult_queries_set) - - def new_result(self, qno): - return _swigfaiss.RangeSearchPartialResult_new_result(self, qno) - - def finalize(self): - return _swigfaiss.RangeSearchPartialResult_finalize(self) - - def set_lims(self): - return _swigfaiss.RangeSearchPartialResult_set_lims(self) - - def set_result(self, incremental=False): - return _swigfaiss.RangeSearchPartialResult_set_result(self, incremental) - __swig_destroy__ = _swigfaiss.delete_RangeSearchPartialResult - __del__ = lambda self: None -RangeSearchPartialResult_swigregister = _swigfaiss.RangeSearchPartialResult_swigregister -RangeSearchPartialResult_swigregister(RangeSearchPartialResult) - -class IOReader(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IOReader, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IOReader, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss.IOReader_name_set - __swig_getmethods__["name"] = _swigfaiss.IOReader_name_get - if _newclass: - name = _swig_property(_swigfaiss.IOReader_name_get, _swigfaiss.IOReader_name_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss.IOReader___call__(self, ptr, size, nitems) - - def fileno(self): - return _swigfaiss.IOReader_fileno(self) - __swig_destroy__ = _swigfaiss.delete_IOReader - __del__ = lambda self: None -IOReader_swigregister = _swigfaiss.IOReader_swigregister -IOReader_swigregister(IOReader) - -class IOWriter(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IOWriter, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IOWriter, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss.IOWriter_name_set - __swig_getmethods__["name"] = _swigfaiss.IOWriter_name_get - if _newclass: - name = _swig_property(_swigfaiss.IOWriter_name_get, _swigfaiss.IOWriter_name_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss.IOWriter___call__(self, ptr, size, nitems) - - def fileno(self): - return _swigfaiss.IOWriter_fileno(self) - __swig_destroy__ = _swigfaiss.delete_IOWriter - __del__ = lambda self: None -IOWriter_swigregister = _swigfaiss.IOWriter_swigregister -IOWriter_swigregister(IOWriter) - -class VectorIOReader(IOReader): - __swig_setmethods__ = {} - for _s in [IOReader]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorIOReader, name, value) - __swig_getmethods__ = {} - for _s in [IOReader]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, VectorIOReader, name) - __repr__ = _swig_repr - __swig_setmethods__["data"] = _swigfaiss.VectorIOReader_data_set - __swig_getmethods__["data"] = _swigfaiss.VectorIOReader_data_get - if _newclass: - data = _swig_property(_swigfaiss.VectorIOReader_data_get, _swigfaiss.VectorIOReader_data_set) - __swig_setmethods__["rp"] = _swigfaiss.VectorIOReader_rp_set - __swig_getmethods__["rp"] = _swigfaiss.VectorIOReader_rp_get - if _newclass: - rp = _swig_property(_swigfaiss.VectorIOReader_rp_get, _swigfaiss.VectorIOReader_rp_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss.VectorIOReader___call__(self, ptr, size, nitems) - - def __init__(self): - this = _swigfaiss.new_VectorIOReader() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_VectorIOReader - __del__ = lambda self: None -VectorIOReader_swigregister = _swigfaiss.VectorIOReader_swigregister -VectorIOReader_swigregister(VectorIOReader) - -class VectorIOWriter(IOWriter): - __swig_setmethods__ = {} - for _s in [IOWriter]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorIOWriter, name, value) - __swig_getmethods__ = {} - for _s in [IOWriter]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, VectorIOWriter, name) - __repr__ = _swig_repr - __swig_setmethods__["data"] = _swigfaiss.VectorIOWriter_data_set - __swig_getmethods__["data"] = _swigfaiss.VectorIOWriter_data_get - if _newclass: - data = _swig_property(_swigfaiss.VectorIOWriter_data_get, _swigfaiss.VectorIOWriter_data_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss.VectorIOWriter___call__(self, ptr, size, nitems) - - def __init__(self): - this = _swigfaiss.new_VectorIOWriter() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_VectorIOWriter - __del__ = lambda self: None -VectorIOWriter_swigregister = _swigfaiss.VectorIOWriter_swigregister -VectorIOWriter_swigregister(VectorIOWriter) - -class DistanceComputer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, DistanceComputer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, DistanceComputer, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def set_query(self, x): - return _swigfaiss.DistanceComputer_set_query(self, x) - - def __call__(self, i): - return _swigfaiss.DistanceComputer___call__(self, i) - - def symmetric_dis(self, i, j): - return _swigfaiss.DistanceComputer_symmetric_dis(self, i, j) - __swig_destroy__ = _swigfaiss.delete_DistanceComputer - __del__ = lambda self: None -DistanceComputer_swigregister = _swigfaiss.DistanceComputer_swigregister -DistanceComputer_swigregister(DistanceComputer) - -class InterruptCallback(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InterruptCallback, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InterruptCallback, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def want_interrupt(self): - return _swigfaiss.InterruptCallback_want_interrupt(self) - __swig_destroy__ = _swigfaiss.delete_InterruptCallback - __del__ = lambda self: None - if _newclass: - check = staticmethod(_swigfaiss.InterruptCallback_check) - else: - check = _swigfaiss.InterruptCallback_check - if _newclass: - is_interrupted = staticmethod(_swigfaiss.InterruptCallback_is_interrupted) - else: - is_interrupted = _swigfaiss.InterruptCallback_is_interrupted - if _newclass: - get_period_hint = staticmethod(_swigfaiss.InterruptCallback_get_period_hint) - else: - get_period_hint = _swigfaiss.InterruptCallback_get_period_hint -InterruptCallback_swigregister = _swigfaiss.InterruptCallback_swigregister -InterruptCallback_swigregister(InterruptCallback) - -def InterruptCallback_check(): - return _swigfaiss.InterruptCallback_check() -InterruptCallback_check = _swigfaiss.InterruptCallback_check - -def InterruptCallback_is_interrupted(): - return _swigfaiss.InterruptCallback_is_interrupted() -InterruptCallback_is_interrupted = _swigfaiss.InterruptCallback_is_interrupted - -def InterruptCallback_get_period_hint(flops): - return _swigfaiss.InterruptCallback_get_period_hint(flops) -InterruptCallback_get_period_hint = _swigfaiss.InterruptCallback_get_period_hint - - -def ignore_SIGTTIN(): - return _swigfaiss.ignore_SIGTTIN() -ignore_SIGTTIN = _swigfaiss.ignore_SIGTTIN -class MapLong2Long(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, MapLong2Long, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, MapLong2Long, name) - __repr__ = _swig_repr - __swig_setmethods__["map"] = _swigfaiss.MapLong2Long_map_set - __swig_getmethods__["map"] = _swigfaiss.MapLong2Long_map_get - if _newclass: - map = _swig_property(_swigfaiss.MapLong2Long_map_get, _swigfaiss.MapLong2Long_map_set) - - def add(self, n, keys, vals): - return _swigfaiss.MapLong2Long_add(self, n, keys, vals) - - def search(self, key): - return _swigfaiss.MapLong2Long_search(self, key) - - def search_multiple(self, n, keys, vals): - return _swigfaiss.MapLong2Long_search_multiple(self, n, keys, vals) - - def __init__(self): - this = _swigfaiss.new_MapLong2Long() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss.delete_MapLong2Long - __del__ = lambda self: None -MapLong2Long_swigregister = _swigfaiss.MapLong2Long_swigregister -MapLong2Long_swigregister(MapLong2Long) - -# This file is compatible with both classic and new-style classes. - - diff --git a/python/swigfaiss.swig b/python/swigfaiss.swig index 3e7dd3964..54c6001fb 100644 --- a/python/swigfaiss.swig +++ b/python/swigfaiss.swig @@ -15,11 +15,7 @@ // SWIGPYTHON: Python-specific code // GPU_WRAPPER: also compile interfaces for GPU. -#ifdef GPU_WRAPPER -%module swigfaiss_gpu; -#else %module swigfaiss; -#endif // fbode SWIG fails on warnings, so make them non fatal #pragma SWIG nowarn=321 @@ -328,16 +324,6 @@ int get_num_gpus() %include "gpu/GpuIndexBinaryFlat.h" %include "gpu/GpuDistance.h" -#ifdef SWIGLUA - -/// in Lua, swigfaiss_gpu is known as swigfaiss -%luacode { -local swigfaiss = swigfaiss_gpu -} - -#endif - - #endif diff --git a/python/swigfaiss_gpu.py b/python/swigfaiss_gpu.py deleted file mode 100644 index 1acbfa56a..000000000 --- a/python/swigfaiss_gpu.py +++ /dev/null @@ -1,6951 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 3.0.12 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - -from sys import version_info as _swig_python_version_info -if _swig_python_version_info >= (2, 7, 0): - def swig_import_helper(): - import importlib - pkg = __name__.rpartition('.')[0] - mname = '.'.join((pkg, '_swigfaiss_gpu')).lstrip('.') - try: - return importlib.import_module(mname) - except ImportError: - return importlib.import_module('_swigfaiss_gpu') - _swigfaiss_gpu = swig_import_helper() - del swig_import_helper -elif _swig_python_version_info >= (2, 6, 0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_swigfaiss_gpu', [dirname(__file__)]) - except ImportError: - import _swigfaiss_gpu - return _swigfaiss_gpu - try: - _mod = imp.load_module('_swigfaiss_gpu', fp, pathname, description) - finally: - if fp is not None: - fp.close() - return _mod - _swigfaiss_gpu = swig_import_helper() - del swig_import_helper -else: - import _swigfaiss_gpu -del _swig_python_version_info - -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. - -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ - -def _swig_setattr_nondynamic(self, class_type, name, value, static=1): - if (name == "thisown"): - return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name, None) - if method: - return method(self, value) - if (not static): - if _newclass: - object.__setattr__(self, name, value) - else: - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - - -def _swig_setattr(self, class_type, name, value): - return _swig_setattr_nondynamic(self, class_type, name, value, 0) - - -def _swig_getattr(self, class_type, name): - if (name == "thisown"): - return self.this.own() - method = class_type.__swig_getmethods__.get(name, None) - if method: - return method(self) - raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) - - -def _swig_repr(self): - try: - strthis = "proxy of " + self.this.__repr__() - except __builtin__.Exception: - strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - -try: - _object = object - _newclass = 1 -except __builtin__.Exception: - class _object: - pass - _newclass = 0 - -class FloatVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, FloatVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, FloatVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_FloatVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.FloatVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.FloatVector_clear(self) - - def data(self): - return _swigfaiss_gpu.FloatVector_data(self) - - def size(self): - return _swigfaiss_gpu.FloatVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.FloatVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.FloatVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.FloatVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_FloatVector - __del__ = lambda self: None -FloatVector_swigregister = _swigfaiss_gpu.FloatVector_swigregister -FloatVector_swigregister(FloatVector) - -class DoubleVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_DoubleVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.DoubleVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.DoubleVector_clear(self) - - def data(self): - return _swigfaiss_gpu.DoubleVector_data(self) - - def size(self): - return _swigfaiss_gpu.DoubleVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.DoubleVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.DoubleVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.DoubleVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_DoubleVector - __del__ = lambda self: None -DoubleVector_swigregister = _swigfaiss_gpu.DoubleVector_swigregister -DoubleVector_swigregister(DoubleVector) - -class ByteVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ByteVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ByteVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_ByteVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.ByteVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.ByteVector_clear(self) - - def data(self): - return _swigfaiss_gpu.ByteVector_data(self) - - def size(self): - return _swigfaiss_gpu.ByteVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.ByteVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.ByteVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.ByteVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_ByteVector - __del__ = lambda self: None -ByteVector_swigregister = _swigfaiss_gpu.ByteVector_swigregister -ByteVector_swigregister(ByteVector) - -class CharVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, CharVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, CharVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_CharVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.CharVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.CharVector_clear(self) - - def data(self): - return _swigfaiss_gpu.CharVector_data(self) - - def size(self): - return _swigfaiss_gpu.CharVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.CharVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.CharVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.CharVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_CharVector - __del__ = lambda self: None -CharVector_swigregister = _swigfaiss_gpu.CharVector_swigregister -CharVector_swigregister(CharVector) - -class Uint64Vector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Uint64Vector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Uint64Vector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_Uint64Vector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.Uint64Vector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.Uint64Vector_clear(self) - - def data(self): - return _swigfaiss_gpu.Uint64Vector_data(self) - - def size(self): - return _swigfaiss_gpu.Uint64Vector_size(self) - - def at(self, n): - return _swigfaiss_gpu.Uint64Vector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.Uint64Vector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.Uint64Vector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_Uint64Vector - __del__ = lambda self: None -Uint64Vector_swigregister = _swigfaiss_gpu.Uint64Vector_swigregister -Uint64Vector_swigregister(Uint64Vector) - -class LongVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, LongVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, LongVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_LongVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.LongVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.LongVector_clear(self) - - def data(self): - return _swigfaiss_gpu.LongVector_data(self) - - def size(self): - return _swigfaiss_gpu.LongVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.LongVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.LongVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.LongVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_LongVector - __del__ = lambda self: None -LongVector_swigregister = _swigfaiss_gpu.LongVector_swigregister -LongVector_swigregister(LongVector) - -class IntVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_IntVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.IntVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.IntVector_clear(self) - - def data(self): - return _swigfaiss_gpu.IntVector_data(self) - - def size(self): - return _swigfaiss_gpu.IntVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.IntVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.IntVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.IntVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_IntVector - __del__ = lambda self: None -IntVector_swigregister = _swigfaiss_gpu.IntVector_swigregister -IntVector_swigregister(IntVector) - -class VectorTransformVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorTransformVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VectorTransformVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_VectorTransformVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.VectorTransformVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.VectorTransformVector_clear(self) - - def data(self): - return _swigfaiss_gpu.VectorTransformVector_data(self) - - def size(self): - return _swigfaiss_gpu.VectorTransformVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.VectorTransformVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.VectorTransformVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.VectorTransformVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_VectorTransformVector - __del__ = lambda self: None -VectorTransformVector_swigregister = _swigfaiss_gpu.VectorTransformVector_swigregister -VectorTransformVector_swigregister(VectorTransformVector) - -class OperatingPointVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPointVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPointVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_OperatingPointVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.OperatingPointVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.OperatingPointVector_clear(self) - - def data(self): - return _swigfaiss_gpu.OperatingPointVector_data(self) - - def size(self): - return _swigfaiss_gpu.OperatingPointVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.OperatingPointVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.OperatingPointVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.OperatingPointVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_OperatingPointVector - __del__ = lambda self: None -OperatingPointVector_swigregister = _swigfaiss_gpu.OperatingPointVector_swigregister -OperatingPointVector_swigregister(OperatingPointVector) - -class InvertedListsPtrVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InvertedListsPtrVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InvertedListsPtrVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_InvertedListsPtrVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.InvertedListsPtrVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.InvertedListsPtrVector_clear(self) - - def data(self): - return _swigfaiss_gpu.InvertedListsPtrVector_data(self) - - def size(self): - return _swigfaiss_gpu.InvertedListsPtrVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.InvertedListsPtrVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.InvertedListsPtrVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.InvertedListsPtrVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_InvertedListsPtrVector - __del__ = lambda self: None -InvertedListsPtrVector_swigregister = _swigfaiss_gpu.InvertedListsPtrVector_swigregister -InvertedListsPtrVector_swigregister(InvertedListsPtrVector) - -class FloatVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, FloatVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, FloatVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_FloatVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.FloatVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.FloatVectorVector_clear(self) - - def data(self): - return _swigfaiss_gpu.FloatVectorVector_data(self) - - def size(self): - return _swigfaiss_gpu.FloatVectorVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.FloatVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.FloatVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.FloatVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_FloatVectorVector - __del__ = lambda self: None -FloatVectorVector_swigregister = _swigfaiss_gpu.FloatVectorVector_swigregister -FloatVectorVector_swigregister(FloatVectorVector) - -class ByteVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ByteVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ByteVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_ByteVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.ByteVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.ByteVectorVector_clear(self) - - def data(self): - return _swigfaiss_gpu.ByteVectorVector_data(self) - - def size(self): - return _swigfaiss_gpu.ByteVectorVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.ByteVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.ByteVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.ByteVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_ByteVectorVector - __del__ = lambda self: None -ByteVectorVector_swigregister = _swigfaiss_gpu.ByteVectorVector_swigregister -ByteVectorVector_swigregister(ByteVectorVector) - -class LongVectorVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, LongVectorVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, LongVectorVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_LongVectorVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.LongVectorVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.LongVectorVector_clear(self) - - def data(self): - return _swigfaiss_gpu.LongVectorVector_data(self) - - def size(self): - return _swigfaiss_gpu.LongVectorVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.LongVectorVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.LongVectorVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.LongVectorVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_LongVectorVector - __del__ = lambda self: None -LongVectorVector_swigregister = _swigfaiss_gpu.LongVectorVector_swigregister -LongVectorVector_swigregister(LongVectorVector) - -class GpuResourcesVector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuResourcesVector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GpuResourcesVector, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuResourcesVector() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def push_back(self, arg2): - return _swigfaiss_gpu.GpuResourcesVector_push_back(self, arg2) - - def clear(self): - return _swigfaiss_gpu.GpuResourcesVector_clear(self) - - def data(self): - return _swigfaiss_gpu.GpuResourcesVector_data(self) - - def size(self): - return _swigfaiss_gpu.GpuResourcesVector_size(self) - - def at(self, n): - return _swigfaiss_gpu.GpuResourcesVector_at(self, n) - - def resize(self, n): - return _swigfaiss_gpu.GpuResourcesVector_resize(self, n) - - def swap(self, other): - return _swigfaiss_gpu.GpuResourcesVector_swap(self, other) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuResourcesVector - __del__ = lambda self: None -GpuResourcesVector_swigregister = _swigfaiss_gpu.GpuResourcesVector_swigregister -GpuResourcesVector_swigregister(GpuResourcesVector) - - -def popcount64(x): - return _swigfaiss_gpu.popcount64(x) -popcount64 = _swigfaiss_gpu.popcount64 - -def hammings(a, b, na, nb, nbytespercode, dis): - return _swigfaiss_gpu.hammings(a, b, na, nb, nbytespercode, dis) -hammings = _swigfaiss_gpu.hammings - -def bitvec_print(b, d): - return _swigfaiss_gpu.bitvec_print(b, d) -bitvec_print = _swigfaiss_gpu.bitvec_print - -def fvecs2bitvecs(x, b, d, n): - return _swigfaiss_gpu.fvecs2bitvecs(x, b, d, n) -fvecs2bitvecs = _swigfaiss_gpu.fvecs2bitvecs - -def fvec2bitvec(x, b, d): - return _swigfaiss_gpu.fvec2bitvec(x, b, d) -fvec2bitvec = _swigfaiss_gpu.fvec2bitvec - -def hammings_knn_hc(ha, a, b, nb, ncodes, ordered): - return _swigfaiss_gpu.hammings_knn_hc(ha, a, b, nb, ncodes, ordered) -hammings_knn_hc = _swigfaiss_gpu.hammings_knn_hc - -def hammings_knn(ha, a, b, nb, ncodes, ordered): - return _swigfaiss_gpu.hammings_knn(ha, a, b, nb, ncodes, ordered) -hammings_knn = _swigfaiss_gpu.hammings_knn - -def hammings_knn_mc(a, b, na, nb, k, ncodes, distances, labels): - return _swigfaiss_gpu.hammings_knn_mc(a, b, na, nb, k, ncodes, distances, labels) -hammings_knn_mc = _swigfaiss_gpu.hammings_knn_mc - -def hamming_count_thres(bs1, bs2, n1, n2, ht, ncodes, nptr): - return _swigfaiss_gpu.hamming_count_thres(bs1, bs2, n1, n2, ht, ncodes, nptr) -hamming_count_thres = _swigfaiss_gpu.hamming_count_thres - -def match_hamming_thres(bs1, bs2, n1, n2, ht, ncodes, idx, dis): - return _swigfaiss_gpu.match_hamming_thres(bs1, bs2, n1, n2, ht, ncodes, idx, dis) -match_hamming_thres = _swigfaiss_gpu.match_hamming_thres - -def crosshamming_count_thres(dbs, n, ht, ncodes, nptr): - return _swigfaiss_gpu.crosshamming_count_thres(dbs, n, ht, ncodes, nptr) -crosshamming_count_thres = _swigfaiss_gpu.crosshamming_count_thres -class HammingComputer4(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer4, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer4, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer4_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer4_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer4_a0_get, _swigfaiss_gpu.HammingComputer4_a0_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer4(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a, code_size): - return _swigfaiss_gpu.HammingComputer4_set(self, a, code_size) - - def hamming(self, b): - return _swigfaiss_gpu.HammingComputer4_hamming(self, b) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer4 - __del__ = lambda self: None -HammingComputer4_swigregister = _swigfaiss_gpu.HammingComputer4_swigregister -HammingComputer4_swigregister(HammingComputer4) -cvar = _swigfaiss_gpu.cvar - -class HammingComputer8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer8, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer8_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer8_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer8_a0_get, _swigfaiss_gpu.HammingComputer8_a0_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer8(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a, code_size): - return _swigfaiss_gpu.HammingComputer8_set(self, a, code_size) - - def hamming(self, b): - return _swigfaiss_gpu.HammingComputer8_hamming(self, b) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer8 - __del__ = lambda self: None -HammingComputer8_swigregister = _swigfaiss_gpu.HammingComputer8_swigregister -HammingComputer8_swigregister(HammingComputer8) - -class HammingComputer16(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer16, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer16, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer16_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer16_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer16_a0_get, _swigfaiss_gpu.HammingComputer16_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.HammingComputer16_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.HammingComputer16_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.HammingComputer16_a1_get, _swigfaiss_gpu.HammingComputer16_a1_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer16(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputer16_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputer16_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer16 - __del__ = lambda self: None -HammingComputer16_swigregister = _swigfaiss_gpu.HammingComputer16_swigregister -HammingComputer16_swigregister(HammingComputer16) - -class HammingComputer20(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer20, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer20, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer20_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer20_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer20_a0_get, _swigfaiss_gpu.HammingComputer20_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.HammingComputer20_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.HammingComputer20_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.HammingComputer20_a1_get, _swigfaiss_gpu.HammingComputer20_a1_set) - __swig_setmethods__["a2"] = _swigfaiss_gpu.HammingComputer20_a2_set - __swig_getmethods__["a2"] = _swigfaiss_gpu.HammingComputer20_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss_gpu.HammingComputer20_a2_get, _swigfaiss_gpu.HammingComputer20_a2_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer20(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputer20_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputer20_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer20 - __del__ = lambda self: None -HammingComputer20_swigregister = _swigfaiss_gpu.HammingComputer20_swigregister -HammingComputer20_swigregister(HammingComputer20) - -class HammingComputer32(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer32, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer32, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer32_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer32_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer32_a0_get, _swigfaiss_gpu.HammingComputer32_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.HammingComputer32_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.HammingComputer32_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.HammingComputer32_a1_get, _swigfaiss_gpu.HammingComputer32_a1_set) - __swig_setmethods__["a2"] = _swigfaiss_gpu.HammingComputer32_a2_set - __swig_getmethods__["a2"] = _swigfaiss_gpu.HammingComputer32_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss_gpu.HammingComputer32_a2_get, _swigfaiss_gpu.HammingComputer32_a2_set) - __swig_setmethods__["a3"] = _swigfaiss_gpu.HammingComputer32_a3_set - __swig_getmethods__["a3"] = _swigfaiss_gpu.HammingComputer32_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss_gpu.HammingComputer32_a3_get, _swigfaiss_gpu.HammingComputer32_a3_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer32(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputer32_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputer32_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer32 - __del__ = lambda self: None -HammingComputer32_swigregister = _swigfaiss_gpu.HammingComputer32_swigregister -HammingComputer32_swigregister(HammingComputer32) - -class HammingComputer64(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputer64, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputer64, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.HammingComputer64_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.HammingComputer64_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.HammingComputer64_a0_get, _swigfaiss_gpu.HammingComputer64_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.HammingComputer64_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.HammingComputer64_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.HammingComputer64_a1_get, _swigfaiss_gpu.HammingComputer64_a1_set) - __swig_setmethods__["a2"] = _swigfaiss_gpu.HammingComputer64_a2_set - __swig_getmethods__["a2"] = _swigfaiss_gpu.HammingComputer64_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss_gpu.HammingComputer64_a2_get, _swigfaiss_gpu.HammingComputer64_a2_set) - __swig_setmethods__["a3"] = _swigfaiss_gpu.HammingComputer64_a3_set - __swig_getmethods__["a3"] = _swigfaiss_gpu.HammingComputer64_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss_gpu.HammingComputer64_a3_get, _swigfaiss_gpu.HammingComputer64_a3_set) - __swig_setmethods__["a4"] = _swigfaiss_gpu.HammingComputer64_a4_set - __swig_getmethods__["a4"] = _swigfaiss_gpu.HammingComputer64_a4_get - if _newclass: - a4 = _swig_property(_swigfaiss_gpu.HammingComputer64_a4_get, _swigfaiss_gpu.HammingComputer64_a4_set) - __swig_setmethods__["a5"] = _swigfaiss_gpu.HammingComputer64_a5_set - __swig_getmethods__["a5"] = _swigfaiss_gpu.HammingComputer64_a5_get - if _newclass: - a5 = _swig_property(_swigfaiss_gpu.HammingComputer64_a5_get, _swigfaiss_gpu.HammingComputer64_a5_set) - __swig_setmethods__["a6"] = _swigfaiss_gpu.HammingComputer64_a6_set - __swig_getmethods__["a6"] = _swigfaiss_gpu.HammingComputer64_a6_get - if _newclass: - a6 = _swig_property(_swigfaiss_gpu.HammingComputer64_a6_get, _swigfaiss_gpu.HammingComputer64_a6_set) - __swig_setmethods__["a7"] = _swigfaiss_gpu.HammingComputer64_a7_set - __swig_getmethods__["a7"] = _swigfaiss_gpu.HammingComputer64_a7_get - if _newclass: - a7 = _swig_property(_swigfaiss_gpu.HammingComputer64_a7_get, _swigfaiss_gpu.HammingComputer64_a7_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputer64(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputer64_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputer64_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputer64 - __del__ = lambda self: None -HammingComputer64_swigregister = _swigfaiss_gpu.HammingComputer64_swigregister -HammingComputer64_swigregister(HammingComputer64) - -class HammingComputerDefault(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerDefault, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerDefault, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss_gpu.HammingComputerDefault_a_set - __swig_getmethods__["a"] = _swigfaiss_gpu.HammingComputerDefault_a_get - if _newclass: - a = _swig_property(_swigfaiss_gpu.HammingComputerDefault_a_get, _swigfaiss_gpu.HammingComputerDefault_a_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.HammingComputerDefault_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.HammingComputerDefault_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.HammingComputerDefault_n_get, _swigfaiss_gpu.HammingComputerDefault_n_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputerDefault(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputerDefault_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputerDefault_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputerDefault - __del__ = lambda self: None -HammingComputerDefault_swigregister = _swigfaiss_gpu.HammingComputerDefault_swigregister -HammingComputerDefault_swigregister(HammingComputerDefault) - -class HammingComputerM8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerM8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerM8, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss_gpu.HammingComputerM8_a_set - __swig_getmethods__["a"] = _swigfaiss_gpu.HammingComputerM8_a_get - if _newclass: - a = _swig_property(_swigfaiss_gpu.HammingComputerM8_a_get, _swigfaiss_gpu.HammingComputerM8_a_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.HammingComputerM8_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.HammingComputerM8_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.HammingComputerM8_n_get, _swigfaiss_gpu.HammingComputerM8_n_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputerM8(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a8, code_size): - return _swigfaiss_gpu.HammingComputerM8_set(self, a8, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputerM8_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputerM8 - __del__ = lambda self: None -HammingComputerM8_swigregister = _swigfaiss_gpu.HammingComputerM8_swigregister -HammingComputerM8_swigregister(HammingComputerM8) - -class HammingComputerM4(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HammingComputerM4, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HammingComputerM4, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss_gpu.HammingComputerM4_a_set - __swig_getmethods__["a"] = _swigfaiss_gpu.HammingComputerM4_a_get - if _newclass: - a = _swig_property(_swigfaiss_gpu.HammingComputerM4_a_get, _swigfaiss_gpu.HammingComputerM4_a_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.HammingComputerM4_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.HammingComputerM4_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.HammingComputerM4_n_get, _swigfaiss_gpu.HammingComputerM4_n_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_HammingComputerM4(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, a4, code_size): - return _swigfaiss_gpu.HammingComputerM4_set(self, a4, code_size) - - def hamming(self, b8): - return _swigfaiss_gpu.HammingComputerM4_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_HammingComputerM4 - __del__ = lambda self: None -HammingComputerM4_swigregister = _swigfaiss_gpu.HammingComputerM4_swigregister -HammingComputerM4_swigregister(HammingComputerM4) - - -def generalized_hamming_64(a): - return _swigfaiss_gpu.generalized_hamming_64(a) -generalized_hamming_64 = _swigfaiss_gpu.generalized_hamming_64 -class GenHammingComputer8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer8, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer8_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer8_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.GenHammingComputer8_a0_get, _swigfaiss_gpu.GenHammingComputer8_a0_set) - - def __init__(self, a, code_size): - this = _swigfaiss_gpu.new_GenHammingComputer8(a, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b): - return _swigfaiss_gpu.GenHammingComputer8_hamming(self, b) - __swig_destroy__ = _swigfaiss_gpu.delete_GenHammingComputer8 - __del__ = lambda self: None -GenHammingComputer8_swigregister = _swigfaiss_gpu.GenHammingComputer8_swigregister -GenHammingComputer8_swigregister(GenHammingComputer8) - -class GenHammingComputer16(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer16, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer16, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer16_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer16_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.GenHammingComputer16_a0_get, _swigfaiss_gpu.GenHammingComputer16_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.GenHammingComputer16_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.GenHammingComputer16_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.GenHammingComputer16_a1_get, _swigfaiss_gpu.GenHammingComputer16_a1_set) - - def __init__(self, a8, code_size): - this = _swigfaiss_gpu.new_GenHammingComputer16(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss_gpu.GenHammingComputer16_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_GenHammingComputer16 - __del__ = lambda self: None -GenHammingComputer16_swigregister = _swigfaiss_gpu.GenHammingComputer16_swigregister -GenHammingComputer16_swigregister(GenHammingComputer16) - -class GenHammingComputer32(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputer32, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputer32, name) - __repr__ = _swig_repr - __swig_setmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer32_a0_set - __swig_getmethods__["a0"] = _swigfaiss_gpu.GenHammingComputer32_a0_get - if _newclass: - a0 = _swig_property(_swigfaiss_gpu.GenHammingComputer32_a0_get, _swigfaiss_gpu.GenHammingComputer32_a0_set) - __swig_setmethods__["a1"] = _swigfaiss_gpu.GenHammingComputer32_a1_set - __swig_getmethods__["a1"] = _swigfaiss_gpu.GenHammingComputer32_a1_get - if _newclass: - a1 = _swig_property(_swigfaiss_gpu.GenHammingComputer32_a1_get, _swigfaiss_gpu.GenHammingComputer32_a1_set) - __swig_setmethods__["a2"] = _swigfaiss_gpu.GenHammingComputer32_a2_set - __swig_getmethods__["a2"] = _swigfaiss_gpu.GenHammingComputer32_a2_get - if _newclass: - a2 = _swig_property(_swigfaiss_gpu.GenHammingComputer32_a2_get, _swigfaiss_gpu.GenHammingComputer32_a2_set) - __swig_setmethods__["a3"] = _swigfaiss_gpu.GenHammingComputer32_a3_set - __swig_getmethods__["a3"] = _swigfaiss_gpu.GenHammingComputer32_a3_get - if _newclass: - a3 = _swig_property(_swigfaiss_gpu.GenHammingComputer32_a3_get, _swigfaiss_gpu.GenHammingComputer32_a3_set) - - def __init__(self, a8, code_size): - this = _swigfaiss_gpu.new_GenHammingComputer32(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss_gpu.GenHammingComputer32_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_GenHammingComputer32 - __del__ = lambda self: None -GenHammingComputer32_swigregister = _swigfaiss_gpu.GenHammingComputer32_swigregister -GenHammingComputer32_swigregister(GenHammingComputer32) - -class GenHammingComputerM8(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GenHammingComputerM8, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GenHammingComputerM8, name) - __repr__ = _swig_repr - __swig_setmethods__["a"] = _swigfaiss_gpu.GenHammingComputerM8_a_set - __swig_getmethods__["a"] = _swigfaiss_gpu.GenHammingComputerM8_a_get - if _newclass: - a = _swig_property(_swigfaiss_gpu.GenHammingComputerM8_a_get, _swigfaiss_gpu.GenHammingComputerM8_a_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.GenHammingComputerM8_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.GenHammingComputerM8_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.GenHammingComputerM8_n_get, _swigfaiss_gpu.GenHammingComputerM8_n_set) - - def __init__(self, a8, code_size): - this = _swigfaiss_gpu.new_GenHammingComputerM8(a8, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def hamming(self, b8): - return _swigfaiss_gpu.GenHammingComputerM8_hamming(self, b8) - __swig_destroy__ = _swigfaiss_gpu.delete_GenHammingComputerM8 - __del__ = lambda self: None -GenHammingComputerM8_swigregister = _swigfaiss_gpu.GenHammingComputerM8_swigregister -GenHammingComputerM8_swigregister(GenHammingComputerM8) - - -def generalized_hammings_knn_hc(ha, a, b, nb, code_size, ordered=True): - return _swigfaiss_gpu.generalized_hammings_knn_hc(ha, a, b, nb, code_size, ordered) -generalized_hammings_knn_hc = _swigfaiss_gpu.generalized_hammings_knn_hc - -def get_num_gpus(): - return _swigfaiss_gpu.get_num_gpus() -get_num_gpus = _swigfaiss_gpu.get_num_gpus -class GpuResources(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuResources, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GpuResources, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_destroy__ = _swigfaiss_gpu.delete_GpuResources - __del__ = lambda self: None - - def initializeForDevice(self, device): - return _swigfaiss_gpu.GpuResources_initializeForDevice(self, device) - - def getBlasHandle(self, device): - return _swigfaiss_gpu.GpuResources_getBlasHandle(self, device) - - def getDefaultStream(self, device): - return _swigfaiss_gpu.GpuResources_getDefaultStream(self, device) - - def getAlternateStreams(self, device): - return _swigfaiss_gpu.GpuResources_getAlternateStreams(self, device) - - def getPinnedMemory(self): - return _swigfaiss_gpu.GpuResources_getPinnedMemory(self) - - def getAsyncCopyStream(self, device): - return _swigfaiss_gpu.GpuResources_getAsyncCopyStream(self, device) - - def getBlasHandleCurrentDevice(self): - return _swigfaiss_gpu.GpuResources_getBlasHandleCurrentDevice(self) - - def getDefaultStreamCurrentDevice(self): - return _swigfaiss_gpu.GpuResources_getDefaultStreamCurrentDevice(self) - - def syncDefaultStream(self, device): - return _swigfaiss_gpu.GpuResources_syncDefaultStream(self, device) - - def syncDefaultStreamCurrentDevice(self): - return _swigfaiss_gpu.GpuResources_syncDefaultStreamCurrentDevice(self) - - def getAlternateStreamsCurrentDevice(self): - return _swigfaiss_gpu.GpuResources_getAlternateStreamsCurrentDevice(self) - - def getAsyncCopyStreamCurrentDevice(self): - return _swigfaiss_gpu.GpuResources_getAsyncCopyStreamCurrentDevice(self) -GpuResources_swigregister = _swigfaiss_gpu.GpuResources_swigregister -GpuResources_swigregister(GpuResources) - -class StandardGpuResources(GpuResources): - __swig_setmethods__ = {} - for _s in [GpuResources]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, StandardGpuResources, name, value) - __swig_getmethods__ = {} - for _s in [GpuResources]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, StandardGpuResources, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_StandardGpuResources() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_StandardGpuResources - __del__ = lambda self: None - - def noTempMemory(self): - return _swigfaiss_gpu.StandardGpuResources_noTempMemory(self) - - def setTempMemory(self, size): - return _swigfaiss_gpu.StandardGpuResources_setTempMemory(self, size) - - def setPinnedMemory(self, size): - return _swigfaiss_gpu.StandardGpuResources_setPinnedMemory(self, size) - - def setDefaultStream(self, device, stream): - return _swigfaiss_gpu.StandardGpuResources_setDefaultStream(self, device, stream) - - def setDefaultNullStreamAllDevices(self): - return _swigfaiss_gpu.StandardGpuResources_setDefaultNullStreamAllDevices(self) - - def setCudaMallocWarning(self, b): - return _swigfaiss_gpu.StandardGpuResources_setCudaMallocWarning(self, b) - - def initializeForDevice(self, device): - return _swigfaiss_gpu.StandardGpuResources_initializeForDevice(self, device) - - def getBlasHandle(self, device): - return _swigfaiss_gpu.StandardGpuResources_getBlasHandle(self, device) - - def getDefaultStream(self, device): - return _swigfaiss_gpu.StandardGpuResources_getDefaultStream(self, device) - - def getAlternateStreams(self, device): - return _swigfaiss_gpu.StandardGpuResources_getAlternateStreams(self, device) - - def getPinnedMemory(self): - return _swigfaiss_gpu.StandardGpuResources_getPinnedMemory(self) - - def getAsyncCopyStream(self, device): - return _swigfaiss_gpu.StandardGpuResources_getAsyncCopyStream(self, device) -StandardGpuResources_swigregister = _swigfaiss_gpu.StandardGpuResources_swigregister -StandardGpuResources_swigregister(StandardGpuResources) - - -def getmillisecs(): - return _swigfaiss_gpu.getmillisecs() -getmillisecs = _swigfaiss_gpu.getmillisecs - -def get_mem_usage_kb(): - return _swigfaiss_gpu.get_mem_usage_kb() -get_mem_usage_kb = _swigfaiss_gpu.get_mem_usage_kb -class RandomGenerator(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RandomGenerator, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RandomGenerator, name) - __repr__ = _swig_repr - __swig_setmethods__["mt"] = _swigfaiss_gpu.RandomGenerator_mt_set - __swig_getmethods__["mt"] = _swigfaiss_gpu.RandomGenerator_mt_get - if _newclass: - mt = _swig_property(_swigfaiss_gpu.RandomGenerator_mt_get, _swigfaiss_gpu.RandomGenerator_mt_set) - - def rand_long(self): - return _swigfaiss_gpu.RandomGenerator_rand_long(self) - - def rand_int(self, *args): - return _swigfaiss_gpu.RandomGenerator_rand_int(self, *args) - - def rand_float(self): - return _swigfaiss_gpu.RandomGenerator_rand_float(self) - - def rand_double(self): - return _swigfaiss_gpu.RandomGenerator_rand_double(self) - - def __init__(self, seed=1234): - this = _swigfaiss_gpu.new_RandomGenerator(seed) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_RandomGenerator - __del__ = lambda self: None -RandomGenerator_swigregister = _swigfaiss_gpu.RandomGenerator_swigregister -RandomGenerator_swigregister(RandomGenerator) - - -def float_rand(x, n, seed): - return _swigfaiss_gpu.float_rand(x, n, seed) -float_rand = _swigfaiss_gpu.float_rand - -def float_randn(x, n, seed): - return _swigfaiss_gpu.float_randn(x, n, seed) -float_randn = _swigfaiss_gpu.float_randn - -def long_rand(x, n, seed): - return _swigfaiss_gpu.long_rand(x, n, seed) -long_rand = _swigfaiss_gpu.long_rand - -def byte_rand(x, n, seed): - return _swigfaiss_gpu.byte_rand(x, n, seed) -byte_rand = _swigfaiss_gpu.byte_rand - -def rand_perm(perm, n, seed): - return _swigfaiss_gpu.rand_perm(perm, n, seed) -rand_perm = _swigfaiss_gpu.rand_perm - -def fvec_L2sqr(x, y, d): - return _swigfaiss_gpu.fvec_L2sqr(x, y, d) -fvec_L2sqr = _swigfaiss_gpu.fvec_L2sqr - -def fvec_inner_product(x, y, d): - return _swigfaiss_gpu.fvec_inner_product(x, y, d) -fvec_inner_product = _swigfaiss_gpu.fvec_inner_product - -def imbalance_factor(*args): - return _swigfaiss_gpu.imbalance_factor(*args) -imbalance_factor = _swigfaiss_gpu.imbalance_factor - -def pairwise_L2sqr(d, nq, xq, nb, xb, dis, ldq=-1, ldb=-1, ldd=-1): - return _swigfaiss_gpu.pairwise_L2sqr(d, nq, xq, nb, xb, dis, ldq, ldb, ldd) -pairwise_L2sqr = _swigfaiss_gpu.pairwise_L2sqr - -def fvec_inner_products_ny(ip, x, y, d, ny): - return _swigfaiss_gpu.fvec_inner_products_ny(ip, x, y, d, ny) -fvec_inner_products_ny = _swigfaiss_gpu.fvec_inner_products_ny - -def fvec_L2sqr_ny(dis, x, y, d, ny): - return _swigfaiss_gpu.fvec_L2sqr_ny(dis, x, y, d, ny) -fvec_L2sqr_ny = _swigfaiss_gpu.fvec_L2sqr_ny - -def fvec_norm_L2sqr(x, d): - return _swigfaiss_gpu.fvec_norm_L2sqr(x, d) -fvec_norm_L2sqr = _swigfaiss_gpu.fvec_norm_L2sqr - -def fvec_norms_L2(ip, x, d, nx): - return _swigfaiss_gpu.fvec_norms_L2(ip, x, d, nx) -fvec_norms_L2 = _swigfaiss_gpu.fvec_norms_L2 - -def fvec_norms_L2sqr(ip, x, d, nx): - return _swigfaiss_gpu.fvec_norms_L2sqr(ip, x, d, nx) -fvec_norms_L2sqr = _swigfaiss_gpu.fvec_norms_L2sqr - -def fvec_renorm_L2(d, nx, x): - return _swigfaiss_gpu.fvec_renorm_L2(d, nx, x) -fvec_renorm_L2 = _swigfaiss_gpu.fvec_renorm_L2 - -def inner_product_to_L2sqr(dis, nr1, nr2, n1, n2): - return _swigfaiss_gpu.inner_product_to_L2sqr(dis, nr1, nr2, n1, n2) -inner_product_to_L2sqr = _swigfaiss_gpu.inner_product_to_L2sqr - -def fvec_inner_products_by_idx(ip, x, y, ids, d, nx, ny): - return _swigfaiss_gpu.fvec_inner_products_by_idx(ip, x, y, ids, d, nx, ny) -fvec_inner_products_by_idx = _swigfaiss_gpu.fvec_inner_products_by_idx - -def fvec_L2sqr_by_idx(dis, x, y, ids, d, nx, ny): - return _swigfaiss_gpu.fvec_L2sqr_by_idx(dis, x, y, ids, d, nx, ny) -fvec_L2sqr_by_idx = _swigfaiss_gpu.fvec_L2sqr_by_idx - -def knn_inner_product(x, y, d, nx, ny, res): - return _swigfaiss_gpu.knn_inner_product(x, y, d, nx, ny, res) -knn_inner_product = _swigfaiss_gpu.knn_inner_product - -def knn_L2sqr(x, y, d, nx, ny, res): - return _swigfaiss_gpu.knn_L2sqr(x, y, d, nx, ny, res) -knn_L2sqr = _swigfaiss_gpu.knn_L2sqr - -def knn_L2sqr_base_shift(x, y, d, nx, ny, res, base_shift): - return _swigfaiss_gpu.knn_L2sqr_base_shift(x, y, d, nx, ny, res, base_shift) -knn_L2sqr_base_shift = _swigfaiss_gpu.knn_L2sqr_base_shift - -def knn_inner_products_by_idx(x, y, ids, d, nx, ny, res): - return _swigfaiss_gpu.knn_inner_products_by_idx(x, y, ids, d, nx, ny, res) -knn_inner_products_by_idx = _swigfaiss_gpu.knn_inner_products_by_idx - -def knn_L2sqr_by_idx(x, y, ids, d, nx, ny, res): - return _swigfaiss_gpu.knn_L2sqr_by_idx(x, y, ids, d, nx, ny, res) -knn_L2sqr_by_idx = _swigfaiss_gpu.knn_L2sqr_by_idx - -def range_search_L2sqr(x, y, d, nx, ny, radius, result): - return _swigfaiss_gpu.range_search_L2sqr(x, y, d, nx, ny, radius, result) -range_search_L2sqr = _swigfaiss_gpu.range_search_L2sqr - -def range_search_inner_product(x, y, d, nx, ny, radius, result): - return _swigfaiss_gpu.range_search_inner_product(x, y, d, nx, ny, radius, result) -range_search_inner_product = _swigfaiss_gpu.range_search_inner_product - -def fvec_madd(n, a, bf, b, c): - return _swigfaiss_gpu.fvec_madd(n, a, bf, b, c) -fvec_madd = _swigfaiss_gpu.fvec_madd - -def fvec_madd_and_argmin(n, a, bf, b, c): - return _swigfaiss_gpu.fvec_madd_and_argmin(n, a, bf, b, c) -fvec_madd_and_argmin = _swigfaiss_gpu.fvec_madd_and_argmin - -def reflection(u, x, n, d, nu): - return _swigfaiss_gpu.reflection(u, x, n, d, nu) -reflection = _swigfaiss_gpu.reflection - -def km_update_centroids(x, centroids, assign, d, k, n, k_frozen): - return _swigfaiss_gpu.km_update_centroids(x, centroids, assign, d, k, n, k_frozen) -km_update_centroids = _swigfaiss_gpu.km_update_centroids - -def matrix_qr(m, n, a): - return _swigfaiss_gpu.matrix_qr(m, n, a) -matrix_qr = _swigfaiss_gpu.matrix_qr - -def ranklist_handle_ties(k, idx, dis): - return _swigfaiss_gpu.ranklist_handle_ties(k, idx, dis) -ranklist_handle_ties = _swigfaiss_gpu.ranklist_handle_ties - -def ranklist_intersection_size(k1, v1, k2, v2): - return _swigfaiss_gpu.ranklist_intersection_size(k1, v1, k2, v2) -ranklist_intersection_size = _swigfaiss_gpu.ranklist_intersection_size - -def merge_result_table_with(n, k, I0, D0, I1, D1, keep_min=True, translation=0): - return _swigfaiss_gpu.merge_result_table_with(n, k, I0, D0, I1, D1, keep_min, translation) -merge_result_table_with = _swigfaiss_gpu.merge_result_table_with - -def fvec_argsort(n, vals, perm): - return _swigfaiss_gpu.fvec_argsort(n, vals, perm) -fvec_argsort = _swigfaiss_gpu.fvec_argsort - -def fvec_argsort_parallel(n, vals, perm): - return _swigfaiss_gpu.fvec_argsort_parallel(n, vals, perm) -fvec_argsort_parallel = _swigfaiss_gpu.fvec_argsort_parallel - -def ivec_hist(n, v, vmax, hist): - return _swigfaiss_gpu.ivec_hist(n, v, vmax, hist) -ivec_hist = _swigfaiss_gpu.ivec_hist - -def bincode_hist(n, nbits, codes, hist): - return _swigfaiss_gpu.bincode_hist(n, nbits, codes, hist) -bincode_hist = _swigfaiss_gpu.bincode_hist - -def ivec_checksum(n, a): - return _swigfaiss_gpu.ivec_checksum(n, a) -ivec_checksum = _swigfaiss_gpu.ivec_checksum - -def fvecs_maybe_subsample(d, n, nmax, x, verbose=False, seed=1234): - return _swigfaiss_gpu.fvecs_maybe_subsample(d, n, nmax, x, verbose, seed) -fvecs_maybe_subsample = _swigfaiss_gpu.fvecs_maybe_subsample - -def binary_to_real(d, x_in, x_out): - return _swigfaiss_gpu.binary_to_real(d, x_in, x_out) -binary_to_real = _swigfaiss_gpu.binary_to_real - -def real_to_binary(d, x_in, x_out): - return _swigfaiss_gpu.real_to_binary(d, x_in, x_out) -real_to_binary = _swigfaiss_gpu.real_to_binary - -def hash_bytes(bytes, n): - return _swigfaiss_gpu.hash_bytes(bytes, n) -hash_bytes = _swigfaiss_gpu.hash_bytes - -def check_openmp(): - return _swigfaiss_gpu.check_openmp() -check_openmp = _swigfaiss_gpu.check_openmp -FAISS_VERSION_MAJOR = _swigfaiss_gpu.FAISS_VERSION_MAJOR -FAISS_VERSION_MINOR = _swigfaiss_gpu.FAISS_VERSION_MINOR -FAISS_VERSION_PATCH = _swigfaiss_gpu.FAISS_VERSION_PATCH -METRIC_INNER_PRODUCT = _swigfaiss_gpu.METRIC_INNER_PRODUCT -METRIC_L2 = _swigfaiss_gpu.METRIC_L2 -class Index(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Index, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Index, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss_gpu.Index_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.Index_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.Index_d_get, _swigfaiss_gpu.Index_d_set) - __swig_setmethods__["ntotal"] = _swigfaiss_gpu.Index_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss_gpu.Index_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss_gpu.Index_ntotal_get, _swigfaiss_gpu.Index_ntotal_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.Index_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.Index_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.Index_verbose_get, _swigfaiss_gpu.Index_verbose_set) - __swig_setmethods__["is_trained"] = _swigfaiss_gpu.Index_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss_gpu.Index_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss_gpu.Index_is_trained_get, _swigfaiss_gpu.Index_is_trained_set) - __swig_setmethods__["metric_type"] = _swigfaiss_gpu.Index_metric_type_set - __swig_getmethods__["metric_type"] = _swigfaiss_gpu.Index_metric_type_get - if _newclass: - metric_type = _swig_property(_swigfaiss_gpu.Index_metric_type_get, _swigfaiss_gpu.Index_metric_type_set) - __swig_destroy__ = _swigfaiss_gpu.delete_Index - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss_gpu.Index_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.Index_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.Index_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.Index_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.Index_range_search(self, n, x, radius, result) - - def assign(self, n, x, labels, k=1): - return _swigfaiss_gpu.Index_assign(self, n, x, labels, k) - - def reset(self): - return _swigfaiss_gpu.Index_reset(self) - - def remove_ids(self, sel): - return _swigfaiss_gpu.Index_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.Index_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.Index_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss_gpu.Index_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def compute_residual(self, x, residual, key): - return _swigfaiss_gpu.Index_compute_residual(self, x, residual, key) - - def display(self): - return _swigfaiss_gpu.Index_display(self) -Index_swigregister = _swigfaiss_gpu.Index_swigregister -Index_swigregister(Index) - -class ClusteringParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ClusteringParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ClusteringParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["niter"] = _swigfaiss_gpu.ClusteringParameters_niter_set - __swig_getmethods__["niter"] = _swigfaiss_gpu.ClusteringParameters_niter_get - if _newclass: - niter = _swig_property(_swigfaiss_gpu.ClusteringParameters_niter_get, _swigfaiss_gpu.ClusteringParameters_niter_set) - __swig_setmethods__["nredo"] = _swigfaiss_gpu.ClusteringParameters_nredo_set - __swig_getmethods__["nredo"] = _swigfaiss_gpu.ClusteringParameters_nredo_get - if _newclass: - nredo = _swig_property(_swigfaiss_gpu.ClusteringParameters_nredo_get, _swigfaiss_gpu.ClusteringParameters_nredo_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.ClusteringParameters_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.ClusteringParameters_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.ClusteringParameters_verbose_get, _swigfaiss_gpu.ClusteringParameters_verbose_set) - __swig_setmethods__["spherical"] = _swigfaiss_gpu.ClusteringParameters_spherical_set - __swig_getmethods__["spherical"] = _swigfaiss_gpu.ClusteringParameters_spherical_get - if _newclass: - spherical = _swig_property(_swigfaiss_gpu.ClusteringParameters_spherical_get, _swigfaiss_gpu.ClusteringParameters_spherical_set) - __swig_setmethods__["int_centroids"] = _swigfaiss_gpu.ClusteringParameters_int_centroids_set - __swig_getmethods__["int_centroids"] = _swigfaiss_gpu.ClusteringParameters_int_centroids_get - if _newclass: - int_centroids = _swig_property(_swigfaiss_gpu.ClusteringParameters_int_centroids_get, _swigfaiss_gpu.ClusteringParameters_int_centroids_set) - __swig_setmethods__["update_index"] = _swigfaiss_gpu.ClusteringParameters_update_index_set - __swig_getmethods__["update_index"] = _swigfaiss_gpu.ClusteringParameters_update_index_get - if _newclass: - update_index = _swig_property(_swigfaiss_gpu.ClusteringParameters_update_index_get, _swigfaiss_gpu.ClusteringParameters_update_index_set) - __swig_setmethods__["frozen_centroids"] = _swigfaiss_gpu.ClusteringParameters_frozen_centroids_set - __swig_getmethods__["frozen_centroids"] = _swigfaiss_gpu.ClusteringParameters_frozen_centroids_get - if _newclass: - frozen_centroids = _swig_property(_swigfaiss_gpu.ClusteringParameters_frozen_centroids_get, _swigfaiss_gpu.ClusteringParameters_frozen_centroids_set) - __swig_setmethods__["min_points_per_centroid"] = _swigfaiss_gpu.ClusteringParameters_min_points_per_centroid_set - __swig_getmethods__["min_points_per_centroid"] = _swigfaiss_gpu.ClusteringParameters_min_points_per_centroid_get - if _newclass: - min_points_per_centroid = _swig_property(_swigfaiss_gpu.ClusteringParameters_min_points_per_centroid_get, _swigfaiss_gpu.ClusteringParameters_min_points_per_centroid_set) - __swig_setmethods__["max_points_per_centroid"] = _swigfaiss_gpu.ClusteringParameters_max_points_per_centroid_set - __swig_getmethods__["max_points_per_centroid"] = _swigfaiss_gpu.ClusteringParameters_max_points_per_centroid_get - if _newclass: - max_points_per_centroid = _swig_property(_swigfaiss_gpu.ClusteringParameters_max_points_per_centroid_get, _swigfaiss_gpu.ClusteringParameters_max_points_per_centroid_set) - __swig_setmethods__["seed"] = _swigfaiss_gpu.ClusteringParameters_seed_set - __swig_getmethods__["seed"] = _swigfaiss_gpu.ClusteringParameters_seed_get - if _newclass: - seed = _swig_property(_swigfaiss_gpu.ClusteringParameters_seed_get, _swigfaiss_gpu.ClusteringParameters_seed_set) - - def __init__(self): - this = _swigfaiss_gpu.new_ClusteringParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_ClusteringParameters - __del__ = lambda self: None -ClusteringParameters_swigregister = _swigfaiss_gpu.ClusteringParameters_swigregister -ClusteringParameters_swigregister(ClusteringParameters) - -class Clustering(ClusteringParameters): - __swig_setmethods__ = {} - for _s in [ClusteringParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, Clustering, name, value) - __swig_getmethods__ = {} - for _s in [ClusteringParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, Clustering, name) - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss_gpu.Clustering_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.Clustering_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.Clustering_d_get, _swigfaiss_gpu.Clustering_d_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.Clustering_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.Clustering_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.Clustering_k_get, _swigfaiss_gpu.Clustering_k_set) - __swig_setmethods__["centroids"] = _swigfaiss_gpu.Clustering_centroids_set - __swig_getmethods__["centroids"] = _swigfaiss_gpu.Clustering_centroids_get - if _newclass: - centroids = _swig_property(_swigfaiss_gpu.Clustering_centroids_get, _swigfaiss_gpu.Clustering_centroids_set) - __swig_setmethods__["obj"] = _swigfaiss_gpu.Clustering_obj_set - __swig_getmethods__["obj"] = _swigfaiss_gpu.Clustering_obj_get - if _newclass: - obj = _swig_property(_swigfaiss_gpu.Clustering_obj_get, _swigfaiss_gpu.Clustering_obj_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_Clustering(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x, index): - return _swigfaiss_gpu.Clustering_train(self, n, x, index) - - def post_process_centroids(self): - return _swigfaiss_gpu.Clustering_post_process_centroids(self) - __swig_destroy__ = _swigfaiss_gpu.delete_Clustering - __del__ = lambda self: None -Clustering_swigregister = _swigfaiss_gpu.Clustering_swigregister -Clustering_swigregister(Clustering) - - -def kmeans_clustering(d, n, k, x, centroids): - return _swigfaiss_gpu.kmeans_clustering(d, n, k, x, centroids) -kmeans_clustering = _swigfaiss_gpu.kmeans_clustering -class ProductQuantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ProductQuantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ProductQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss_gpu.ProductQuantizer_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.ProductQuantizer_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.ProductQuantizer_d_get, _swigfaiss_gpu.ProductQuantizer_d_set) - __swig_setmethods__["M"] = _swigfaiss_gpu.ProductQuantizer_M_set - __swig_getmethods__["M"] = _swigfaiss_gpu.ProductQuantizer_M_get - if _newclass: - M = _swig_property(_swigfaiss_gpu.ProductQuantizer_M_get, _swigfaiss_gpu.ProductQuantizer_M_set) - __swig_setmethods__["nbits"] = _swigfaiss_gpu.ProductQuantizer_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss_gpu.ProductQuantizer_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss_gpu.ProductQuantizer_nbits_get, _swigfaiss_gpu.ProductQuantizer_nbits_set) - __swig_setmethods__["dsub"] = _swigfaiss_gpu.ProductQuantizer_dsub_set - __swig_getmethods__["dsub"] = _swigfaiss_gpu.ProductQuantizer_dsub_get - if _newclass: - dsub = _swig_property(_swigfaiss_gpu.ProductQuantizer_dsub_get, _swigfaiss_gpu.ProductQuantizer_dsub_set) - __swig_setmethods__["byte_per_idx"] = _swigfaiss_gpu.ProductQuantizer_byte_per_idx_set - __swig_getmethods__["byte_per_idx"] = _swigfaiss_gpu.ProductQuantizer_byte_per_idx_get - if _newclass: - byte_per_idx = _swig_property(_swigfaiss_gpu.ProductQuantizer_byte_per_idx_get, _swigfaiss_gpu.ProductQuantizer_byte_per_idx_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.ProductQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.ProductQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.ProductQuantizer_code_size_get, _swigfaiss_gpu.ProductQuantizer_code_size_set) - __swig_setmethods__["ksub"] = _swigfaiss_gpu.ProductQuantizer_ksub_set - __swig_getmethods__["ksub"] = _swigfaiss_gpu.ProductQuantizer_ksub_get - if _newclass: - ksub = _swig_property(_swigfaiss_gpu.ProductQuantizer_ksub_get, _swigfaiss_gpu.ProductQuantizer_ksub_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.ProductQuantizer_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.ProductQuantizer_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.ProductQuantizer_verbose_get, _swigfaiss_gpu.ProductQuantizer_verbose_set) - Train_default = _swigfaiss_gpu.ProductQuantizer_Train_default - Train_hot_start = _swigfaiss_gpu.ProductQuantizer_Train_hot_start - Train_shared = _swigfaiss_gpu.ProductQuantizer_Train_shared - Train_hypercube = _swigfaiss_gpu.ProductQuantizer_Train_hypercube - Train_hypercube_pca = _swigfaiss_gpu.ProductQuantizer_Train_hypercube_pca - __swig_setmethods__["train_type"] = _swigfaiss_gpu.ProductQuantizer_train_type_set - __swig_getmethods__["train_type"] = _swigfaiss_gpu.ProductQuantizer_train_type_get - if _newclass: - train_type = _swig_property(_swigfaiss_gpu.ProductQuantizer_train_type_get, _swigfaiss_gpu.ProductQuantizer_train_type_set) - __swig_setmethods__["cp"] = _swigfaiss_gpu.ProductQuantizer_cp_set - __swig_getmethods__["cp"] = _swigfaiss_gpu.ProductQuantizer_cp_get - if _newclass: - cp = _swig_property(_swigfaiss_gpu.ProductQuantizer_cp_get, _swigfaiss_gpu.ProductQuantizer_cp_set) - __swig_setmethods__["assign_index"] = _swigfaiss_gpu.ProductQuantizer_assign_index_set - __swig_getmethods__["assign_index"] = _swigfaiss_gpu.ProductQuantizer_assign_index_get - if _newclass: - assign_index = _swig_property(_swigfaiss_gpu.ProductQuantizer_assign_index_get, _swigfaiss_gpu.ProductQuantizer_assign_index_set) - __swig_setmethods__["centroids"] = _swigfaiss_gpu.ProductQuantizer_centroids_set - __swig_getmethods__["centroids"] = _swigfaiss_gpu.ProductQuantizer_centroids_get - if _newclass: - centroids = _swig_property(_swigfaiss_gpu.ProductQuantizer_centroids_get, _swigfaiss_gpu.ProductQuantizer_centroids_set) - - def get_centroids(self, m, i): - return _swigfaiss_gpu.ProductQuantizer_get_centroids(self, m, i) - - def train(self, n, x): - return _swigfaiss_gpu.ProductQuantizer_train(self, n, x) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_ProductQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set_derived_values(self): - return _swigfaiss_gpu.ProductQuantizer_set_derived_values(self) - - def set_params(self, centroids, m): - return _swigfaiss_gpu.ProductQuantizer_set_params(self, centroids, m) - - def compute_code(self, x, code): - return _swigfaiss_gpu.ProductQuantizer_compute_code(self, x, code) - - def compute_codes(self, x, codes, n): - return _swigfaiss_gpu.ProductQuantizer_compute_codes(self, x, codes, n) - - def compute_codes_with_assign_index(self, x, codes, n): - return _swigfaiss_gpu.ProductQuantizer_compute_codes_with_assign_index(self, x, codes, n) - - def decode(self, *args): - return _swigfaiss_gpu.ProductQuantizer_decode(self, *args) - - def compute_code_from_distance_table(self, tab, code): - return _swigfaiss_gpu.ProductQuantizer_compute_code_from_distance_table(self, tab, code) - - def compute_distance_table(self, x, dis_table): - return _swigfaiss_gpu.ProductQuantizer_compute_distance_table(self, x, dis_table) - - def compute_inner_prod_table(self, x, dis_table): - return _swigfaiss_gpu.ProductQuantizer_compute_inner_prod_table(self, x, dis_table) - - def compute_distance_tables(self, nx, x, dis_tables): - return _swigfaiss_gpu.ProductQuantizer_compute_distance_tables(self, nx, x, dis_tables) - - def compute_inner_prod_tables(self, nx, x, dis_tables): - return _swigfaiss_gpu.ProductQuantizer_compute_inner_prod_tables(self, nx, x, dis_tables) - - def search(self, x, nx, codes, ncodes, res, init_finalize_heap=True): - return _swigfaiss_gpu.ProductQuantizer_search(self, x, nx, codes, ncodes, res, init_finalize_heap) - - def search_ip(self, x, nx, codes, ncodes, res, init_finalize_heap=True): - return _swigfaiss_gpu.ProductQuantizer_search_ip(self, x, nx, codes, ncodes, res, init_finalize_heap) - __swig_setmethods__["sdc_table"] = _swigfaiss_gpu.ProductQuantizer_sdc_table_set - __swig_getmethods__["sdc_table"] = _swigfaiss_gpu.ProductQuantizer_sdc_table_get - if _newclass: - sdc_table = _swig_property(_swigfaiss_gpu.ProductQuantizer_sdc_table_get, _swigfaiss_gpu.ProductQuantizer_sdc_table_set) - - def compute_sdc_table(self): - return _swigfaiss_gpu.ProductQuantizer_compute_sdc_table(self) - - def search_sdc(self, qcodes, nq, bcodes, ncodes, res, init_finalize_heap=True): - return _swigfaiss_gpu.ProductQuantizer_search_sdc(self, qcodes, nq, bcodes, ncodes, res, init_finalize_heap) - __swig_destroy__ = _swigfaiss_gpu.delete_ProductQuantizer - __del__ = lambda self: None -ProductQuantizer_swigregister = _swigfaiss_gpu.ProductQuantizer_swigregister -ProductQuantizer_swigregister(ProductQuantizer) - -class VectorTransform(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorTransform, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VectorTransform, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d_in"] = _swigfaiss_gpu.VectorTransform_d_in_set - __swig_getmethods__["d_in"] = _swigfaiss_gpu.VectorTransform_d_in_get - if _newclass: - d_in = _swig_property(_swigfaiss_gpu.VectorTransform_d_in_get, _swigfaiss_gpu.VectorTransform_d_in_set) - __swig_setmethods__["d_out"] = _swigfaiss_gpu.VectorTransform_d_out_set - __swig_getmethods__["d_out"] = _swigfaiss_gpu.VectorTransform_d_out_get - if _newclass: - d_out = _swig_property(_swigfaiss_gpu.VectorTransform_d_out_get, _swigfaiss_gpu.VectorTransform_d_out_set) - __swig_setmethods__["is_trained"] = _swigfaiss_gpu.VectorTransform_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss_gpu.VectorTransform_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss_gpu.VectorTransform_is_trained_get, _swigfaiss_gpu.VectorTransform_is_trained_set) - - def train(self, n, x): - return _swigfaiss_gpu.VectorTransform_train(self, n, x) - - def apply(self, n, x): - return _swigfaiss_gpu.VectorTransform_apply(self, n, x) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss_gpu.VectorTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss_gpu.VectorTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss_gpu.delete_VectorTransform - __del__ = lambda self: None -VectorTransform_swigregister = _swigfaiss_gpu.VectorTransform_swigregister -VectorTransform_swigregister(VectorTransform) - -class LinearTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, LinearTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, LinearTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["have_bias"] = _swigfaiss_gpu.LinearTransform_have_bias_set - __swig_getmethods__["have_bias"] = _swigfaiss_gpu.LinearTransform_have_bias_get - if _newclass: - have_bias = _swig_property(_swigfaiss_gpu.LinearTransform_have_bias_get, _swigfaiss_gpu.LinearTransform_have_bias_set) - __swig_setmethods__["is_orthonormal"] = _swigfaiss_gpu.LinearTransform_is_orthonormal_set - __swig_getmethods__["is_orthonormal"] = _swigfaiss_gpu.LinearTransform_is_orthonormal_get - if _newclass: - is_orthonormal = _swig_property(_swigfaiss_gpu.LinearTransform_is_orthonormal_get, _swigfaiss_gpu.LinearTransform_is_orthonormal_set) - __swig_setmethods__["A"] = _swigfaiss_gpu.LinearTransform_A_set - __swig_getmethods__["A"] = _swigfaiss_gpu.LinearTransform_A_get - if _newclass: - A = _swig_property(_swigfaiss_gpu.LinearTransform_A_get, _swigfaiss_gpu.LinearTransform_A_set) - __swig_setmethods__["b"] = _swigfaiss_gpu.LinearTransform_b_set - __swig_getmethods__["b"] = _swigfaiss_gpu.LinearTransform_b_get - if _newclass: - b = _swig_property(_swigfaiss_gpu.LinearTransform_b_get, _swigfaiss_gpu.LinearTransform_b_set) - - def __init__(self, d_in=0, d_out=0, have_bias=False): - this = _swigfaiss_gpu.new_LinearTransform(d_in, d_out, have_bias) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def apply_noalloc(self, n, x, xt): - return _swigfaiss_gpu.LinearTransform_apply_noalloc(self, n, x, xt) - - def transform_transpose(self, n, y, x): - return _swigfaiss_gpu.LinearTransform_transform_transpose(self, n, y, x) - - def reverse_transform(self, n, xt, x): - return _swigfaiss_gpu.LinearTransform_reverse_transform(self, n, xt, x) - - def set_is_orthonormal(self): - return _swigfaiss_gpu.LinearTransform_set_is_orthonormal(self) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.LinearTransform_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.LinearTransform_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.LinearTransform_verbose_get, _swigfaiss_gpu.LinearTransform_verbose_set) - __swig_destroy__ = _swigfaiss_gpu.delete_LinearTransform - __del__ = lambda self: None -LinearTransform_swigregister = _swigfaiss_gpu.LinearTransform_swigregister -LinearTransform_swigregister(LinearTransform) - -class RandomRotationMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RandomRotationMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RandomRotationMatrix, name) - __repr__ = _swig_repr - - def init(self, seed): - return _swigfaiss_gpu.RandomRotationMatrix_init(self, seed) - - def train(self, n, x): - return _swigfaiss_gpu.RandomRotationMatrix_train(self, n, x) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_RandomRotationMatrix(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_RandomRotationMatrix - __del__ = lambda self: None -RandomRotationMatrix_swigregister = _swigfaiss_gpu.RandomRotationMatrix_swigregister -RandomRotationMatrix_swigregister(RandomRotationMatrix) - -class PCAMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, PCAMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, PCAMatrix, name) - __repr__ = _swig_repr - __swig_setmethods__["eigen_power"] = _swigfaiss_gpu.PCAMatrix_eigen_power_set - __swig_getmethods__["eigen_power"] = _swigfaiss_gpu.PCAMatrix_eigen_power_get - if _newclass: - eigen_power = _swig_property(_swigfaiss_gpu.PCAMatrix_eigen_power_get, _swigfaiss_gpu.PCAMatrix_eigen_power_set) - __swig_setmethods__["random_rotation"] = _swigfaiss_gpu.PCAMatrix_random_rotation_set - __swig_getmethods__["random_rotation"] = _swigfaiss_gpu.PCAMatrix_random_rotation_get - if _newclass: - random_rotation = _swig_property(_swigfaiss_gpu.PCAMatrix_random_rotation_get, _swigfaiss_gpu.PCAMatrix_random_rotation_set) - __swig_setmethods__["max_points_per_d"] = _swigfaiss_gpu.PCAMatrix_max_points_per_d_set - __swig_getmethods__["max_points_per_d"] = _swigfaiss_gpu.PCAMatrix_max_points_per_d_get - if _newclass: - max_points_per_d = _swig_property(_swigfaiss_gpu.PCAMatrix_max_points_per_d_get, _swigfaiss_gpu.PCAMatrix_max_points_per_d_set) - __swig_setmethods__["balanced_bins"] = _swigfaiss_gpu.PCAMatrix_balanced_bins_set - __swig_getmethods__["balanced_bins"] = _swigfaiss_gpu.PCAMatrix_balanced_bins_get - if _newclass: - balanced_bins = _swig_property(_swigfaiss_gpu.PCAMatrix_balanced_bins_get, _swigfaiss_gpu.PCAMatrix_balanced_bins_set) - __swig_setmethods__["mean"] = _swigfaiss_gpu.PCAMatrix_mean_set - __swig_getmethods__["mean"] = _swigfaiss_gpu.PCAMatrix_mean_get - if _newclass: - mean = _swig_property(_swigfaiss_gpu.PCAMatrix_mean_get, _swigfaiss_gpu.PCAMatrix_mean_set) - __swig_setmethods__["eigenvalues"] = _swigfaiss_gpu.PCAMatrix_eigenvalues_set - __swig_getmethods__["eigenvalues"] = _swigfaiss_gpu.PCAMatrix_eigenvalues_get - if _newclass: - eigenvalues = _swig_property(_swigfaiss_gpu.PCAMatrix_eigenvalues_get, _swigfaiss_gpu.PCAMatrix_eigenvalues_set) - __swig_setmethods__["PCAMat"] = _swigfaiss_gpu.PCAMatrix_PCAMat_set - __swig_getmethods__["PCAMat"] = _swigfaiss_gpu.PCAMatrix_PCAMat_get - if _newclass: - PCAMat = _swig_property(_swigfaiss_gpu.PCAMatrix_PCAMat_get, _swigfaiss_gpu.PCAMatrix_PCAMat_set) - - def __init__(self, d_in=0, d_out=0, eigen_power=0, random_rotation=False): - this = _swigfaiss_gpu.new_PCAMatrix(d_in, d_out, eigen_power, random_rotation) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.PCAMatrix_train(self, n, x) - - def copy_from(self, other): - return _swigfaiss_gpu.PCAMatrix_copy_from(self, other) - - def prepare_Ab(self): - return _swigfaiss_gpu.PCAMatrix_prepare_Ab(self) - __swig_destroy__ = _swigfaiss_gpu.delete_PCAMatrix - __del__ = lambda self: None -PCAMatrix_swigregister = _swigfaiss_gpu.PCAMatrix_swigregister -PCAMatrix_swigregister(PCAMatrix) - -class OPQMatrix(LinearTransform): - __swig_setmethods__ = {} - for _s in [LinearTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OPQMatrix, name, value) - __swig_getmethods__ = {} - for _s in [LinearTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OPQMatrix, name) - __repr__ = _swig_repr - __swig_setmethods__["M"] = _swigfaiss_gpu.OPQMatrix_M_set - __swig_getmethods__["M"] = _swigfaiss_gpu.OPQMatrix_M_get - if _newclass: - M = _swig_property(_swigfaiss_gpu.OPQMatrix_M_get, _swigfaiss_gpu.OPQMatrix_M_set) - __swig_setmethods__["niter"] = _swigfaiss_gpu.OPQMatrix_niter_set - __swig_getmethods__["niter"] = _swigfaiss_gpu.OPQMatrix_niter_get - if _newclass: - niter = _swig_property(_swigfaiss_gpu.OPQMatrix_niter_get, _swigfaiss_gpu.OPQMatrix_niter_set) - __swig_setmethods__["niter_pq"] = _swigfaiss_gpu.OPQMatrix_niter_pq_set - __swig_getmethods__["niter_pq"] = _swigfaiss_gpu.OPQMatrix_niter_pq_get - if _newclass: - niter_pq = _swig_property(_swigfaiss_gpu.OPQMatrix_niter_pq_get, _swigfaiss_gpu.OPQMatrix_niter_pq_set) - __swig_setmethods__["niter_pq_0"] = _swigfaiss_gpu.OPQMatrix_niter_pq_0_set - __swig_getmethods__["niter_pq_0"] = _swigfaiss_gpu.OPQMatrix_niter_pq_0_get - if _newclass: - niter_pq_0 = _swig_property(_swigfaiss_gpu.OPQMatrix_niter_pq_0_get, _swigfaiss_gpu.OPQMatrix_niter_pq_0_set) - __swig_setmethods__["max_train_points"] = _swigfaiss_gpu.OPQMatrix_max_train_points_set - __swig_getmethods__["max_train_points"] = _swigfaiss_gpu.OPQMatrix_max_train_points_get - if _newclass: - max_train_points = _swig_property(_swigfaiss_gpu.OPQMatrix_max_train_points_get, _swigfaiss_gpu.OPQMatrix_max_train_points_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.OPQMatrix_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.OPQMatrix_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.OPQMatrix_verbose_get, _swigfaiss_gpu.OPQMatrix_verbose_set) - __swig_setmethods__["pq"] = _swigfaiss_gpu.OPQMatrix_pq_set - __swig_getmethods__["pq"] = _swigfaiss_gpu.OPQMatrix_pq_get - if _newclass: - pq = _swig_property(_swigfaiss_gpu.OPQMatrix_pq_get, _swigfaiss_gpu.OPQMatrix_pq_set) - - def __init__(self, d=0, M=1, d2=-1): - this = _swigfaiss_gpu.new_OPQMatrix(d, M, d2) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.OPQMatrix_train(self, n, x) - __swig_destroy__ = _swigfaiss_gpu.delete_OPQMatrix - __del__ = lambda self: None -OPQMatrix_swigregister = _swigfaiss_gpu.OPQMatrix_swigregister -OPQMatrix_swigregister(OPQMatrix) - -class RemapDimensionsTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RemapDimensionsTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RemapDimensionsTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["map"] = _swigfaiss_gpu.RemapDimensionsTransform_map_set - __swig_getmethods__["map"] = _swigfaiss_gpu.RemapDimensionsTransform_map_get - if _newclass: - map = _swig_property(_swigfaiss_gpu.RemapDimensionsTransform_map_get, _swigfaiss_gpu.RemapDimensionsTransform_map_set) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss_gpu.RemapDimensionsTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss_gpu.RemapDimensionsTransform_reverse_transform(self, n, xt, x) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_RemapDimensionsTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_RemapDimensionsTransform - __del__ = lambda self: None -RemapDimensionsTransform_swigregister = _swigfaiss_gpu.RemapDimensionsTransform_swigregister -RemapDimensionsTransform_swigregister(RemapDimensionsTransform) - -class NormalizationTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, NormalizationTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, NormalizationTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["norm"] = _swigfaiss_gpu.NormalizationTransform_norm_set - __swig_getmethods__["norm"] = _swigfaiss_gpu.NormalizationTransform_norm_get - if _newclass: - norm = _swig_property(_swigfaiss_gpu.NormalizationTransform_norm_get, _swigfaiss_gpu.NormalizationTransform_norm_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_NormalizationTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def apply_noalloc(self, n, x, xt): - return _swigfaiss_gpu.NormalizationTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss_gpu.NormalizationTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss_gpu.delete_NormalizationTransform - __del__ = lambda self: None -NormalizationTransform_swigregister = _swigfaiss_gpu.NormalizationTransform_swigregister -NormalizationTransform_swigregister(NormalizationTransform) - -class CenteringTransform(VectorTransform): - __swig_setmethods__ = {} - for _s in [VectorTransform]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, CenteringTransform, name, value) - __swig_getmethods__ = {} - for _s in [VectorTransform]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, CenteringTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["mean"] = _swigfaiss_gpu.CenteringTransform_mean_set - __swig_getmethods__["mean"] = _swigfaiss_gpu.CenteringTransform_mean_get - if _newclass: - mean = _swig_property(_swigfaiss_gpu.CenteringTransform_mean_get, _swigfaiss_gpu.CenteringTransform_mean_set) - - def __init__(self, d=0): - this = _swigfaiss_gpu.new_CenteringTransform(d) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.CenteringTransform_train(self, n, x) - - def apply_noalloc(self, n, x, xt): - return _swigfaiss_gpu.CenteringTransform_apply_noalloc(self, n, x, xt) - - def reverse_transform(self, n, xt, x): - return _swigfaiss_gpu.CenteringTransform_reverse_transform(self, n, xt, x) - __swig_destroy__ = _swigfaiss_gpu.delete_CenteringTransform - __del__ = lambda self: None -CenteringTransform_swigregister = _swigfaiss_gpu.CenteringTransform_swigregister -CenteringTransform_swigregister(CenteringTransform) - -class IndexPreTransform(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPreTransform, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexPreTransform, name) - __repr__ = _swig_repr - __swig_setmethods__["chain"] = _swigfaiss_gpu.IndexPreTransform_chain_set - __swig_getmethods__["chain"] = _swigfaiss_gpu.IndexPreTransform_chain_get - if _newclass: - chain = _swig_property(_swigfaiss_gpu.IndexPreTransform_chain_get, _swigfaiss_gpu.IndexPreTransform_chain_set) - __swig_setmethods__["index"] = _swigfaiss_gpu.IndexPreTransform_index_set - __swig_getmethods__["index"] = _swigfaiss_gpu.IndexPreTransform_index_get - if _newclass: - index = _swig_property(_swigfaiss_gpu.IndexPreTransform_index_get, _swigfaiss_gpu.IndexPreTransform_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexPreTransform_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexPreTransform_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexPreTransform_own_fields_get, _swigfaiss_gpu.IndexPreTransform_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexPreTransform(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def prepend_transform(self, ltrans): - return _swigfaiss_gpu.IndexPreTransform_prepend_transform(self, ltrans) - - def train(self, n, x): - return _swigfaiss_gpu.IndexPreTransform_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexPreTransform_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexPreTransform_add_with_ids(self, n, x, xids) - - def reset(self): - return _swigfaiss_gpu.IndexPreTransform_reset(self) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexPreTransform_remove_ids(self, sel) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexPreTransform_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexPreTransform_range_search(self, n, x, radius, result) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexPreTransform_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexPreTransform_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss_gpu.IndexPreTransform_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def apply_chain(self, n, x): - return _swigfaiss_gpu.IndexPreTransform_apply_chain(self, n, x) - - def reverse_chain(self, n, xt, x): - return _swigfaiss_gpu.IndexPreTransform_reverse_chain(self, n, xt, x) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexPreTransform - __del__ = lambda self: None -IndexPreTransform_swigregister = _swigfaiss_gpu.IndexPreTransform_swigregister -IndexPreTransform_swigregister(IndexPreTransform) - -class IndexFlat(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlat, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["xb"] = _swigfaiss_gpu.IndexFlat_xb_set - __swig_getmethods__["xb"] = _swigfaiss_gpu.IndexFlat_xb_get - if _newclass: - xb = _swig_property(_swigfaiss_gpu.IndexFlat_xb_get, _swigfaiss_gpu.IndexFlat_xb_set) - - def add(self, n, x): - return _swigfaiss_gpu.IndexFlat_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexFlat_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexFlat_range_search(self, n, x, radius, result) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexFlat_reconstruct(self, key, recons) - - def compute_distance_subset(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexFlat_compute_distance_subset(self, n, x, k, distances, labels) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexFlat_remove_ids(self, sel) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexFlat - __del__ = lambda self: None -IndexFlat_swigregister = _swigfaiss_gpu.IndexFlat_swigregister -IndexFlat_swigregister(IndexFlat) - -class IndexFlatIP(IndexFlat): - __swig_setmethods__ = {} - for _s in [IndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatIP, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatIP, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexFlatIP(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexFlatIP - __del__ = lambda self: None -IndexFlatIP_swigregister = _swigfaiss_gpu.IndexFlatIP_swigregister -IndexFlatIP_swigregister(IndexFlatIP) - -class IndexFlatL2(IndexFlat): - __swig_setmethods__ = {} - for _s in [IndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatL2, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatL2, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexFlatL2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexFlatL2 - __del__ = lambda self: None -IndexFlatL2_swigregister = _swigfaiss_gpu.IndexFlatL2_swigregister -IndexFlatL2_swigregister(IndexFlatL2) - -class IndexFlatL2BaseShift(IndexFlatL2): - __swig_setmethods__ = {} - for _s in [IndexFlatL2]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlatL2BaseShift, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlatL2]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlatL2BaseShift, name) - __repr__ = _swig_repr - __swig_setmethods__["shift"] = _swigfaiss_gpu.IndexFlatL2BaseShift_shift_set - __swig_getmethods__["shift"] = _swigfaiss_gpu.IndexFlatL2BaseShift_shift_get - if _newclass: - shift = _swig_property(_swigfaiss_gpu.IndexFlatL2BaseShift_shift_get, _swigfaiss_gpu.IndexFlatL2BaseShift_shift_set) - - def __init__(self, d, nshift, shift): - this = _swigfaiss_gpu.new_IndexFlatL2BaseShift(d, nshift, shift) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexFlatL2BaseShift_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexFlatL2BaseShift - __del__ = lambda self: None -IndexFlatL2BaseShift_swigregister = _swigfaiss_gpu.IndexFlatL2BaseShift_swigregister -IndexFlatL2BaseShift_swigregister(IndexFlatL2BaseShift) - -class IndexRefineFlat(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexRefineFlat, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexRefineFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["refine_index"] = _swigfaiss_gpu.IndexRefineFlat_refine_index_set - __swig_getmethods__["refine_index"] = _swigfaiss_gpu.IndexRefineFlat_refine_index_get - if _newclass: - refine_index = _swig_property(_swigfaiss_gpu.IndexRefineFlat_refine_index_get, _swigfaiss_gpu.IndexRefineFlat_refine_index_set) - __swig_setmethods__["base_index"] = _swigfaiss_gpu.IndexRefineFlat_base_index_set - __swig_getmethods__["base_index"] = _swigfaiss_gpu.IndexRefineFlat_base_index_get - if _newclass: - base_index = _swig_property(_swigfaiss_gpu.IndexRefineFlat_base_index_get, _swigfaiss_gpu.IndexRefineFlat_base_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexRefineFlat_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexRefineFlat_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexRefineFlat_own_fields_get, _swigfaiss_gpu.IndexRefineFlat_own_fields_set) - __swig_setmethods__["k_factor"] = _swigfaiss_gpu.IndexRefineFlat_k_factor_set - __swig_getmethods__["k_factor"] = _swigfaiss_gpu.IndexRefineFlat_k_factor_get - if _newclass: - k_factor = _swig_property(_swigfaiss_gpu.IndexRefineFlat_k_factor_get, _swigfaiss_gpu.IndexRefineFlat_k_factor_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexRefineFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.IndexRefineFlat_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexRefineFlat_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexRefineFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexRefineFlat_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexRefineFlat - __del__ = lambda self: None -IndexRefineFlat_swigregister = _swigfaiss_gpu.IndexRefineFlat_swigregister -IndexRefineFlat_swigregister(IndexRefineFlat) - -class IndexFlat1D(IndexFlatL2): - __swig_setmethods__ = {} - for _s in [IndexFlatL2]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexFlat1D, name, value) - __swig_getmethods__ = {} - for _s in [IndexFlatL2]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexFlat1D, name) - __repr__ = _swig_repr - __swig_setmethods__["continuous_update"] = _swigfaiss_gpu.IndexFlat1D_continuous_update_set - __swig_getmethods__["continuous_update"] = _swigfaiss_gpu.IndexFlat1D_continuous_update_get - if _newclass: - continuous_update = _swig_property(_swigfaiss_gpu.IndexFlat1D_continuous_update_get, _swigfaiss_gpu.IndexFlat1D_continuous_update_set) - __swig_setmethods__["perm"] = _swigfaiss_gpu.IndexFlat1D_perm_set - __swig_getmethods__["perm"] = _swigfaiss_gpu.IndexFlat1D_perm_get - if _newclass: - perm = _swig_property(_swigfaiss_gpu.IndexFlat1D_perm_get, _swigfaiss_gpu.IndexFlat1D_perm_set) - - def __init__(self, continuous_update=True): - this = _swigfaiss_gpu.new_IndexFlat1D(continuous_update) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def update_permutation(self): - return _swigfaiss_gpu.IndexFlat1D_update_permutation(self) - - def add(self, n, x): - return _swigfaiss_gpu.IndexFlat1D_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexFlat1D_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexFlat1D_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexFlat1D - __del__ = lambda self: None -IndexFlat1D_swigregister = _swigfaiss_gpu.IndexFlat1D_swigregister -IndexFlat1D_swigregister(IndexFlat1D) - -class IndexLSH(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexLSH, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexLSH, name) - __repr__ = _swig_repr - __swig_setmethods__["nbits"] = _swigfaiss_gpu.IndexLSH_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss_gpu.IndexLSH_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss_gpu.IndexLSH_nbits_get, _swigfaiss_gpu.IndexLSH_nbits_set) - __swig_setmethods__["bytes_per_vec"] = _swigfaiss_gpu.IndexLSH_bytes_per_vec_set - __swig_getmethods__["bytes_per_vec"] = _swigfaiss_gpu.IndexLSH_bytes_per_vec_get - if _newclass: - bytes_per_vec = _swig_property(_swigfaiss_gpu.IndexLSH_bytes_per_vec_get, _swigfaiss_gpu.IndexLSH_bytes_per_vec_set) - __swig_setmethods__["rotate_data"] = _swigfaiss_gpu.IndexLSH_rotate_data_set - __swig_getmethods__["rotate_data"] = _swigfaiss_gpu.IndexLSH_rotate_data_get - if _newclass: - rotate_data = _swig_property(_swigfaiss_gpu.IndexLSH_rotate_data_get, _swigfaiss_gpu.IndexLSH_rotate_data_set) - __swig_setmethods__["train_thresholds"] = _swigfaiss_gpu.IndexLSH_train_thresholds_set - __swig_getmethods__["train_thresholds"] = _swigfaiss_gpu.IndexLSH_train_thresholds_get - if _newclass: - train_thresholds = _swig_property(_swigfaiss_gpu.IndexLSH_train_thresholds_get, _swigfaiss_gpu.IndexLSH_train_thresholds_set) - __swig_setmethods__["rrot"] = _swigfaiss_gpu.IndexLSH_rrot_set - __swig_getmethods__["rrot"] = _swigfaiss_gpu.IndexLSH_rrot_get - if _newclass: - rrot = _swig_property(_swigfaiss_gpu.IndexLSH_rrot_get, _swigfaiss_gpu.IndexLSH_rrot_set) - __swig_setmethods__["thresholds"] = _swigfaiss_gpu.IndexLSH_thresholds_set - __swig_getmethods__["thresholds"] = _swigfaiss_gpu.IndexLSH_thresholds_get - if _newclass: - thresholds = _swig_property(_swigfaiss_gpu.IndexLSH_thresholds_get, _swigfaiss_gpu.IndexLSH_thresholds_set) - __swig_setmethods__["codes"] = _swigfaiss_gpu.IndexLSH_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.IndexLSH_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.IndexLSH_codes_get, _swigfaiss_gpu.IndexLSH_codes_set) - - def apply_preprocess(self, n, x): - return _swigfaiss_gpu.IndexLSH_apply_preprocess(self, n, x) - - def train(self, n, x): - return _swigfaiss_gpu.IndexLSH_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexLSH_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexLSH_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss_gpu.IndexLSH_reset(self) - - def transfer_thresholds(self, vt): - return _swigfaiss_gpu.IndexLSH_transfer_thresholds(self, vt) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexLSH - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexLSH(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexLSH_swigregister = _swigfaiss_gpu.IndexLSH_swigregister -IndexLSH_swigregister(IndexLSH) - -class SimulatedAnnealingParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, SimulatedAnnealingParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, SimulatedAnnealingParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["init_temperature"] = _swigfaiss_gpu.SimulatedAnnealingParameters_init_temperature_set - __swig_getmethods__["init_temperature"] = _swigfaiss_gpu.SimulatedAnnealingParameters_init_temperature_get - if _newclass: - init_temperature = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_init_temperature_get, _swigfaiss_gpu.SimulatedAnnealingParameters_init_temperature_set) - __swig_setmethods__["temperature_decay"] = _swigfaiss_gpu.SimulatedAnnealingParameters_temperature_decay_set - __swig_getmethods__["temperature_decay"] = _swigfaiss_gpu.SimulatedAnnealingParameters_temperature_decay_get - if _newclass: - temperature_decay = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_temperature_decay_get, _swigfaiss_gpu.SimulatedAnnealingParameters_temperature_decay_set) - __swig_setmethods__["n_iter"] = _swigfaiss_gpu.SimulatedAnnealingParameters_n_iter_set - __swig_getmethods__["n_iter"] = _swigfaiss_gpu.SimulatedAnnealingParameters_n_iter_get - if _newclass: - n_iter = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_n_iter_get, _swigfaiss_gpu.SimulatedAnnealingParameters_n_iter_set) - __swig_setmethods__["n_redo"] = _swigfaiss_gpu.SimulatedAnnealingParameters_n_redo_set - __swig_getmethods__["n_redo"] = _swigfaiss_gpu.SimulatedAnnealingParameters_n_redo_get - if _newclass: - n_redo = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_n_redo_get, _swigfaiss_gpu.SimulatedAnnealingParameters_n_redo_set) - __swig_setmethods__["seed"] = _swigfaiss_gpu.SimulatedAnnealingParameters_seed_set - __swig_getmethods__["seed"] = _swigfaiss_gpu.SimulatedAnnealingParameters_seed_get - if _newclass: - seed = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_seed_get, _swigfaiss_gpu.SimulatedAnnealingParameters_seed_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.SimulatedAnnealingParameters_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.SimulatedAnnealingParameters_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_verbose_get, _swigfaiss_gpu.SimulatedAnnealingParameters_verbose_set) - __swig_setmethods__["only_bit_flips"] = _swigfaiss_gpu.SimulatedAnnealingParameters_only_bit_flips_set - __swig_getmethods__["only_bit_flips"] = _swigfaiss_gpu.SimulatedAnnealingParameters_only_bit_flips_get - if _newclass: - only_bit_flips = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_only_bit_flips_get, _swigfaiss_gpu.SimulatedAnnealingParameters_only_bit_flips_set) - __swig_setmethods__["init_random"] = _swigfaiss_gpu.SimulatedAnnealingParameters_init_random_set - __swig_getmethods__["init_random"] = _swigfaiss_gpu.SimulatedAnnealingParameters_init_random_get - if _newclass: - init_random = _swig_property(_swigfaiss_gpu.SimulatedAnnealingParameters_init_random_get, _swigfaiss_gpu.SimulatedAnnealingParameters_init_random_set) - - def __init__(self): - this = _swigfaiss_gpu.new_SimulatedAnnealingParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_SimulatedAnnealingParameters - __del__ = lambda self: None -SimulatedAnnealingParameters_swigregister = _swigfaiss_gpu.SimulatedAnnealingParameters_swigregister -SimulatedAnnealingParameters_swigregister(SimulatedAnnealingParameters) - -class PermutationObjective(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, PermutationObjective, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, PermutationObjective, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["n"] = _swigfaiss_gpu.PermutationObjective_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.PermutationObjective_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.PermutationObjective_n_get, _swigfaiss_gpu.PermutationObjective_n_set) - - def compute_cost(self, perm): - return _swigfaiss_gpu.PermutationObjective_compute_cost(self, perm) - - def cost_update(self, perm, iw, jw): - return _swigfaiss_gpu.PermutationObjective_cost_update(self, perm, iw, jw) - __swig_destroy__ = _swigfaiss_gpu.delete_PermutationObjective - __del__ = lambda self: None -PermutationObjective_swigregister = _swigfaiss_gpu.PermutationObjective_swigregister -PermutationObjective_swigregister(PermutationObjective) - -class ReproduceDistancesObjective(PermutationObjective): - __swig_setmethods__ = {} - for _s in [PermutationObjective]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ReproduceDistancesObjective, name, value) - __swig_getmethods__ = {} - for _s in [PermutationObjective]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ReproduceDistancesObjective, name) - __repr__ = _swig_repr - __swig_setmethods__["dis_weight_factor"] = _swigfaiss_gpu.ReproduceDistancesObjective_dis_weight_factor_set - __swig_getmethods__["dis_weight_factor"] = _swigfaiss_gpu.ReproduceDistancesObjective_dis_weight_factor_get - if _newclass: - dis_weight_factor = _swig_property(_swigfaiss_gpu.ReproduceDistancesObjective_dis_weight_factor_get, _swigfaiss_gpu.ReproduceDistancesObjective_dis_weight_factor_set) - if _newclass: - sqr = staticmethod(_swigfaiss_gpu.ReproduceDistancesObjective_sqr) - else: - sqr = _swigfaiss_gpu.ReproduceDistancesObjective_sqr - - def dis_weight(self, x): - return _swigfaiss_gpu.ReproduceDistancesObjective_dis_weight(self, x) - __swig_setmethods__["source_dis"] = _swigfaiss_gpu.ReproduceDistancesObjective_source_dis_set - __swig_getmethods__["source_dis"] = _swigfaiss_gpu.ReproduceDistancesObjective_source_dis_get - if _newclass: - source_dis = _swig_property(_swigfaiss_gpu.ReproduceDistancesObjective_source_dis_get, _swigfaiss_gpu.ReproduceDistancesObjective_source_dis_set) - __swig_setmethods__["target_dis"] = _swigfaiss_gpu.ReproduceDistancesObjective_target_dis_set - __swig_getmethods__["target_dis"] = _swigfaiss_gpu.ReproduceDistancesObjective_target_dis_get - if _newclass: - target_dis = _swig_property(_swigfaiss_gpu.ReproduceDistancesObjective_target_dis_get, _swigfaiss_gpu.ReproduceDistancesObjective_target_dis_set) - __swig_setmethods__["weights"] = _swigfaiss_gpu.ReproduceDistancesObjective_weights_set - __swig_getmethods__["weights"] = _swigfaiss_gpu.ReproduceDistancesObjective_weights_get - if _newclass: - weights = _swig_property(_swigfaiss_gpu.ReproduceDistancesObjective_weights_get, _swigfaiss_gpu.ReproduceDistancesObjective_weights_set) - - def get_source_dis(self, i, j): - return _swigfaiss_gpu.ReproduceDistancesObjective_get_source_dis(self, i, j) - - def compute_cost(self, perm): - return _swigfaiss_gpu.ReproduceDistancesObjective_compute_cost(self, perm) - - def cost_update(self, perm, iw, jw): - return _swigfaiss_gpu.ReproduceDistancesObjective_cost_update(self, perm, iw, jw) - - def __init__(self, n, source_dis_in, target_dis_in, dis_weight_factor): - this = _swigfaiss_gpu.new_ReproduceDistancesObjective(n, source_dis_in, target_dis_in, dis_weight_factor) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - if _newclass: - compute_mean_stdev = staticmethod(_swigfaiss_gpu.ReproduceDistancesObjective_compute_mean_stdev) - else: - compute_mean_stdev = _swigfaiss_gpu.ReproduceDistancesObjective_compute_mean_stdev - - def set_affine_target_dis(self, source_dis_in): - return _swigfaiss_gpu.ReproduceDistancesObjective_set_affine_target_dis(self, source_dis_in) - __swig_destroy__ = _swigfaiss_gpu.delete_ReproduceDistancesObjective - __del__ = lambda self: None -ReproduceDistancesObjective_swigregister = _swigfaiss_gpu.ReproduceDistancesObjective_swigregister -ReproduceDistancesObjective_swigregister(ReproduceDistancesObjective) - -def ReproduceDistancesObjective_sqr(x): - return _swigfaiss_gpu.ReproduceDistancesObjective_sqr(x) -ReproduceDistancesObjective_sqr = _swigfaiss_gpu.ReproduceDistancesObjective_sqr - -def ReproduceDistancesObjective_compute_mean_stdev(tab, n2, mean_out, stddev_out): - return _swigfaiss_gpu.ReproduceDistancesObjective_compute_mean_stdev(tab, n2, mean_out, stddev_out) -ReproduceDistancesObjective_compute_mean_stdev = _swigfaiss_gpu.ReproduceDistancesObjective_compute_mean_stdev - -class SimulatedAnnealingOptimizer(SimulatedAnnealingParameters): - __swig_setmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, SimulatedAnnealingOptimizer, name, value) - __swig_getmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, SimulatedAnnealingOptimizer, name) - __repr__ = _swig_repr - __swig_setmethods__["obj"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_obj_set - __swig_getmethods__["obj"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_obj_get - if _newclass: - obj = _swig_property(_swigfaiss_gpu.SimulatedAnnealingOptimizer_obj_get, _swigfaiss_gpu.SimulatedAnnealingOptimizer_obj_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.SimulatedAnnealingOptimizer_n_get, _swigfaiss_gpu.SimulatedAnnealingOptimizer_n_set) - __swig_setmethods__["logfile"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_logfile_set - __swig_getmethods__["logfile"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_logfile_get - if _newclass: - logfile = _swig_property(_swigfaiss_gpu.SimulatedAnnealingOptimizer_logfile_get, _swigfaiss_gpu.SimulatedAnnealingOptimizer_logfile_set) - - def __init__(self, obj, p): - this = _swigfaiss_gpu.new_SimulatedAnnealingOptimizer(obj, p) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["rnd"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_rnd_set - __swig_getmethods__["rnd"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_rnd_get - if _newclass: - rnd = _swig_property(_swigfaiss_gpu.SimulatedAnnealingOptimizer_rnd_get, _swigfaiss_gpu.SimulatedAnnealingOptimizer_rnd_set) - __swig_setmethods__["init_cost"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_init_cost_set - __swig_getmethods__["init_cost"] = _swigfaiss_gpu.SimulatedAnnealingOptimizer_init_cost_get - if _newclass: - init_cost = _swig_property(_swigfaiss_gpu.SimulatedAnnealingOptimizer_init_cost_get, _swigfaiss_gpu.SimulatedAnnealingOptimizer_init_cost_set) - - def optimize(self, perm): - return _swigfaiss_gpu.SimulatedAnnealingOptimizer_optimize(self, perm) - - def run_optimization(self, best_perm): - return _swigfaiss_gpu.SimulatedAnnealingOptimizer_run_optimization(self, best_perm) - __swig_destroy__ = _swigfaiss_gpu.delete_SimulatedAnnealingOptimizer - __del__ = lambda self: None -SimulatedAnnealingOptimizer_swigregister = _swigfaiss_gpu.SimulatedAnnealingOptimizer_swigregister -SimulatedAnnealingOptimizer_swigregister(SimulatedAnnealingOptimizer) - -class PolysemousTraining(SimulatedAnnealingParameters): - __swig_setmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, PolysemousTraining, name, value) - __swig_getmethods__ = {} - for _s in [SimulatedAnnealingParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, PolysemousTraining, name) - __repr__ = _swig_repr - OT_None = _swigfaiss_gpu.PolysemousTraining_OT_None - OT_ReproduceDistances_affine = _swigfaiss_gpu.PolysemousTraining_OT_ReproduceDistances_affine - OT_Ranking_weighted_diff = _swigfaiss_gpu.PolysemousTraining_OT_Ranking_weighted_diff - __swig_setmethods__["optimization_type"] = _swigfaiss_gpu.PolysemousTraining_optimization_type_set - __swig_getmethods__["optimization_type"] = _swigfaiss_gpu.PolysemousTraining_optimization_type_get - if _newclass: - optimization_type = _swig_property(_swigfaiss_gpu.PolysemousTraining_optimization_type_get, _swigfaiss_gpu.PolysemousTraining_optimization_type_set) - __swig_setmethods__["ntrain_permutation"] = _swigfaiss_gpu.PolysemousTraining_ntrain_permutation_set - __swig_getmethods__["ntrain_permutation"] = _swigfaiss_gpu.PolysemousTraining_ntrain_permutation_get - if _newclass: - ntrain_permutation = _swig_property(_swigfaiss_gpu.PolysemousTraining_ntrain_permutation_get, _swigfaiss_gpu.PolysemousTraining_ntrain_permutation_set) - __swig_setmethods__["dis_weight_factor"] = _swigfaiss_gpu.PolysemousTraining_dis_weight_factor_set - __swig_getmethods__["dis_weight_factor"] = _swigfaiss_gpu.PolysemousTraining_dis_weight_factor_get - if _newclass: - dis_weight_factor = _swig_property(_swigfaiss_gpu.PolysemousTraining_dis_weight_factor_get, _swigfaiss_gpu.PolysemousTraining_dis_weight_factor_set) - __swig_setmethods__["log_pattern"] = _swigfaiss_gpu.PolysemousTraining_log_pattern_set - __swig_getmethods__["log_pattern"] = _swigfaiss_gpu.PolysemousTraining_log_pattern_get - if _newclass: - log_pattern = _swig_property(_swigfaiss_gpu.PolysemousTraining_log_pattern_get, _swigfaiss_gpu.PolysemousTraining_log_pattern_set) - - def __init__(self): - this = _swigfaiss_gpu.new_PolysemousTraining() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def optimize_pq_for_hamming(self, pq, n, x): - return _swigfaiss_gpu.PolysemousTraining_optimize_pq_for_hamming(self, pq, n, x) - - def optimize_ranking(self, pq, n, x): - return _swigfaiss_gpu.PolysemousTraining_optimize_ranking(self, pq, n, x) - - def optimize_reproduce_distances(self, pq): - return _swigfaiss_gpu.PolysemousTraining_optimize_reproduce_distances(self, pq) - __swig_destroy__ = _swigfaiss_gpu.delete_PolysemousTraining - __del__ = lambda self: None -PolysemousTraining_swigregister = _swigfaiss_gpu.PolysemousTraining_swigregister -PolysemousTraining_swigregister(PolysemousTraining) - -class IndexPQ(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPQ, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexPQ, name) - __repr__ = _swig_repr - __swig_setmethods__["pq"] = _swigfaiss_gpu.IndexPQ_pq_set - __swig_getmethods__["pq"] = _swigfaiss_gpu.IndexPQ_pq_get - if _newclass: - pq = _swig_property(_swigfaiss_gpu.IndexPQ_pq_get, _swigfaiss_gpu.IndexPQ_pq_set) - __swig_setmethods__["codes"] = _swigfaiss_gpu.IndexPQ_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.IndexPQ_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.IndexPQ_codes_get, _swigfaiss_gpu.IndexPQ_codes_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.IndexPQ_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexPQ_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexPQ_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss_gpu.IndexPQ_reset(self) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexPQ_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexPQ_reconstruct(self, key, recons) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexPQ_remove_ids(self, sel) - __swig_setmethods__["do_polysemous_training"] = _swigfaiss_gpu.IndexPQ_do_polysemous_training_set - __swig_getmethods__["do_polysemous_training"] = _swigfaiss_gpu.IndexPQ_do_polysemous_training_get - if _newclass: - do_polysemous_training = _swig_property(_swigfaiss_gpu.IndexPQ_do_polysemous_training_get, _swigfaiss_gpu.IndexPQ_do_polysemous_training_set) - __swig_setmethods__["polysemous_training"] = _swigfaiss_gpu.IndexPQ_polysemous_training_set - __swig_getmethods__["polysemous_training"] = _swigfaiss_gpu.IndexPQ_polysemous_training_get - if _newclass: - polysemous_training = _swig_property(_swigfaiss_gpu.IndexPQ_polysemous_training_get, _swigfaiss_gpu.IndexPQ_polysemous_training_set) - ST_PQ = _swigfaiss_gpu.IndexPQ_ST_PQ - ST_HE = _swigfaiss_gpu.IndexPQ_ST_HE - ST_generalized_HE = _swigfaiss_gpu.IndexPQ_ST_generalized_HE - ST_SDC = _swigfaiss_gpu.IndexPQ_ST_SDC - ST_polysemous = _swigfaiss_gpu.IndexPQ_ST_polysemous - ST_polysemous_generalize = _swigfaiss_gpu.IndexPQ_ST_polysemous_generalize - __swig_setmethods__["search_type"] = _swigfaiss_gpu.IndexPQ_search_type_set - __swig_getmethods__["search_type"] = _swigfaiss_gpu.IndexPQ_search_type_get - if _newclass: - search_type = _swig_property(_swigfaiss_gpu.IndexPQ_search_type_get, _swigfaiss_gpu.IndexPQ_search_type_set) - __swig_setmethods__["encode_signs"] = _swigfaiss_gpu.IndexPQ_encode_signs_set - __swig_getmethods__["encode_signs"] = _swigfaiss_gpu.IndexPQ_encode_signs_get - if _newclass: - encode_signs = _swig_property(_swigfaiss_gpu.IndexPQ_encode_signs_get, _swigfaiss_gpu.IndexPQ_encode_signs_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss_gpu.IndexPQ_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss_gpu.IndexPQ_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss_gpu.IndexPQ_polysemous_ht_get, _swigfaiss_gpu.IndexPQ_polysemous_ht_set) - - def search_core_polysemous(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexPQ_search_core_polysemous(self, n, x, k, distances, labels) - - def hamming_distance_histogram(self, n, x, nb, xb, dist_histogram): - return _swigfaiss_gpu.IndexPQ_hamming_distance_histogram(self, n, x, nb, xb, dist_histogram) - - def hamming_distance_table(self, n, x, dis): - return _swigfaiss_gpu.IndexPQ_hamming_distance_table(self, n, x, dis) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexPQ - __del__ = lambda self: None -IndexPQ_swigregister = _swigfaiss_gpu.IndexPQ_swigregister -IndexPQ_swigregister(IndexPQ) - -class IndexPQStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexPQStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexPQStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss_gpu.IndexPQStats_nq_set - __swig_getmethods__["nq"] = _swigfaiss_gpu.IndexPQStats_nq_get - if _newclass: - nq = _swig_property(_swigfaiss_gpu.IndexPQStats_nq_get, _swigfaiss_gpu.IndexPQStats_nq_set) - __swig_setmethods__["ncode"] = _swigfaiss_gpu.IndexPQStats_ncode_set - __swig_getmethods__["ncode"] = _swigfaiss_gpu.IndexPQStats_ncode_get - if _newclass: - ncode = _swig_property(_swigfaiss_gpu.IndexPQStats_ncode_get, _swigfaiss_gpu.IndexPQStats_ncode_set) - __swig_setmethods__["n_hamming_pass"] = _swigfaiss_gpu.IndexPQStats_n_hamming_pass_set - __swig_getmethods__["n_hamming_pass"] = _swigfaiss_gpu.IndexPQStats_n_hamming_pass_get - if _newclass: - n_hamming_pass = _swig_property(_swigfaiss_gpu.IndexPQStats_n_hamming_pass_get, _swigfaiss_gpu.IndexPQStats_n_hamming_pass_set) - - def __init__(self): - this = _swigfaiss_gpu.new_IndexPQStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss_gpu.IndexPQStats_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexPQStats - __del__ = lambda self: None -IndexPQStats_swigregister = _swigfaiss_gpu.IndexPQStats_swigregister -IndexPQStats_swigregister(IndexPQStats) - -class MultiIndexQuantizer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, MultiIndexQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, MultiIndexQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["pq"] = _swigfaiss_gpu.MultiIndexQuantizer_pq_set - __swig_getmethods__["pq"] = _swigfaiss_gpu.MultiIndexQuantizer_pq_get - if _newclass: - pq = _swig_property(_swigfaiss_gpu.MultiIndexQuantizer_pq_get, _swigfaiss_gpu.MultiIndexQuantizer_pq_set) - - def train(self, n, x): - return _swigfaiss_gpu.MultiIndexQuantizer_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.MultiIndexQuantizer_search(self, n, x, k, distances, labels) - - def add(self, n, x): - return _swigfaiss_gpu.MultiIndexQuantizer_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.MultiIndexQuantizer_reset(self) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_MultiIndexQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.MultiIndexQuantizer_reconstruct(self, key, recons) - __swig_destroy__ = _swigfaiss_gpu.delete_MultiIndexQuantizer - __del__ = lambda self: None -MultiIndexQuantizer_swigregister = _swigfaiss_gpu.MultiIndexQuantizer_swigregister -MultiIndexQuantizer_swigregister(MultiIndexQuantizer) - -class MultiIndexQuantizer2(MultiIndexQuantizer): - __swig_setmethods__ = {} - for _s in [MultiIndexQuantizer]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, MultiIndexQuantizer2, name, value) - __swig_getmethods__ = {} - for _s in [MultiIndexQuantizer]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, MultiIndexQuantizer2, name) - __repr__ = _swig_repr - __swig_setmethods__["assign_indexes"] = _swigfaiss_gpu.MultiIndexQuantizer2_assign_indexes_set - __swig_getmethods__["assign_indexes"] = _swigfaiss_gpu.MultiIndexQuantizer2_assign_indexes_get - if _newclass: - assign_indexes = _swig_property(_swigfaiss_gpu.MultiIndexQuantizer2_assign_indexes_get, _swigfaiss_gpu.MultiIndexQuantizer2_assign_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.MultiIndexQuantizer2_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.MultiIndexQuantizer2_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.MultiIndexQuantizer2_own_fields_get, _swigfaiss_gpu.MultiIndexQuantizer2_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_MultiIndexQuantizer2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.MultiIndexQuantizer2_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.MultiIndexQuantizer2_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_MultiIndexQuantizer2 - __del__ = lambda self: None -MultiIndexQuantizer2_swigregister = _swigfaiss_gpu.MultiIndexQuantizer2_swigregister -MultiIndexQuantizer2_swigregister(MultiIndexQuantizer2) - -class InvertedLists(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InvertedLists, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InvertedLists, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["nlist"] = _swigfaiss_gpu.InvertedLists_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss_gpu.InvertedLists_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss_gpu.InvertedLists_nlist_get, _swigfaiss_gpu.InvertedLists_nlist_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.InvertedLists_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.InvertedLists_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.InvertedLists_code_size_get, _swigfaiss_gpu.InvertedLists_code_size_set) - - def list_size(self, list_no): - return _swigfaiss_gpu.InvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss_gpu.InvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss_gpu.InvertedLists_get_ids(self, list_no) - - def release_codes(self, codes): - return _swigfaiss_gpu.InvertedLists_release_codes(self, codes) - - def release_ids(self, ids): - return _swigfaiss_gpu.InvertedLists_release_ids(self, ids) - - def get_single_id(self, list_no, offset): - return _swigfaiss_gpu.InvertedLists_get_single_id(self, list_no, offset) - - def get_single_code(self, list_no, offset): - return _swigfaiss_gpu.InvertedLists_get_single_code(self, list_no, offset) - - def prefetch_lists(self, list_nos, nlist): - return _swigfaiss_gpu.InvertedLists_prefetch_lists(self, list_nos, nlist) - - def add_entry(self, list_no, theid, code): - return _swigfaiss_gpu.InvertedLists_add_entry(self, list_no, theid, code) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss_gpu.InvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entry(self, list_no, offset, id, code): - return _swigfaiss_gpu.InvertedLists_update_entry(self, list_no, offset, id, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss_gpu.InvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss_gpu.InvertedLists_resize(self, list_no, new_size) - - def reset(self): - return _swigfaiss_gpu.InvertedLists_reset(self) - - def merge_from(self, oivf, add_id): - return _swigfaiss_gpu.InvertedLists_merge_from(self, oivf, add_id) - __swig_destroy__ = _swigfaiss_gpu.delete_InvertedLists - __del__ = lambda self: None - - def imbalance_factor(self): - return _swigfaiss_gpu.InvertedLists_imbalance_factor(self) - - def print_stats(self): - return _swigfaiss_gpu.InvertedLists_print_stats(self) -InvertedLists_swigregister = _swigfaiss_gpu.InvertedLists_swigregister -InvertedLists_swigregister(InvertedLists) - -class ArrayInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ArrayInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ArrayInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["codes"] = _swigfaiss_gpu.ArrayInvertedLists_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.ArrayInvertedLists_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.ArrayInvertedLists_codes_get, _swigfaiss_gpu.ArrayInvertedLists_codes_set) - __swig_setmethods__["ids"] = _swigfaiss_gpu.ArrayInvertedLists_ids_set - __swig_getmethods__["ids"] = _swigfaiss_gpu.ArrayInvertedLists_ids_get - if _newclass: - ids = _swig_property(_swigfaiss_gpu.ArrayInvertedLists_ids_get, _swigfaiss_gpu.ArrayInvertedLists_ids_set) - - def __init__(self, nlist, code_size): - this = _swigfaiss_gpu.new_ArrayInvertedLists(nlist, code_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def list_size(self, list_no): - return _swigfaiss_gpu.ArrayInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss_gpu.ArrayInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss_gpu.ArrayInvertedLists_get_ids(self, list_no) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss_gpu.ArrayInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss_gpu.ArrayInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss_gpu.ArrayInvertedLists_resize(self, list_no, new_size) - __swig_destroy__ = _swigfaiss_gpu.delete_ArrayInvertedLists - __del__ = lambda self: None -ArrayInvertedLists_swigregister = _swigfaiss_gpu.ArrayInvertedLists_swigregister -ArrayInvertedLists_swigregister(ArrayInvertedLists) - -class ConcatenatedInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, ConcatenatedInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, ConcatenatedInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["ils"] = _swigfaiss_gpu.ConcatenatedInvertedLists_ils_set - __swig_getmethods__["ils"] = _swigfaiss_gpu.ConcatenatedInvertedLists_ils_get - if _newclass: - ils = _swig_property(_swigfaiss_gpu.ConcatenatedInvertedLists_ils_get, _swigfaiss_gpu.ConcatenatedInvertedLists_ils_set) - - def __init__(self, nil, ils): - this = _swigfaiss_gpu.new_ConcatenatedInvertedLists(nil, ils) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def list_size(self, list_no): - return _swigfaiss_gpu.ConcatenatedInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss_gpu.ConcatenatedInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss_gpu.ConcatenatedInvertedLists_get_ids(self, list_no) - - def release_codes(self, codes): - return _swigfaiss_gpu.ConcatenatedInvertedLists_release_codes(self, codes) - - def release_ids(self, ids): - return _swigfaiss_gpu.ConcatenatedInvertedLists_release_ids(self, ids) - - def get_single_id(self, list_no, offset): - return _swigfaiss_gpu.ConcatenatedInvertedLists_get_single_id(self, list_no, offset) - - def get_single_code(self, list_no, offset): - return _swigfaiss_gpu.ConcatenatedInvertedLists_get_single_code(self, list_no, offset) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss_gpu.ConcatenatedInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss_gpu.ConcatenatedInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss_gpu.ConcatenatedInvertedLists_resize(self, list_no, new_size) - __swig_destroy__ = _swigfaiss_gpu.delete_ConcatenatedInvertedLists - __del__ = lambda self: None -ConcatenatedInvertedLists_swigregister = _swigfaiss_gpu.ConcatenatedInvertedLists_swigregister -ConcatenatedInvertedLists_swigregister(ConcatenatedInvertedLists) - -class Level1Quantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Level1Quantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Level1Quantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["quantizer"] = _swigfaiss_gpu.Level1Quantizer_quantizer_set - __swig_getmethods__["quantizer"] = _swigfaiss_gpu.Level1Quantizer_quantizer_get - if _newclass: - quantizer = _swig_property(_swigfaiss_gpu.Level1Quantizer_quantizer_get, _swigfaiss_gpu.Level1Quantizer_quantizer_set) - __swig_setmethods__["nlist"] = _swigfaiss_gpu.Level1Quantizer_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss_gpu.Level1Quantizer_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss_gpu.Level1Quantizer_nlist_get, _swigfaiss_gpu.Level1Quantizer_nlist_set) - __swig_setmethods__["quantizer_trains_alone"] = _swigfaiss_gpu.Level1Quantizer_quantizer_trains_alone_set - __swig_getmethods__["quantizer_trains_alone"] = _swigfaiss_gpu.Level1Quantizer_quantizer_trains_alone_get - if _newclass: - quantizer_trains_alone = _swig_property(_swigfaiss_gpu.Level1Quantizer_quantizer_trains_alone_get, _swigfaiss_gpu.Level1Quantizer_quantizer_trains_alone_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.Level1Quantizer_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.Level1Quantizer_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.Level1Quantizer_own_fields_get, _swigfaiss_gpu.Level1Quantizer_own_fields_set) - __swig_setmethods__["cp"] = _swigfaiss_gpu.Level1Quantizer_cp_set - __swig_getmethods__["cp"] = _swigfaiss_gpu.Level1Quantizer_cp_get - if _newclass: - cp = _swig_property(_swigfaiss_gpu.Level1Quantizer_cp_get, _swigfaiss_gpu.Level1Quantizer_cp_set) - __swig_setmethods__["clustering_index"] = _swigfaiss_gpu.Level1Quantizer_clustering_index_set - __swig_getmethods__["clustering_index"] = _swigfaiss_gpu.Level1Quantizer_clustering_index_get - if _newclass: - clustering_index = _swig_property(_swigfaiss_gpu.Level1Quantizer_clustering_index_get, _swigfaiss_gpu.Level1Quantizer_clustering_index_set) - - def train_q1(self, n, x, verbose, metric_type): - return _swigfaiss_gpu.Level1Quantizer_train_q1(self, n, x, verbose, metric_type) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_Level1Quantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_Level1Quantizer - __del__ = lambda self: None -Level1Quantizer_swigregister = _swigfaiss_gpu.Level1Quantizer_swigregister -Level1Quantizer_swigregister(Level1Quantizer) - -class IVFSearchParameters(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IVFSearchParameters, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IVFSearchParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["nprobe"] = _swigfaiss_gpu.IVFSearchParameters_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss_gpu.IVFSearchParameters_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss_gpu.IVFSearchParameters_nprobe_get, _swigfaiss_gpu.IVFSearchParameters_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss_gpu.IVFSearchParameters_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss_gpu.IVFSearchParameters_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss_gpu.IVFSearchParameters_max_codes_get, _swigfaiss_gpu.IVFSearchParameters_max_codes_set) - __swig_destroy__ = _swigfaiss_gpu.delete_IVFSearchParameters - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss_gpu.new_IVFSearchParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IVFSearchParameters_swigregister = _swigfaiss_gpu.IVFSearchParameters_swigregister -IVFSearchParameters_swigregister(IVFSearchParameters) - -class IndexIVF(Index, Level1Quantizer): - __swig_setmethods__ = {} - for _s in [Index, Level1Quantizer]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVF, name, value) - __swig_getmethods__ = {} - for _s in [Index, Level1Quantizer]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVF, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["invlists"] = _swigfaiss_gpu.IndexIVF_invlists_set - __swig_getmethods__["invlists"] = _swigfaiss_gpu.IndexIVF_invlists_get - if _newclass: - invlists = _swig_property(_swigfaiss_gpu.IndexIVF_invlists_get, _swigfaiss_gpu.IndexIVF_invlists_set) - __swig_setmethods__["own_invlists"] = _swigfaiss_gpu.IndexIVF_own_invlists_set - __swig_getmethods__["own_invlists"] = _swigfaiss_gpu.IndexIVF_own_invlists_get - if _newclass: - own_invlists = _swig_property(_swigfaiss_gpu.IndexIVF_own_invlists_get, _swigfaiss_gpu.IndexIVF_own_invlists_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.IndexIVF_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.IndexIVF_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.IndexIVF_code_size_get, _swigfaiss_gpu.IndexIVF_code_size_set) - __swig_setmethods__["nprobe"] = _swigfaiss_gpu.IndexIVF_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss_gpu.IndexIVF_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss_gpu.IndexIVF_nprobe_get, _swigfaiss_gpu.IndexIVF_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss_gpu.IndexIVF_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss_gpu.IndexIVF_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss_gpu.IndexIVF_max_codes_get, _swigfaiss_gpu.IndexIVF_max_codes_set) - __swig_setmethods__["maintain_direct_map"] = _swigfaiss_gpu.IndexIVF_maintain_direct_map_set - __swig_getmethods__["maintain_direct_map"] = _swigfaiss_gpu.IndexIVF_maintain_direct_map_get - if _newclass: - maintain_direct_map = _swig_property(_swigfaiss_gpu.IndexIVF_maintain_direct_map_get, _swigfaiss_gpu.IndexIVF_maintain_direct_map_set) - __swig_setmethods__["direct_map"] = _swigfaiss_gpu.IndexIVF_direct_map_set - __swig_getmethods__["direct_map"] = _swigfaiss_gpu.IndexIVF_direct_map_get - if _newclass: - direct_map = _swig_property(_swigfaiss_gpu.IndexIVF_direct_map_get, _swigfaiss_gpu.IndexIVF_direct_map_set) - - def reset(self): - return _swigfaiss_gpu.IndexIVF_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.IndexIVF_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexIVF_add(self, n, x) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss_gpu.IndexIVF_encode_vectors(self, n, x, list_nos, codes) - - def train_residual(self, n, x): - return _swigfaiss_gpu.IndexIVF_train_residual(self, n, x) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss_gpu.IndexIVF_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexIVF_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexIVF_range_search(self, n, x, radius, result) - - def get_InvertedListScanner(self, store_pairs=False): - return _swigfaiss_gpu.IndexIVF_get_InvertedListScanner(self, store_pairs) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexIVF_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexIVF_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss_gpu.IndexIVF_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVF_reconstruct_from_offset(self, list_no, offset, recons) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexIVF_remove_ids(self, sel) - - def check_compatible_for_merge(self, other): - return _swigfaiss_gpu.IndexIVF_check_compatible_for_merge(self, other) - - def merge_from(self, other, add_id): - return _swigfaiss_gpu.IndexIVF_merge_from(self, other, add_id) - - def copy_subset_to(self, other, subset_type, a1, a2): - return _swigfaiss_gpu.IndexIVF_copy_subset_to(self, other, subset_type, a1, a2) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVF - __del__ = lambda self: None - - def get_list_size(self, list_no): - return _swigfaiss_gpu.IndexIVF_get_list_size(self, list_no) - - def make_direct_map(self, new_maintain_direct_map=True): - return _swigfaiss_gpu.IndexIVF_make_direct_map(self, new_maintain_direct_map) - - def replace_invlists(self, il, own=False): - return _swigfaiss_gpu.IndexIVF_replace_invlists(self, il, own) -IndexIVF_swigregister = _swigfaiss_gpu.IndexIVF_swigregister -IndexIVF_swigregister(IndexIVF) - -class IndexIVFStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss_gpu.IndexIVFStats_nq_set - __swig_getmethods__["nq"] = _swigfaiss_gpu.IndexIVFStats_nq_get - if _newclass: - nq = _swig_property(_swigfaiss_gpu.IndexIVFStats_nq_get, _swigfaiss_gpu.IndexIVFStats_nq_set) - __swig_setmethods__["nlist"] = _swigfaiss_gpu.IndexIVFStats_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss_gpu.IndexIVFStats_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss_gpu.IndexIVFStats_nlist_get, _swigfaiss_gpu.IndexIVFStats_nlist_set) - __swig_setmethods__["ndis"] = _swigfaiss_gpu.IndexIVFStats_ndis_set - __swig_getmethods__["ndis"] = _swigfaiss_gpu.IndexIVFStats_ndis_get - if _newclass: - ndis = _swig_property(_swigfaiss_gpu.IndexIVFStats_ndis_get, _swigfaiss_gpu.IndexIVFStats_ndis_set) - __swig_setmethods__["nheap_updates"] = _swigfaiss_gpu.IndexIVFStats_nheap_updates_set - __swig_getmethods__["nheap_updates"] = _swigfaiss_gpu.IndexIVFStats_nheap_updates_get - if _newclass: - nheap_updates = _swig_property(_swigfaiss_gpu.IndexIVFStats_nheap_updates_get, _swigfaiss_gpu.IndexIVFStats_nheap_updates_set) - __swig_setmethods__["quantization_time"] = _swigfaiss_gpu.IndexIVFStats_quantization_time_set - __swig_getmethods__["quantization_time"] = _swigfaiss_gpu.IndexIVFStats_quantization_time_get - if _newclass: - quantization_time = _swig_property(_swigfaiss_gpu.IndexIVFStats_quantization_time_get, _swigfaiss_gpu.IndexIVFStats_quantization_time_set) - __swig_setmethods__["search_time"] = _swigfaiss_gpu.IndexIVFStats_search_time_set - __swig_getmethods__["search_time"] = _swigfaiss_gpu.IndexIVFStats_search_time_get - if _newclass: - search_time = _swig_property(_swigfaiss_gpu.IndexIVFStats_search_time_get, _swigfaiss_gpu.IndexIVFStats_search_time_set) - - def __init__(self): - this = _swigfaiss_gpu.new_IndexIVFStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss_gpu.IndexIVFStats_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFStats - __del__ = lambda self: None -IndexIVFStats_swigregister = _swigfaiss_gpu.IndexIVFStats_swigregister -IndexIVFStats_swigregister(IndexIVFStats) - - -def check_compatible_for_merge(index1, index2): - return _swigfaiss_gpu.check_compatible_for_merge(index1, index2) -check_compatible_for_merge = _swigfaiss_gpu.check_compatible_for_merge - -def extract_index_ivf(*args): - return _swigfaiss_gpu.extract_index_ivf(*args) -extract_index_ivf = _swigfaiss_gpu.extract_index_ivf - -def merge_into(index0, index1, shift_ids): - return _swigfaiss_gpu.merge_into(index0, index1, shift_ids) -merge_into = _swigfaiss_gpu.merge_into - -def search_centroid(index, x, n, centroid_ids): - return _swigfaiss_gpu.search_centroid(index, x, n, centroid_ids) -search_centroid = _swigfaiss_gpu.search_centroid - -def search_and_return_centroids(index, n, xin, k, distances, labels, query_centroid_ids, result_centroid_ids): - return _swigfaiss_gpu.search_and_return_centroids(index, n, xin, k, distances, labels, query_centroid_ids, result_centroid_ids) -search_and_return_centroids = _swigfaiss_gpu.search_and_return_centroids -class SlidingIndexWindow(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, SlidingIndexWindow, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, SlidingIndexWindow, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss_gpu.SlidingIndexWindow_index_set - __swig_getmethods__["index"] = _swigfaiss_gpu.SlidingIndexWindow_index_get - if _newclass: - index = _swig_property(_swigfaiss_gpu.SlidingIndexWindow_index_get, _swigfaiss_gpu.SlidingIndexWindow_index_set) - __swig_setmethods__["ils"] = _swigfaiss_gpu.SlidingIndexWindow_ils_set - __swig_getmethods__["ils"] = _swigfaiss_gpu.SlidingIndexWindow_ils_get - if _newclass: - ils = _swig_property(_swigfaiss_gpu.SlidingIndexWindow_ils_get, _swigfaiss_gpu.SlidingIndexWindow_ils_set) - __swig_setmethods__["n_slice"] = _swigfaiss_gpu.SlidingIndexWindow_n_slice_set - __swig_getmethods__["n_slice"] = _swigfaiss_gpu.SlidingIndexWindow_n_slice_get - if _newclass: - n_slice = _swig_property(_swigfaiss_gpu.SlidingIndexWindow_n_slice_get, _swigfaiss_gpu.SlidingIndexWindow_n_slice_set) - __swig_setmethods__["nlist"] = _swigfaiss_gpu.SlidingIndexWindow_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss_gpu.SlidingIndexWindow_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss_gpu.SlidingIndexWindow_nlist_get, _swigfaiss_gpu.SlidingIndexWindow_nlist_set) - __swig_setmethods__["sizes"] = _swigfaiss_gpu.SlidingIndexWindow_sizes_set - __swig_getmethods__["sizes"] = _swigfaiss_gpu.SlidingIndexWindow_sizes_get - if _newclass: - sizes = _swig_property(_swigfaiss_gpu.SlidingIndexWindow_sizes_get, _swigfaiss_gpu.SlidingIndexWindow_sizes_set) - - def __init__(self, index): - this = _swigfaiss_gpu.new_SlidingIndexWindow(index) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def step(self, sub_index, remove_oldest): - return _swigfaiss_gpu.SlidingIndexWindow_step(self, sub_index, remove_oldest) - __swig_destroy__ = _swigfaiss_gpu.delete_SlidingIndexWindow - __del__ = lambda self: None -SlidingIndexWindow_swigregister = _swigfaiss_gpu.SlidingIndexWindow_swigregister -SlidingIndexWindow_swigregister(SlidingIndexWindow) - - -def get_invlist_range(index, i0, i1): - return _swigfaiss_gpu.get_invlist_range(index, i0, i1) -get_invlist_range = _swigfaiss_gpu.get_invlist_range - -def set_invlist_range(index, i0, i1, src): - return _swigfaiss_gpu.set_invlist_range(index, i0, i1, src) -set_invlist_range = _swigfaiss_gpu.set_invlist_range - -def search_with_parameters(index, n, x, k, distances, labels, params): - return _swigfaiss_gpu.search_with_parameters(index, n, x, k, distances, labels, params) -search_with_parameters = _swigfaiss_gpu.search_with_parameters -class ScalarQuantizer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ScalarQuantizer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ScalarQuantizer, name) - __repr__ = _swig_repr - QT_8bit = _swigfaiss_gpu.ScalarQuantizer_QT_8bit - QT_4bit = _swigfaiss_gpu.ScalarQuantizer_QT_4bit - QT_8bit_uniform = _swigfaiss_gpu.ScalarQuantizer_QT_8bit_uniform - QT_4bit_uniform = _swigfaiss_gpu.ScalarQuantizer_QT_4bit_uniform - QT_fp16 = _swigfaiss_gpu.ScalarQuantizer_QT_fp16 - QT_8bit_direct = _swigfaiss_gpu.ScalarQuantizer_QT_8bit_direct - __swig_setmethods__["qtype"] = _swigfaiss_gpu.ScalarQuantizer_qtype_set - __swig_getmethods__["qtype"] = _swigfaiss_gpu.ScalarQuantizer_qtype_get - if _newclass: - qtype = _swig_property(_swigfaiss_gpu.ScalarQuantizer_qtype_get, _swigfaiss_gpu.ScalarQuantizer_qtype_set) - RS_minmax = _swigfaiss_gpu.ScalarQuantizer_RS_minmax - RS_meanstd = _swigfaiss_gpu.ScalarQuantizer_RS_meanstd - RS_quantiles = _swigfaiss_gpu.ScalarQuantizer_RS_quantiles - RS_optim = _swigfaiss_gpu.ScalarQuantizer_RS_optim - __swig_setmethods__["rangestat"] = _swigfaiss_gpu.ScalarQuantizer_rangestat_set - __swig_getmethods__["rangestat"] = _swigfaiss_gpu.ScalarQuantizer_rangestat_get - if _newclass: - rangestat = _swig_property(_swigfaiss_gpu.ScalarQuantizer_rangestat_get, _swigfaiss_gpu.ScalarQuantizer_rangestat_set) - __swig_setmethods__["rangestat_arg"] = _swigfaiss_gpu.ScalarQuantizer_rangestat_arg_set - __swig_getmethods__["rangestat_arg"] = _swigfaiss_gpu.ScalarQuantizer_rangestat_arg_get - if _newclass: - rangestat_arg = _swig_property(_swigfaiss_gpu.ScalarQuantizer_rangestat_arg_get, _swigfaiss_gpu.ScalarQuantizer_rangestat_arg_set) - __swig_setmethods__["d"] = _swigfaiss_gpu.ScalarQuantizer_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.ScalarQuantizer_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.ScalarQuantizer_d_get, _swigfaiss_gpu.ScalarQuantizer_d_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.ScalarQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.ScalarQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.ScalarQuantizer_code_size_get, _swigfaiss_gpu.ScalarQuantizer_code_size_set) - __swig_setmethods__["trained"] = _swigfaiss_gpu.ScalarQuantizer_trained_set - __swig_getmethods__["trained"] = _swigfaiss_gpu.ScalarQuantizer_trained_get - if _newclass: - trained = _swig_property(_swigfaiss_gpu.ScalarQuantizer_trained_get, _swigfaiss_gpu.ScalarQuantizer_trained_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_ScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.ScalarQuantizer_train(self, n, x) - - def compute_codes(self, x, codes, n): - return _swigfaiss_gpu.ScalarQuantizer_compute_codes(self, x, codes, n) - - def decode(self, code, x, n): - return _swigfaiss_gpu.ScalarQuantizer_decode(self, code, x, n) - - def get_distance_computer(self, *args): - return _swigfaiss_gpu.ScalarQuantizer_get_distance_computer(self, *args) - __swig_destroy__ = _swigfaiss_gpu.delete_ScalarQuantizer - __del__ = lambda self: None -ScalarQuantizer_swigregister = _swigfaiss_gpu.ScalarQuantizer_swigregister -ScalarQuantizer_swigregister(ScalarQuantizer) - -class IndexScalarQuantizer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexScalarQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexScalarQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["sq"] = _swigfaiss_gpu.IndexScalarQuantizer_sq_set - __swig_getmethods__["sq"] = _swigfaiss_gpu.IndexScalarQuantizer_sq_get - if _newclass: - sq = _swig_property(_swigfaiss_gpu.IndexScalarQuantizer_sq_get, _swigfaiss_gpu.IndexScalarQuantizer_sq_set) - __swig_setmethods__["codes"] = _swigfaiss_gpu.IndexScalarQuantizer_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.IndexScalarQuantizer_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.IndexScalarQuantizer_codes_get, _swigfaiss_gpu.IndexScalarQuantizer_codes_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.IndexScalarQuantizer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.IndexScalarQuantizer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.IndexScalarQuantizer_code_size_get, _swigfaiss_gpu.IndexScalarQuantizer_code_size_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.IndexScalarQuantizer_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexScalarQuantizer_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexScalarQuantizer_search(self, n, x, k, distances, labels) - - def reset(self): - return _swigfaiss_gpu.IndexScalarQuantizer_reset(self) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexScalarQuantizer_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexScalarQuantizer_reconstruct(self, key, recons) - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexScalarQuantizer_get_distance_computer(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexScalarQuantizer - __del__ = lambda self: None -IndexScalarQuantizer_swigregister = _swigfaiss_gpu.IndexScalarQuantizer_swigregister -IndexScalarQuantizer_swigregister(IndexScalarQuantizer) - -class IndexIVFScalarQuantizer(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFScalarQuantizer, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFScalarQuantizer, name) - __repr__ = _swig_repr - __swig_setmethods__["sq"] = _swigfaiss_gpu.IndexIVFScalarQuantizer_sq_set - __swig_getmethods__["sq"] = _swigfaiss_gpu.IndexIVFScalarQuantizer_sq_get - if _newclass: - sq = _swig_property(_swigfaiss_gpu.IndexIVFScalarQuantizer_sq_get, _swigfaiss_gpu.IndexIVFScalarQuantizer_sq_set) - __swig_setmethods__["by_residual"] = _swigfaiss_gpu.IndexIVFScalarQuantizer_by_residual_set - __swig_getmethods__["by_residual"] = _swigfaiss_gpu.IndexIVFScalarQuantizer_by_residual_get - if _newclass: - by_residual = _swig_property(_swigfaiss_gpu.IndexIVFScalarQuantizer_by_residual_get, _swigfaiss_gpu.IndexIVFScalarQuantizer_by_residual_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIVFScalarQuantizer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train_residual(self, n, x): - return _swigfaiss_gpu.IndexIVFScalarQuantizer_train_residual(self, n, x) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss_gpu.IndexIVFScalarQuantizer_encode_vectors(self, n, x, list_nos, codes) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIVFScalarQuantizer_add_with_ids(self, n, x, xids) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss_gpu.IndexIVFScalarQuantizer_get_InvertedListScanner(self, store_pairs) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVFScalarQuantizer_reconstruct_from_offset(self, list_no, offset, recons) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFScalarQuantizer - __del__ = lambda self: None -IndexIVFScalarQuantizer_swigregister = _swigfaiss_gpu.IndexIVFScalarQuantizer_swigregister -IndexIVFScalarQuantizer_swigregister(IndexIVFScalarQuantizer) - -class HNSW(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HNSW, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HNSW, name) - __repr__ = _swig_repr - __swig_setmethods__["assign_probas"] = _swigfaiss_gpu.HNSW_assign_probas_set - __swig_getmethods__["assign_probas"] = _swigfaiss_gpu.HNSW_assign_probas_get - if _newclass: - assign_probas = _swig_property(_swigfaiss_gpu.HNSW_assign_probas_get, _swigfaiss_gpu.HNSW_assign_probas_set) - __swig_setmethods__["cum_nneighbor_per_level"] = _swigfaiss_gpu.HNSW_cum_nneighbor_per_level_set - __swig_getmethods__["cum_nneighbor_per_level"] = _swigfaiss_gpu.HNSW_cum_nneighbor_per_level_get - if _newclass: - cum_nneighbor_per_level = _swig_property(_swigfaiss_gpu.HNSW_cum_nneighbor_per_level_get, _swigfaiss_gpu.HNSW_cum_nneighbor_per_level_set) - __swig_setmethods__["levels"] = _swigfaiss_gpu.HNSW_levels_set - __swig_getmethods__["levels"] = _swigfaiss_gpu.HNSW_levels_get - if _newclass: - levels = _swig_property(_swigfaiss_gpu.HNSW_levels_get, _swigfaiss_gpu.HNSW_levels_set) - __swig_setmethods__["offsets"] = _swigfaiss_gpu.HNSW_offsets_set - __swig_getmethods__["offsets"] = _swigfaiss_gpu.HNSW_offsets_get - if _newclass: - offsets = _swig_property(_swigfaiss_gpu.HNSW_offsets_get, _swigfaiss_gpu.HNSW_offsets_set) - __swig_setmethods__["neighbors"] = _swigfaiss_gpu.HNSW_neighbors_set - __swig_getmethods__["neighbors"] = _swigfaiss_gpu.HNSW_neighbors_get - if _newclass: - neighbors = _swig_property(_swigfaiss_gpu.HNSW_neighbors_get, _swigfaiss_gpu.HNSW_neighbors_set) - __swig_setmethods__["entry_point"] = _swigfaiss_gpu.HNSW_entry_point_set - __swig_getmethods__["entry_point"] = _swigfaiss_gpu.HNSW_entry_point_get - if _newclass: - entry_point = _swig_property(_swigfaiss_gpu.HNSW_entry_point_get, _swigfaiss_gpu.HNSW_entry_point_set) - __swig_setmethods__["rng"] = _swigfaiss_gpu.HNSW_rng_set - __swig_getmethods__["rng"] = _swigfaiss_gpu.HNSW_rng_get - if _newclass: - rng = _swig_property(_swigfaiss_gpu.HNSW_rng_get, _swigfaiss_gpu.HNSW_rng_set) - __swig_setmethods__["max_level"] = _swigfaiss_gpu.HNSW_max_level_set - __swig_getmethods__["max_level"] = _swigfaiss_gpu.HNSW_max_level_get - if _newclass: - max_level = _swig_property(_swigfaiss_gpu.HNSW_max_level_get, _swigfaiss_gpu.HNSW_max_level_set) - __swig_setmethods__["efConstruction"] = _swigfaiss_gpu.HNSW_efConstruction_set - __swig_getmethods__["efConstruction"] = _swigfaiss_gpu.HNSW_efConstruction_get - if _newclass: - efConstruction = _swig_property(_swigfaiss_gpu.HNSW_efConstruction_get, _swigfaiss_gpu.HNSW_efConstruction_set) - __swig_setmethods__["efSearch"] = _swigfaiss_gpu.HNSW_efSearch_set - __swig_getmethods__["efSearch"] = _swigfaiss_gpu.HNSW_efSearch_get - if _newclass: - efSearch = _swig_property(_swigfaiss_gpu.HNSW_efSearch_get, _swigfaiss_gpu.HNSW_efSearch_set) - __swig_setmethods__["check_relative_distance"] = _swigfaiss_gpu.HNSW_check_relative_distance_set - __swig_getmethods__["check_relative_distance"] = _swigfaiss_gpu.HNSW_check_relative_distance_get - if _newclass: - check_relative_distance = _swig_property(_swigfaiss_gpu.HNSW_check_relative_distance_get, _swigfaiss_gpu.HNSW_check_relative_distance_set) - __swig_setmethods__["upper_beam"] = _swigfaiss_gpu.HNSW_upper_beam_set - __swig_getmethods__["upper_beam"] = _swigfaiss_gpu.HNSW_upper_beam_get - if _newclass: - upper_beam = _swig_property(_swigfaiss_gpu.HNSW_upper_beam_get, _swigfaiss_gpu.HNSW_upper_beam_set) - __swig_setmethods__["search_bounded_queue"] = _swigfaiss_gpu.HNSW_search_bounded_queue_set - __swig_getmethods__["search_bounded_queue"] = _swigfaiss_gpu.HNSW_search_bounded_queue_get - if _newclass: - search_bounded_queue = _swig_property(_swigfaiss_gpu.HNSW_search_bounded_queue_get, _swigfaiss_gpu.HNSW_search_bounded_queue_set) - - def set_default_probas(self, M, levelMult): - return _swigfaiss_gpu.HNSW_set_default_probas(self, M, levelMult) - - def set_nb_neighbors(self, level_no, n): - return _swigfaiss_gpu.HNSW_set_nb_neighbors(self, level_no, n) - - def nb_neighbors(self, layer_no): - return _swigfaiss_gpu.HNSW_nb_neighbors(self, layer_no) - - def cum_nb_neighbors(self, layer_no): - return _swigfaiss_gpu.HNSW_cum_nb_neighbors(self, layer_no) - - def neighbor_range(self, no, layer_no, begin, end): - return _swigfaiss_gpu.HNSW_neighbor_range(self, no, layer_no, begin, end) - - def __init__(self, M=32): - this = _swigfaiss_gpu.new_HNSW(M) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def random_level(self): - return _swigfaiss_gpu.HNSW_random_level(self) - - def fill_with_random_links(self, n): - return _swigfaiss_gpu.HNSW_fill_with_random_links(self, n) - - def add_links_starting_from(self, ptdis, pt_id, nearest, d_nearest, level, locks, vt): - return _swigfaiss_gpu.HNSW_add_links_starting_from(self, ptdis, pt_id, nearest, d_nearest, level, locks, vt) - - def add_with_locks(self, ptdis, pt_level, pt_id, locks, vt): - return _swigfaiss_gpu.HNSW_add_with_locks(self, ptdis, pt_level, pt_id, locks, vt) - - def search_from_candidates(self, qdis, k, I, D, candidates, vt, level, nres_in=0): - return _swigfaiss_gpu.HNSW_search_from_candidates(self, qdis, k, I, D, candidates, vt, level, nres_in) - - def search_from_candidate_unbounded(self, node, qdis, ef, vt): - return _swigfaiss_gpu.HNSW_search_from_candidate_unbounded(self, node, qdis, ef, vt) - - def search(self, qdis, k, I, D, vt): - return _swigfaiss_gpu.HNSW_search(self, qdis, k, I, D, vt) - - def reset(self): - return _swigfaiss_gpu.HNSW_reset(self) - - def clear_neighbor_tables(self, level): - return _swigfaiss_gpu.HNSW_clear_neighbor_tables(self, level) - - def print_neighbor_stats(self, level): - return _swigfaiss_gpu.HNSW_print_neighbor_stats(self, level) - - def prepare_level_tab(self, n, preset_levels=False): - return _swigfaiss_gpu.HNSW_prepare_level_tab(self, n, preset_levels) - if _newclass: - shrink_neighbor_list = staticmethod(_swigfaiss_gpu.HNSW_shrink_neighbor_list) - else: - shrink_neighbor_list = _swigfaiss_gpu.HNSW_shrink_neighbor_list - __swig_destroy__ = _swigfaiss_gpu.delete_HNSW - __del__ = lambda self: None -HNSW_swigregister = _swigfaiss_gpu.HNSW_swigregister -HNSW_swigregister(HNSW) - -def HNSW_shrink_neighbor_list(qdis, input, output, max_size): - return _swigfaiss_gpu.HNSW_shrink_neighbor_list(qdis, input, output, max_size) -HNSW_shrink_neighbor_list = _swigfaiss_gpu.HNSW_shrink_neighbor_list - -class VisitedTable(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, VisitedTable, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, VisitedTable, name) - __repr__ = _swig_repr - __swig_setmethods__["visited"] = _swigfaiss_gpu.VisitedTable_visited_set - __swig_getmethods__["visited"] = _swigfaiss_gpu.VisitedTable_visited_get - if _newclass: - visited = _swig_property(_swigfaiss_gpu.VisitedTable_visited_get, _swigfaiss_gpu.VisitedTable_visited_set) - __swig_setmethods__["visno"] = _swigfaiss_gpu.VisitedTable_visno_set - __swig_getmethods__["visno"] = _swigfaiss_gpu.VisitedTable_visno_get - if _newclass: - visno = _swig_property(_swigfaiss_gpu.VisitedTable_visno_get, _swigfaiss_gpu.VisitedTable_visno_set) - - def __init__(self, size): - this = _swigfaiss_gpu.new_VisitedTable(size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def set(self, no): - return _swigfaiss_gpu.VisitedTable_set(self, no) - - def get(self, no): - return _swigfaiss_gpu.VisitedTable_get(self, no) - - def advance(self): - return _swigfaiss_gpu.VisitedTable_advance(self) - __swig_destroy__ = _swigfaiss_gpu.delete_VisitedTable - __del__ = lambda self: None -VisitedTable_swigregister = _swigfaiss_gpu.VisitedTable_swigregister -VisitedTable_swigregister(VisitedTable) - -class HNSWStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, HNSWStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, HNSWStats, name) - __repr__ = _swig_repr - __swig_setmethods__["n1"] = _swigfaiss_gpu.HNSWStats_n1_set - __swig_getmethods__["n1"] = _swigfaiss_gpu.HNSWStats_n1_get - if _newclass: - n1 = _swig_property(_swigfaiss_gpu.HNSWStats_n1_get, _swigfaiss_gpu.HNSWStats_n1_set) - __swig_setmethods__["n2"] = _swigfaiss_gpu.HNSWStats_n2_set - __swig_getmethods__["n2"] = _swigfaiss_gpu.HNSWStats_n2_get - if _newclass: - n2 = _swig_property(_swigfaiss_gpu.HNSWStats_n2_get, _swigfaiss_gpu.HNSWStats_n2_set) - __swig_setmethods__["n3"] = _swigfaiss_gpu.HNSWStats_n3_set - __swig_getmethods__["n3"] = _swigfaiss_gpu.HNSWStats_n3_get - if _newclass: - n3 = _swig_property(_swigfaiss_gpu.HNSWStats_n3_get, _swigfaiss_gpu.HNSWStats_n3_set) - __swig_setmethods__["ndis"] = _swigfaiss_gpu.HNSWStats_ndis_set - __swig_getmethods__["ndis"] = _swigfaiss_gpu.HNSWStats_ndis_get - if _newclass: - ndis = _swig_property(_swigfaiss_gpu.HNSWStats_ndis_get, _swigfaiss_gpu.HNSWStats_ndis_set) - __swig_setmethods__["nreorder"] = _swigfaiss_gpu.HNSWStats_nreorder_set - __swig_getmethods__["nreorder"] = _swigfaiss_gpu.HNSWStats_nreorder_get - if _newclass: - nreorder = _swig_property(_swigfaiss_gpu.HNSWStats_nreorder_get, _swigfaiss_gpu.HNSWStats_nreorder_set) - __swig_setmethods__["view"] = _swigfaiss_gpu.HNSWStats_view_set - __swig_getmethods__["view"] = _swigfaiss_gpu.HNSWStats_view_get - if _newclass: - view = _swig_property(_swigfaiss_gpu.HNSWStats_view_get, _swigfaiss_gpu.HNSWStats_view_set) - - def __init__(self): - this = _swigfaiss_gpu.new_HNSWStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss_gpu.HNSWStats_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_HNSWStats - __del__ = lambda self: None -HNSWStats_swigregister = _swigfaiss_gpu.HNSWStats_swigregister -HNSWStats_swigregister(HNSWStats) - -class ReconstructFromNeighbors(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ReconstructFromNeighbors, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ReconstructFromNeighbors, name) - __repr__ = _swig_repr - __swig_getmethods__["index"] = _swigfaiss_gpu.ReconstructFromNeighbors_index_get - if _newclass: - index = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_index_get) - __swig_setmethods__["M"] = _swigfaiss_gpu.ReconstructFromNeighbors_M_set - __swig_getmethods__["M"] = _swigfaiss_gpu.ReconstructFromNeighbors_M_get - if _newclass: - M = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_M_get, _swigfaiss_gpu.ReconstructFromNeighbors_M_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.ReconstructFromNeighbors_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.ReconstructFromNeighbors_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_k_get, _swigfaiss_gpu.ReconstructFromNeighbors_k_set) - __swig_setmethods__["nsq"] = _swigfaiss_gpu.ReconstructFromNeighbors_nsq_set - __swig_getmethods__["nsq"] = _swigfaiss_gpu.ReconstructFromNeighbors_nsq_get - if _newclass: - nsq = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_nsq_get, _swigfaiss_gpu.ReconstructFromNeighbors_nsq_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.ReconstructFromNeighbors_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.ReconstructFromNeighbors_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_code_size_get, _swigfaiss_gpu.ReconstructFromNeighbors_code_size_set) - __swig_setmethods__["k_reorder"] = _swigfaiss_gpu.ReconstructFromNeighbors_k_reorder_set - __swig_getmethods__["k_reorder"] = _swigfaiss_gpu.ReconstructFromNeighbors_k_reorder_get - if _newclass: - k_reorder = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_k_reorder_get, _swigfaiss_gpu.ReconstructFromNeighbors_k_reorder_set) - __swig_setmethods__["codebook"] = _swigfaiss_gpu.ReconstructFromNeighbors_codebook_set - __swig_getmethods__["codebook"] = _swigfaiss_gpu.ReconstructFromNeighbors_codebook_get - if _newclass: - codebook = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_codebook_get, _swigfaiss_gpu.ReconstructFromNeighbors_codebook_set) - __swig_setmethods__["codes"] = _swigfaiss_gpu.ReconstructFromNeighbors_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.ReconstructFromNeighbors_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_codes_get, _swigfaiss_gpu.ReconstructFromNeighbors_codes_set) - __swig_setmethods__["ntotal"] = _swigfaiss_gpu.ReconstructFromNeighbors_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss_gpu.ReconstructFromNeighbors_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_ntotal_get, _swigfaiss_gpu.ReconstructFromNeighbors_ntotal_set) - __swig_setmethods__["d"] = _swigfaiss_gpu.ReconstructFromNeighbors_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.ReconstructFromNeighbors_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_d_get, _swigfaiss_gpu.ReconstructFromNeighbors_d_set) - __swig_setmethods__["dsub"] = _swigfaiss_gpu.ReconstructFromNeighbors_dsub_set - __swig_getmethods__["dsub"] = _swigfaiss_gpu.ReconstructFromNeighbors_dsub_get - if _newclass: - dsub = _swig_property(_swigfaiss_gpu.ReconstructFromNeighbors_dsub_get, _swigfaiss_gpu.ReconstructFromNeighbors_dsub_set) - - def __init__(self, index, k=256, nsq=1): - this = _swigfaiss_gpu.new_ReconstructFromNeighbors(index, k, nsq) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_codes(self, n, x): - return _swigfaiss_gpu.ReconstructFromNeighbors_add_codes(self, n, x) - - def compute_distances(self, n, shortlist, query, distances): - return _swigfaiss_gpu.ReconstructFromNeighbors_compute_distances(self, n, shortlist, query, distances) - - def estimate_code(self, x, i, code): - return _swigfaiss_gpu.ReconstructFromNeighbors_estimate_code(self, x, i, code) - - def reconstruct(self, i, x, tmp): - return _swigfaiss_gpu.ReconstructFromNeighbors_reconstruct(self, i, x, tmp) - - def reconstruct_n(self, n0, ni, x): - return _swigfaiss_gpu.ReconstructFromNeighbors_reconstruct_n(self, n0, ni, x) - - def get_neighbor_table(self, i, out): - return _swigfaiss_gpu.ReconstructFromNeighbors_get_neighbor_table(self, i, out) - __swig_destroy__ = _swigfaiss_gpu.delete_ReconstructFromNeighbors - __del__ = lambda self: None -ReconstructFromNeighbors_swigregister = _swigfaiss_gpu.ReconstructFromNeighbors_swigregister -ReconstructFromNeighbors_swigregister(ReconstructFromNeighbors) - -class IndexHNSW(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSW, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSW, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["hnsw"] = _swigfaiss_gpu.IndexHNSW_hnsw_set - __swig_getmethods__["hnsw"] = _swigfaiss_gpu.IndexHNSW_hnsw_get - if _newclass: - hnsw = _swig_property(_swigfaiss_gpu.IndexHNSW_hnsw_get, _swigfaiss_gpu.IndexHNSW_hnsw_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexHNSW_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexHNSW_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexHNSW_own_fields_get, _swigfaiss_gpu.IndexHNSW_own_fields_set) - __swig_setmethods__["storage"] = _swigfaiss_gpu.IndexHNSW_storage_set - __swig_getmethods__["storage"] = _swigfaiss_gpu.IndexHNSW_storage_get - if _newclass: - storage = _swig_property(_swigfaiss_gpu.IndexHNSW_storage_get, _swigfaiss_gpu.IndexHNSW_storage_set) - __swig_setmethods__["reconstruct_from_neighbors"] = _swigfaiss_gpu.IndexHNSW_reconstruct_from_neighbors_set - __swig_getmethods__["reconstruct_from_neighbors"] = _swigfaiss_gpu.IndexHNSW_reconstruct_from_neighbors_get - if _newclass: - reconstruct_from_neighbors = _swig_property(_swigfaiss_gpu.IndexHNSW_reconstruct_from_neighbors_get, _swigfaiss_gpu.IndexHNSW_reconstruct_from_neighbors_set) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexHNSW - __del__ = lambda self: None - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexHNSW_get_distance_computer(self) - - def add(self, n, x): - return _swigfaiss_gpu.IndexHNSW_add(self, n, x) - - def train(self, n, x): - return _swigfaiss_gpu.IndexHNSW_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexHNSW_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexHNSW_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss_gpu.IndexHNSW_reset(self) - - def shrink_level_0_neighbors(self, size): - return _swigfaiss_gpu.IndexHNSW_shrink_level_0_neighbors(self, size) - - def search_level_0(self, n, x, k, nearest, nearest_d, distances, labels, nprobe=1, search_type=1): - return _swigfaiss_gpu.IndexHNSW_search_level_0(self, n, x, k, nearest, nearest_d, distances, labels, nprobe, search_type) - - def init_level_0_from_knngraph(self, k, D, I): - return _swigfaiss_gpu.IndexHNSW_init_level_0_from_knngraph(self, k, D, I) - - def init_level_0_from_entry_points(self, npt, points, nearests): - return _swigfaiss_gpu.IndexHNSW_init_level_0_from_entry_points(self, npt, points, nearests) - - def reorder_links(self): - return _swigfaiss_gpu.IndexHNSW_reorder_links(self) - - def link_singletons(self): - return _swigfaiss_gpu.IndexHNSW_link_singletons(self) -IndexHNSW_swigregister = _swigfaiss_gpu.IndexHNSW_swigregister -IndexHNSW_swigregister(IndexHNSW) - -class IndexHNSWFlat(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWFlat, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexHNSWFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexHNSWFlat_get_distance_computer(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexHNSWFlat - __del__ = lambda self: None -IndexHNSWFlat_swigregister = _swigfaiss_gpu.IndexHNSWFlat_swigregister -IndexHNSWFlat_swigregister(IndexHNSWFlat) - -class IndexHNSWPQ(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWPQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWPQ, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexHNSWPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def train(self, n, x): - return _swigfaiss_gpu.IndexHNSWPQ_train(self, n, x) - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexHNSWPQ_get_distance_computer(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexHNSWPQ - __del__ = lambda self: None -IndexHNSWPQ_swigregister = _swigfaiss_gpu.IndexHNSWPQ_swigregister -IndexHNSWPQ_swigregister(IndexHNSWPQ) - -class IndexHNSWSQ(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSWSQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSWSQ, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexHNSWSQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexHNSWSQ_get_distance_computer(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexHNSWSQ - __del__ = lambda self: None -IndexHNSWSQ_swigregister = _swigfaiss_gpu.IndexHNSWSQ_swigregister -IndexHNSWSQ_swigregister(IndexHNSWSQ) - -class IndexHNSW2Level(IndexHNSW): - __swig_setmethods__ = {} - for _s in [IndexHNSW]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexHNSW2Level, name, value) - __swig_getmethods__ = {} - for _s in [IndexHNSW]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexHNSW2Level, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexHNSW2Level(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexHNSW2Level_get_distance_computer(self) - - def flip_to_ivf(self): - return _swigfaiss_gpu.IndexHNSW2Level_flip_to_ivf(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexHNSW2Level_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexHNSW2Level - __del__ = lambda self: None -IndexHNSW2Level_swigregister = _swigfaiss_gpu.IndexHNSW2Level_swigregister -IndexHNSW2Level_swigregister(IndexHNSW2Level) - -class IndexIVFFlat(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFFlat, name) - __repr__ = _swig_repr - - def add_core(self, n, x, xids, precomputed_idx): - return _swigfaiss_gpu.IndexIVFFlat_add_core(self, n, x, xids, precomputed_idx) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIVFFlat_add_with_ids(self, n, x, xids) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss_gpu.IndexIVFFlat_encode_vectors(self, n, x, list_nos, codes) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss_gpu.IndexIVFFlat_get_InvertedListScanner(self, store_pairs) - - def update_vectors(self, nv, idx, v): - return _swigfaiss_gpu.IndexIVFFlat_update_vectors(self, nv, idx, v) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVFFlat_reconstruct_from_offset(self, list_no, offset, recons) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIVFFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFFlat - __del__ = lambda self: None -IndexIVFFlat_swigregister = _swigfaiss_gpu.IndexIVFFlat_swigregister -IndexIVFFlat_swigregister(IndexIVFFlat) - -class IndexIVFFlatDedup(IndexIVFFlat): - __swig_setmethods__ = {} - for _s in [IndexIVFFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFFlatDedup, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVFFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFFlatDedup, name) - __repr__ = _swig_repr - __swig_setmethods__["instances"] = _swigfaiss_gpu.IndexIVFFlatDedup_instances_set - __swig_getmethods__["instances"] = _swigfaiss_gpu.IndexIVFFlatDedup_instances_get - if _newclass: - instances = _swig_property(_swigfaiss_gpu.IndexIVFFlatDedup_instances_get, _swigfaiss_gpu.IndexIVFFlatDedup_instances_set) - - def train(self, n, x): - return _swigfaiss_gpu.IndexIVFFlatDedup_train(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIVFFlatDedup_add_with_ids(self, n, x, xids) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss_gpu.IndexIVFFlatDedup_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexIVFFlatDedup_remove_ids(self, sel) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexIVFFlatDedup_range_search(self, n, x, radius, result) - - def update_vectors(self, nv, idx, v): - return _swigfaiss_gpu.IndexIVFFlatDedup_update_vectors(self, nv, idx, v) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVFFlatDedup_reconstruct_from_offset(self, list_no, offset, recons) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIVFFlatDedup(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFFlatDedup - __del__ = lambda self: None -IndexIVFFlatDedup_swigregister = _swigfaiss_gpu.IndexIVFFlatDedup_swigregister -IndexIVFFlatDedup_swigregister(IndexIVFFlatDedup) - -class OnDiskInvertedLists(InvertedLists): - __swig_setmethods__ = {} - for _s in [InvertedLists]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OnDiskInvertedLists, name, value) - __swig_getmethods__ = {} - for _s in [InvertedLists]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OnDiskInvertedLists, name) - __repr__ = _swig_repr - __swig_setmethods__["lists"] = _swigfaiss_gpu.OnDiskInvertedLists_lists_set - __swig_getmethods__["lists"] = _swigfaiss_gpu.OnDiskInvertedLists_lists_get - if _newclass: - lists = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_lists_get, _swigfaiss_gpu.OnDiskInvertedLists_lists_set) - __swig_setmethods__["slots"] = _swigfaiss_gpu.OnDiskInvertedLists_slots_set - __swig_getmethods__["slots"] = _swigfaiss_gpu.OnDiskInvertedLists_slots_get - if _newclass: - slots = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_slots_get, _swigfaiss_gpu.OnDiskInvertedLists_slots_set) - __swig_setmethods__["filename"] = _swigfaiss_gpu.OnDiskInvertedLists_filename_set - __swig_getmethods__["filename"] = _swigfaiss_gpu.OnDiskInvertedLists_filename_get - if _newclass: - filename = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_filename_get, _swigfaiss_gpu.OnDiskInvertedLists_filename_set) - __swig_setmethods__["totsize"] = _swigfaiss_gpu.OnDiskInvertedLists_totsize_set - __swig_getmethods__["totsize"] = _swigfaiss_gpu.OnDiskInvertedLists_totsize_get - if _newclass: - totsize = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_totsize_get, _swigfaiss_gpu.OnDiskInvertedLists_totsize_set) - __swig_setmethods__["ptr"] = _swigfaiss_gpu.OnDiskInvertedLists_ptr_set - __swig_getmethods__["ptr"] = _swigfaiss_gpu.OnDiskInvertedLists_ptr_get - if _newclass: - ptr = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_ptr_get, _swigfaiss_gpu.OnDiskInvertedLists_ptr_set) - __swig_setmethods__["read_only"] = _swigfaiss_gpu.OnDiskInvertedLists_read_only_set - __swig_getmethods__["read_only"] = _swigfaiss_gpu.OnDiskInvertedLists_read_only_get - if _newclass: - read_only = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_read_only_get, _swigfaiss_gpu.OnDiskInvertedLists_read_only_set) - - def list_size(self, list_no): - return _swigfaiss_gpu.OnDiskInvertedLists_list_size(self, list_no) - - def get_codes(self, list_no): - return _swigfaiss_gpu.OnDiskInvertedLists_get_codes(self, list_no) - - def get_ids(self, list_no): - return _swigfaiss_gpu.OnDiskInvertedLists_get_ids(self, list_no) - - def add_entries(self, list_no, n_entry, ids, code): - return _swigfaiss_gpu.OnDiskInvertedLists_add_entries(self, list_no, n_entry, ids, code) - - def update_entries(self, list_no, offset, n_entry, ids, code): - return _swigfaiss_gpu.OnDiskInvertedLists_update_entries(self, list_no, offset, n_entry, ids, code) - - def resize(self, list_no, new_size): - return _swigfaiss_gpu.OnDiskInvertedLists_resize(self, list_no, new_size) - - def merge_from(self, ils, n_il): - return _swigfaiss_gpu.OnDiskInvertedLists_merge_from(self, ils, n_il) - - def prefetch_lists(self, list_nos, nlist): - return _swigfaiss_gpu.OnDiskInvertedLists_prefetch_lists(self, list_nos, nlist) - __swig_destroy__ = _swigfaiss_gpu.delete_OnDiskInvertedLists - __del__ = lambda self: None - __swig_setmethods__["locks"] = _swigfaiss_gpu.OnDiskInvertedLists_locks_set - __swig_getmethods__["locks"] = _swigfaiss_gpu.OnDiskInvertedLists_locks_get - if _newclass: - locks = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_locks_get, _swigfaiss_gpu.OnDiskInvertedLists_locks_set) - __swig_setmethods__["pf"] = _swigfaiss_gpu.OnDiskInvertedLists_pf_set - __swig_getmethods__["pf"] = _swigfaiss_gpu.OnDiskInvertedLists_pf_get - if _newclass: - pf = _swig_property(_swigfaiss_gpu.OnDiskInvertedLists_pf_get, _swigfaiss_gpu.OnDiskInvertedLists_pf_set) - - def do_mmap(self): - return _swigfaiss_gpu.OnDiskInvertedLists_do_mmap(self) - - def update_totsize(self, new_totsize): - return _swigfaiss_gpu.OnDiskInvertedLists_update_totsize(self, new_totsize) - - def resize_locked(self, list_no, new_size): - return _swigfaiss_gpu.OnDiskInvertedLists_resize_locked(self, list_no, new_size) - - def allocate_slot(self, capacity): - return _swigfaiss_gpu.OnDiskInvertedLists_allocate_slot(self, capacity) - - def free_slot(self, offset, capacity): - return _swigfaiss_gpu.OnDiskInvertedLists_free_slot(self, offset, capacity) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_OnDiskInvertedLists(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -OnDiskInvertedLists_swigregister = _swigfaiss_gpu.OnDiskInvertedLists_swigregister -OnDiskInvertedLists_swigregister(OnDiskInvertedLists) - -class IVFPQSearchParameters(IVFSearchParameters): - __swig_setmethods__ = {} - for _s in [IVFSearchParameters]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IVFPQSearchParameters, name, value) - __swig_getmethods__ = {} - for _s in [IVFSearchParameters]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IVFPQSearchParameters, name) - __repr__ = _swig_repr - __swig_setmethods__["scan_table_threshold"] = _swigfaiss_gpu.IVFPQSearchParameters_scan_table_threshold_set - __swig_getmethods__["scan_table_threshold"] = _swigfaiss_gpu.IVFPQSearchParameters_scan_table_threshold_get - if _newclass: - scan_table_threshold = _swig_property(_swigfaiss_gpu.IVFPQSearchParameters_scan_table_threshold_get, _swigfaiss_gpu.IVFPQSearchParameters_scan_table_threshold_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss_gpu.IVFPQSearchParameters_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss_gpu.IVFPQSearchParameters_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss_gpu.IVFPQSearchParameters_polysemous_ht_get, _swigfaiss_gpu.IVFPQSearchParameters_polysemous_ht_set) - __swig_destroy__ = _swigfaiss_gpu.delete_IVFPQSearchParameters - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss_gpu.new_IVFPQSearchParameters() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IVFPQSearchParameters_swigregister = _swigfaiss_gpu.IVFPQSearchParameters_swigregister -IVFPQSearchParameters_swigregister(IVFPQSearchParameters) - -class IndexIVFPQ(IndexIVF): - __swig_setmethods__ = {} - for _s in [IndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQ, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQ, name) - __repr__ = _swig_repr - __swig_setmethods__["by_residual"] = _swigfaiss_gpu.IndexIVFPQ_by_residual_set - __swig_getmethods__["by_residual"] = _swigfaiss_gpu.IndexIVFPQ_by_residual_get - if _newclass: - by_residual = _swig_property(_swigfaiss_gpu.IndexIVFPQ_by_residual_get, _swigfaiss_gpu.IndexIVFPQ_by_residual_set) - __swig_setmethods__["pq"] = _swigfaiss_gpu.IndexIVFPQ_pq_set - __swig_getmethods__["pq"] = _swigfaiss_gpu.IndexIVFPQ_pq_get - if _newclass: - pq = _swig_property(_swigfaiss_gpu.IndexIVFPQ_pq_get, _swigfaiss_gpu.IndexIVFPQ_pq_set) - __swig_setmethods__["do_polysemous_training"] = _swigfaiss_gpu.IndexIVFPQ_do_polysemous_training_set - __swig_getmethods__["do_polysemous_training"] = _swigfaiss_gpu.IndexIVFPQ_do_polysemous_training_get - if _newclass: - do_polysemous_training = _swig_property(_swigfaiss_gpu.IndexIVFPQ_do_polysemous_training_get, _swigfaiss_gpu.IndexIVFPQ_do_polysemous_training_set) - __swig_setmethods__["polysemous_training"] = _swigfaiss_gpu.IndexIVFPQ_polysemous_training_set - __swig_getmethods__["polysemous_training"] = _swigfaiss_gpu.IndexIVFPQ_polysemous_training_get - if _newclass: - polysemous_training = _swig_property(_swigfaiss_gpu.IndexIVFPQ_polysemous_training_get, _swigfaiss_gpu.IndexIVFPQ_polysemous_training_set) - __swig_setmethods__["scan_table_threshold"] = _swigfaiss_gpu.IndexIVFPQ_scan_table_threshold_set - __swig_getmethods__["scan_table_threshold"] = _swigfaiss_gpu.IndexIVFPQ_scan_table_threshold_get - if _newclass: - scan_table_threshold = _swig_property(_swigfaiss_gpu.IndexIVFPQ_scan_table_threshold_get, _swigfaiss_gpu.IndexIVFPQ_scan_table_threshold_set) - __swig_setmethods__["polysemous_ht"] = _swigfaiss_gpu.IndexIVFPQ_polysemous_ht_set - __swig_getmethods__["polysemous_ht"] = _swigfaiss_gpu.IndexIVFPQ_polysemous_ht_get - if _newclass: - polysemous_ht = _swig_property(_swigfaiss_gpu.IndexIVFPQ_polysemous_ht_get, _swigfaiss_gpu.IndexIVFPQ_polysemous_ht_set) - __swig_setmethods__["use_precomputed_table"] = _swigfaiss_gpu.IndexIVFPQ_use_precomputed_table_set - __swig_getmethods__["use_precomputed_table"] = _swigfaiss_gpu.IndexIVFPQ_use_precomputed_table_get - if _newclass: - use_precomputed_table = _swig_property(_swigfaiss_gpu.IndexIVFPQ_use_precomputed_table_get, _swigfaiss_gpu.IndexIVFPQ_use_precomputed_table_set) - __swig_setmethods__["precomputed_table_max_bytes"] = _swigfaiss_gpu.IndexIVFPQ_precomputed_table_max_bytes_set - __swig_getmethods__["precomputed_table_max_bytes"] = _swigfaiss_gpu.IndexIVFPQ_precomputed_table_max_bytes_get - if _newclass: - precomputed_table_max_bytes = _swig_property(_swigfaiss_gpu.IndexIVFPQ_precomputed_table_max_bytes_get, _swigfaiss_gpu.IndexIVFPQ_precomputed_table_max_bytes_set) - __swig_setmethods__["precomputed_table"] = _swigfaiss_gpu.IndexIVFPQ_precomputed_table_set - __swig_getmethods__["precomputed_table"] = _swigfaiss_gpu.IndexIVFPQ_precomputed_table_get - if _newclass: - precomputed_table = _swig_property(_swigfaiss_gpu.IndexIVFPQ_precomputed_table_get, _swigfaiss_gpu.IndexIVFPQ_precomputed_table_set) - - def add_with_ids(self, n, x, xids=None): - return _swigfaiss_gpu.IndexIVFPQ_add_with_ids(self, n, x, xids) - - def encode_vectors(self, n, x, list_nos, codes): - return _swigfaiss_gpu.IndexIVFPQ_encode_vectors(self, n, x, list_nos, codes) - - def add_core_o(self, n, x, xids, residuals_2, precomputed_idx=None): - return _swigfaiss_gpu.IndexIVFPQ_add_core_o(self, n, x, xids, residuals_2, precomputed_idx) - - def train_residual(self, n, x): - return _swigfaiss_gpu.IndexIVFPQ_train_residual(self, n, x) - - def train_residual_o(self, n, x, residuals_2): - return _swigfaiss_gpu.IndexIVFPQ_train_residual_o(self, n, x, residuals_2) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVFPQ_reconstruct_from_offset(self, list_no, offset, recons) - - def find_duplicates(self, ids, lims): - return _swigfaiss_gpu.IndexIVFPQ_find_duplicates(self, ids, lims) - - def encode(self, key, x, code): - return _swigfaiss_gpu.IndexIVFPQ_encode(self, key, x, code) - - def encode_multiple(self, n, keys, x, codes, compute_keys=False): - return _swigfaiss_gpu.IndexIVFPQ_encode_multiple(self, n, keys, x, codes, compute_keys) - - def decode_multiple(self, n, keys, xcodes, x): - return _swigfaiss_gpu.IndexIVFPQ_decode_multiple(self, n, keys, xcodes, x) - - def get_InvertedListScanner(self, store_pairs): - return _swigfaiss_gpu.IndexIVFPQ_get_InvertedListScanner(self, store_pairs) - - def precompute_table(self): - return _swigfaiss_gpu.IndexIVFPQ_precompute_table(self) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIVFPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFPQ - __del__ = lambda self: None -IndexIVFPQ_swigregister = _swigfaiss_gpu.IndexIVFPQ_swigregister -IndexIVFPQ_swigregister(IndexIVFPQ) - -class IndexIVFPQStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQStats, name) - __repr__ = _swig_repr - __swig_setmethods__["nrefine"] = _swigfaiss_gpu.IndexIVFPQStats_nrefine_set - __swig_getmethods__["nrefine"] = _swigfaiss_gpu.IndexIVFPQStats_nrefine_get - if _newclass: - nrefine = _swig_property(_swigfaiss_gpu.IndexIVFPQStats_nrefine_get, _swigfaiss_gpu.IndexIVFPQStats_nrefine_set) - __swig_setmethods__["n_hamming_pass"] = _swigfaiss_gpu.IndexIVFPQStats_n_hamming_pass_set - __swig_getmethods__["n_hamming_pass"] = _swigfaiss_gpu.IndexIVFPQStats_n_hamming_pass_get - if _newclass: - n_hamming_pass = _swig_property(_swigfaiss_gpu.IndexIVFPQStats_n_hamming_pass_get, _swigfaiss_gpu.IndexIVFPQStats_n_hamming_pass_set) - __swig_setmethods__["search_cycles"] = _swigfaiss_gpu.IndexIVFPQStats_search_cycles_set - __swig_getmethods__["search_cycles"] = _swigfaiss_gpu.IndexIVFPQStats_search_cycles_get - if _newclass: - search_cycles = _swig_property(_swigfaiss_gpu.IndexIVFPQStats_search_cycles_get, _swigfaiss_gpu.IndexIVFPQStats_search_cycles_set) - __swig_setmethods__["refine_cycles"] = _swigfaiss_gpu.IndexIVFPQStats_refine_cycles_set - __swig_getmethods__["refine_cycles"] = _swigfaiss_gpu.IndexIVFPQStats_refine_cycles_get - if _newclass: - refine_cycles = _swig_property(_swigfaiss_gpu.IndexIVFPQStats_refine_cycles_get, _swigfaiss_gpu.IndexIVFPQStats_refine_cycles_set) - - def __init__(self): - this = _swigfaiss_gpu.new_IndexIVFPQStats() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def reset(self): - return _swigfaiss_gpu.IndexIVFPQStats_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFPQStats - __del__ = lambda self: None -IndexIVFPQStats_swigregister = _swigfaiss_gpu.IndexIVFPQStats_swigregister -IndexIVFPQStats_swigregister(IndexIVFPQStats) - -class IndexIVFPQR(IndexIVFPQ): - __swig_setmethods__ = {} - for _s in [IndexIVFPQ]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIVFPQR, name, value) - __swig_getmethods__ = {} - for _s in [IndexIVFPQ]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIVFPQR, name) - __repr__ = _swig_repr - __swig_setmethods__["refine_pq"] = _swigfaiss_gpu.IndexIVFPQR_refine_pq_set - __swig_getmethods__["refine_pq"] = _swigfaiss_gpu.IndexIVFPQR_refine_pq_get - if _newclass: - refine_pq = _swig_property(_swigfaiss_gpu.IndexIVFPQR_refine_pq_get, _swigfaiss_gpu.IndexIVFPQR_refine_pq_set) - __swig_setmethods__["refine_codes"] = _swigfaiss_gpu.IndexIVFPQR_refine_codes_set - __swig_getmethods__["refine_codes"] = _swigfaiss_gpu.IndexIVFPQR_refine_codes_get - if _newclass: - refine_codes = _swig_property(_swigfaiss_gpu.IndexIVFPQR_refine_codes_get, _swigfaiss_gpu.IndexIVFPQR_refine_codes_set) - __swig_setmethods__["k_factor"] = _swigfaiss_gpu.IndexIVFPQR_k_factor_set - __swig_getmethods__["k_factor"] = _swigfaiss_gpu.IndexIVFPQR_k_factor_get - if _newclass: - k_factor = _swig_property(_swigfaiss_gpu.IndexIVFPQR_k_factor_get, _swigfaiss_gpu.IndexIVFPQR_k_factor_set) - - def reset(self): - return _swigfaiss_gpu.IndexIVFPQR_reset(self) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexIVFPQR_remove_ids(self, sel) - - def train_residual(self, n, x): - return _swigfaiss_gpu.IndexIVFPQR_train_residual(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIVFPQR_add_with_ids(self, n, x, xids) - - def add_core(self, n, x, xids, precomputed_idx=None): - return _swigfaiss_gpu.IndexIVFPQR_add_core(self, n, x, xids, precomputed_idx) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexIVFPQR_reconstruct_from_offset(self, list_no, offset, recons) - - def merge_from(self, other, add_id): - return _swigfaiss_gpu.IndexIVFPQR_merge_from(self, other, add_id) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss_gpu.IndexIVFPQR_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIVFPQR(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIVFPQR - __del__ = lambda self: None -IndexIVFPQR_swigregister = _swigfaiss_gpu.IndexIVFPQR_swigregister -IndexIVFPQR_swigregister(IndexIVFPQR) - -class Index2Layer(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, Index2Layer, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, Index2Layer, name) - __repr__ = _swig_repr - __swig_setmethods__["q1"] = _swigfaiss_gpu.Index2Layer_q1_set - __swig_getmethods__["q1"] = _swigfaiss_gpu.Index2Layer_q1_get - if _newclass: - q1 = _swig_property(_swigfaiss_gpu.Index2Layer_q1_get, _swigfaiss_gpu.Index2Layer_q1_set) - __swig_setmethods__["pq"] = _swigfaiss_gpu.Index2Layer_pq_set - __swig_getmethods__["pq"] = _swigfaiss_gpu.Index2Layer_pq_get - if _newclass: - pq = _swig_property(_swigfaiss_gpu.Index2Layer_pq_get, _swigfaiss_gpu.Index2Layer_pq_set) - __swig_setmethods__["codes"] = _swigfaiss_gpu.Index2Layer_codes_set - __swig_getmethods__["codes"] = _swigfaiss_gpu.Index2Layer_codes_get - if _newclass: - codes = _swig_property(_swigfaiss_gpu.Index2Layer_codes_get, _swigfaiss_gpu.Index2Layer_codes_set) - __swig_setmethods__["code_size_1"] = _swigfaiss_gpu.Index2Layer_code_size_1_set - __swig_getmethods__["code_size_1"] = _swigfaiss_gpu.Index2Layer_code_size_1_get - if _newclass: - code_size_1 = _swig_property(_swigfaiss_gpu.Index2Layer_code_size_1_get, _swigfaiss_gpu.Index2Layer_code_size_1_set) - __swig_setmethods__["code_size_2"] = _swigfaiss_gpu.Index2Layer_code_size_2_set - __swig_getmethods__["code_size_2"] = _swigfaiss_gpu.Index2Layer_code_size_2_get - if _newclass: - code_size_2 = _swig_property(_swigfaiss_gpu.Index2Layer_code_size_2_get, _swigfaiss_gpu.Index2Layer_code_size_2_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.Index2Layer_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.Index2Layer_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.Index2Layer_code_size_get, _swigfaiss_gpu.Index2Layer_code_size_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_Index2Layer(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_Index2Layer - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss_gpu.Index2Layer_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.Index2Layer_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.Index2Layer_search(self, n, x, k, distances, labels) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.Index2Layer_reconstruct_n(self, i0, ni, recons) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.Index2Layer_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss_gpu.Index2Layer_reset(self) - - def transfer_to_IVFPQ(self, other): - return _swigfaiss_gpu.Index2Layer_transfer_to_IVFPQ(self, other) -Index2Layer_swigregister = _swigfaiss_gpu.Index2Layer_swigregister -Index2Layer_swigregister(Index2Layer) - -class IndexBinary(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinary, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinary, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["d"] = _swigfaiss_gpu.IndexBinary_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.IndexBinary_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.IndexBinary_d_get, _swigfaiss_gpu.IndexBinary_d_set) - __swig_setmethods__["code_size"] = _swigfaiss_gpu.IndexBinary_code_size_set - __swig_getmethods__["code_size"] = _swigfaiss_gpu.IndexBinary_code_size_get - if _newclass: - code_size = _swig_property(_swigfaiss_gpu.IndexBinary_code_size_get, _swigfaiss_gpu.IndexBinary_code_size_set) - __swig_setmethods__["ntotal"] = _swigfaiss_gpu.IndexBinary_ntotal_set - __swig_getmethods__["ntotal"] = _swigfaiss_gpu.IndexBinary_ntotal_get - if _newclass: - ntotal = _swig_property(_swigfaiss_gpu.IndexBinary_ntotal_get, _swigfaiss_gpu.IndexBinary_ntotal_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.IndexBinary_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.IndexBinary_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.IndexBinary_verbose_get, _swigfaiss_gpu.IndexBinary_verbose_set) - __swig_setmethods__["is_trained"] = _swigfaiss_gpu.IndexBinary_is_trained_set - __swig_getmethods__["is_trained"] = _swigfaiss_gpu.IndexBinary_is_trained_get - if _newclass: - is_trained = _swig_property(_swigfaiss_gpu.IndexBinary_is_trained_get, _swigfaiss_gpu.IndexBinary_is_trained_set) - __swig_setmethods__["metric_type"] = _swigfaiss_gpu.IndexBinary_metric_type_set - __swig_getmethods__["metric_type"] = _swigfaiss_gpu.IndexBinary_metric_type_get - if _newclass: - metric_type = _swig_property(_swigfaiss_gpu.IndexBinary_metric_type_get, _swigfaiss_gpu.IndexBinary_metric_type_set) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinary - __del__ = lambda self: None - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinary_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinary_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexBinary_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinary_search(self, n, x, k, distances, labels) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexBinary_range_search(self, n, x, radius, result) - - def assign(self, n, x, labels, k=1): - return _swigfaiss_gpu.IndexBinary_assign(self, n, x, labels, k) - - def reset(self): - return _swigfaiss_gpu.IndexBinary_reset(self) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexBinary_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexBinary_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexBinary_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss_gpu.IndexBinary_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def display(self): - return _swigfaiss_gpu.IndexBinary_display(self) -IndexBinary_swigregister = _swigfaiss_gpu.IndexBinary_swigregister -IndexBinary_swigregister(IndexBinary) - -class IndexBinaryFlat(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryFlat, name) - __repr__ = _swig_repr - __swig_setmethods__["xb"] = _swigfaiss_gpu.IndexBinaryFlat_xb_set - __swig_getmethods__["xb"] = _swigfaiss_gpu.IndexBinaryFlat_xb_get - if _newclass: - xb = _swig_property(_swigfaiss_gpu.IndexBinaryFlat_xb_get, _swigfaiss_gpu.IndexBinaryFlat_xb_set) - __swig_setmethods__["use_heap"] = _swigfaiss_gpu.IndexBinaryFlat_use_heap_set - __swig_getmethods__["use_heap"] = _swigfaiss_gpu.IndexBinaryFlat_use_heap_get - if _newclass: - use_heap = _swig_property(_swigfaiss_gpu.IndexBinaryFlat_use_heap_get, _swigfaiss_gpu.IndexBinaryFlat_use_heap_set) - __swig_setmethods__["query_batch_size"] = _swigfaiss_gpu.IndexBinaryFlat_query_batch_size_set - __swig_getmethods__["query_batch_size"] = _swigfaiss_gpu.IndexBinaryFlat_query_batch_size_get - if _newclass: - query_batch_size = _swig_property(_swigfaiss_gpu.IndexBinaryFlat_query_batch_size_get, _swigfaiss_gpu.IndexBinaryFlat_query_batch_size_set) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryFlat_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexBinaryFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryFlat_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexBinaryFlat_reconstruct(self, key, recons) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexBinaryFlat_remove_ids(self, sel) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexBinaryFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryFlat - __del__ = lambda self: None -IndexBinaryFlat_swigregister = _swigfaiss_gpu.IndexBinaryFlat_swigregister -IndexBinaryFlat_swigregister(IndexBinaryFlat) - -class IndexBinaryIVF(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryIVF, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryIVF, name) - __repr__ = _swig_repr - __swig_setmethods__["invlists"] = _swigfaiss_gpu.IndexBinaryIVF_invlists_set - __swig_getmethods__["invlists"] = _swigfaiss_gpu.IndexBinaryIVF_invlists_get - if _newclass: - invlists = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_invlists_get, _swigfaiss_gpu.IndexBinaryIVF_invlists_set) - __swig_setmethods__["own_invlists"] = _swigfaiss_gpu.IndexBinaryIVF_own_invlists_set - __swig_getmethods__["own_invlists"] = _swigfaiss_gpu.IndexBinaryIVF_own_invlists_get - if _newclass: - own_invlists = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_own_invlists_get, _swigfaiss_gpu.IndexBinaryIVF_own_invlists_set) - __swig_setmethods__["nprobe"] = _swigfaiss_gpu.IndexBinaryIVF_nprobe_set - __swig_getmethods__["nprobe"] = _swigfaiss_gpu.IndexBinaryIVF_nprobe_get - if _newclass: - nprobe = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_nprobe_get, _swigfaiss_gpu.IndexBinaryIVF_nprobe_set) - __swig_setmethods__["max_codes"] = _swigfaiss_gpu.IndexBinaryIVF_max_codes_set - __swig_getmethods__["max_codes"] = _swigfaiss_gpu.IndexBinaryIVF_max_codes_get - if _newclass: - max_codes = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_max_codes_get, _swigfaiss_gpu.IndexBinaryIVF_max_codes_set) - __swig_setmethods__["use_heap"] = _swigfaiss_gpu.IndexBinaryIVF_use_heap_set - __swig_getmethods__["use_heap"] = _swigfaiss_gpu.IndexBinaryIVF_use_heap_get - if _newclass: - use_heap = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_use_heap_get, _swigfaiss_gpu.IndexBinaryIVF_use_heap_set) - __swig_setmethods__["maintain_direct_map"] = _swigfaiss_gpu.IndexBinaryIVF_maintain_direct_map_set - __swig_getmethods__["maintain_direct_map"] = _swigfaiss_gpu.IndexBinaryIVF_maintain_direct_map_get - if _newclass: - maintain_direct_map = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_maintain_direct_map_get, _swigfaiss_gpu.IndexBinaryIVF_maintain_direct_map_set) - __swig_setmethods__["direct_map"] = _swigfaiss_gpu.IndexBinaryIVF_direct_map_set - __swig_getmethods__["direct_map"] = _swigfaiss_gpu.IndexBinaryIVF_direct_map_get - if _newclass: - direct_map = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_direct_map_get, _swigfaiss_gpu.IndexBinaryIVF_direct_map_set) - __swig_setmethods__["quantizer"] = _swigfaiss_gpu.IndexBinaryIVF_quantizer_set - __swig_getmethods__["quantizer"] = _swigfaiss_gpu.IndexBinaryIVF_quantizer_get - if _newclass: - quantizer = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_quantizer_get, _swigfaiss_gpu.IndexBinaryIVF_quantizer_set) - __swig_setmethods__["nlist"] = _swigfaiss_gpu.IndexBinaryIVF_nlist_set - __swig_getmethods__["nlist"] = _swigfaiss_gpu.IndexBinaryIVF_nlist_get - if _newclass: - nlist = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_nlist_get, _swigfaiss_gpu.IndexBinaryIVF_nlist_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryIVF_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryIVF_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_own_fields_get, _swigfaiss_gpu.IndexBinaryIVF_own_fields_set) - __swig_setmethods__["cp"] = _swigfaiss_gpu.IndexBinaryIVF_cp_set - __swig_getmethods__["cp"] = _swigfaiss_gpu.IndexBinaryIVF_cp_get - if _newclass: - cp = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_cp_get, _swigfaiss_gpu.IndexBinaryIVF_cp_set) - __swig_setmethods__["clustering_index"] = _swigfaiss_gpu.IndexBinaryIVF_clustering_index_set - __swig_getmethods__["clustering_index"] = _swigfaiss_gpu.IndexBinaryIVF_clustering_index_get - if _newclass: - clustering_index = _swig_property(_swigfaiss_gpu.IndexBinaryIVF_clustering_index_get, _swigfaiss_gpu.IndexBinaryIVF_clustering_index_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexBinaryIVF(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryIVF - __del__ = lambda self: None - - def reset(self): - return _swigfaiss_gpu.IndexBinaryIVF_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinaryIVF_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryIVF_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexBinaryIVF_add_with_ids(self, n, x, xids) - - def add_core(self, n, x, xids, precomputed_idx): - return _swigfaiss_gpu.IndexBinaryIVF_add_core(self, n, x, xids, precomputed_idx) - - def search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params=None): - return _swigfaiss_gpu.IndexBinaryIVF_search_preassigned(self, n, x, k, assign, centroid_dis, distances, labels, store_pairs, params) - - def get_InvertedListScanner(self, store_pairs=False): - return _swigfaiss_gpu.IndexBinaryIVF_get_InvertedListScanner(self, store_pairs) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryIVF_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexBinaryIVF_reconstruct(self, key, recons) - - def reconstruct_n(self, i0, ni, recons): - return _swigfaiss_gpu.IndexBinaryIVF_reconstruct_n(self, i0, ni, recons) - - def search_and_reconstruct(self, n, x, k, distances, labels, recons): - return _swigfaiss_gpu.IndexBinaryIVF_search_and_reconstruct(self, n, x, k, distances, labels, recons) - - def reconstruct_from_offset(self, list_no, offset, recons): - return _swigfaiss_gpu.IndexBinaryIVF_reconstruct_from_offset(self, list_no, offset, recons) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexBinaryIVF_remove_ids(self, sel) - - def merge_from(self, other, add_id): - return _swigfaiss_gpu.IndexBinaryIVF_merge_from(self, other, add_id) - - def get_list_size(self, list_no): - return _swigfaiss_gpu.IndexBinaryIVF_get_list_size(self, list_no) - - def make_direct_map(self, new_maintain_direct_map=True): - return _swigfaiss_gpu.IndexBinaryIVF_make_direct_map(self, new_maintain_direct_map) - - def replace_invlists(self, il, own=False): - return _swigfaiss_gpu.IndexBinaryIVF_replace_invlists(self, il, own) -IndexBinaryIVF_swigregister = _swigfaiss_gpu.IndexBinaryIVF_swigregister -IndexBinaryIVF_swigregister(IndexBinaryIVF) - -class IndexBinaryFromFloat(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryFromFloat, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryFromFloat, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss_gpu.IndexBinaryFromFloat_index_set - __swig_getmethods__["index"] = _swigfaiss_gpu.IndexBinaryFromFloat_index_get - if _newclass: - index = _swig_property(_swigfaiss_gpu.IndexBinaryFromFloat_index_get, _swigfaiss_gpu.IndexBinaryFromFloat_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryFromFloat_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryFromFloat_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexBinaryFromFloat_own_fields_get, _swigfaiss_gpu.IndexBinaryFromFloat_own_fields_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexBinaryFromFloat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryFromFloat - __del__ = lambda self: None - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryFromFloat_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexBinaryFromFloat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryFromFloat_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinaryFromFloat_train(self, n, x) -IndexBinaryFromFloat_swigregister = _swigfaiss_gpu.IndexBinaryFromFloat_swigregister -IndexBinaryFromFloat_swigregister(IndexBinaryFromFloat) - -class IndexBinaryHNSW(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryHNSW, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryHNSW, name) - __repr__ = _swig_repr - __swig_setmethods__["hnsw"] = _swigfaiss_gpu.IndexBinaryHNSW_hnsw_set - __swig_getmethods__["hnsw"] = _swigfaiss_gpu.IndexBinaryHNSW_hnsw_get - if _newclass: - hnsw = _swig_property(_swigfaiss_gpu.IndexBinaryHNSW_hnsw_get, _swigfaiss_gpu.IndexBinaryHNSW_hnsw_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryHNSW_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryHNSW_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexBinaryHNSW_own_fields_get, _swigfaiss_gpu.IndexBinaryHNSW_own_fields_set) - __swig_setmethods__["storage"] = _swigfaiss_gpu.IndexBinaryHNSW_storage_set - __swig_getmethods__["storage"] = _swigfaiss_gpu.IndexBinaryHNSW_storage_get - if _newclass: - storage = _swig_property(_swigfaiss_gpu.IndexBinaryHNSW_storage_get, _swigfaiss_gpu.IndexBinaryHNSW_storage_set) - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexBinaryHNSW(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryHNSW - __del__ = lambda self: None - - def get_distance_computer(self): - return _swigfaiss_gpu.IndexBinaryHNSW_get_distance_computer(self) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryHNSW_add(self, n, x) - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinaryHNSW_train(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryHNSW_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexBinaryHNSW_reconstruct(self, key, recons) - - def reset(self): - return _swigfaiss_gpu.IndexBinaryHNSW_reset(self) -IndexBinaryHNSW_swigregister = _swigfaiss_gpu.IndexBinaryHNSW_swigregister -IndexBinaryHNSW_swigregister(IndexBinaryHNSW) - -class IndexShards(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexShards, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexShards, name) - __repr__ = _swig_repr - __swig_setmethods__["shard_indexes"] = _swigfaiss_gpu.IndexShards_shard_indexes_set - __swig_getmethods__["shard_indexes"] = _swigfaiss_gpu.IndexShards_shard_indexes_get - if _newclass: - shard_indexes = _swig_property(_swigfaiss_gpu.IndexShards_shard_indexes_get, _swigfaiss_gpu.IndexShards_shard_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexShards_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexShards_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexShards_own_fields_get, _swigfaiss_gpu.IndexShards_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss_gpu.IndexShards_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss_gpu.IndexShards_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss_gpu.IndexShards_threaded_get, _swigfaiss_gpu.IndexShards_threaded_set) - __swig_setmethods__["successive_ids"] = _swigfaiss_gpu.IndexShards_successive_ids_set - __swig_getmethods__["successive_ids"] = _swigfaiss_gpu.IndexShards_successive_ids_get - if _newclass: - successive_ids = _swig_property(_swigfaiss_gpu.IndexShards_successive_ids_get, _swigfaiss_gpu.IndexShards_successive_ids_set) - - def __init__(self, d, threaded=False, successive_ids=True): - this = _swigfaiss_gpu.new_IndexShards(d, threaded, successive_ids) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_shard(self, arg2): - return _swigfaiss_gpu.IndexShards_add_shard(self, arg2) - - def sync_with_shard_indexes(self): - return _swigfaiss_gpu.IndexShards_sync_with_shard_indexes(self) - - def at(self, i): - return _swigfaiss_gpu.IndexShards_at(self, i) - - def add(self, n, x): - return _swigfaiss_gpu.IndexShards_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexShards_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexShards_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss_gpu.IndexShards_train(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexShards_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexShards - __del__ = lambda self: None -IndexShards_swigregister = _swigfaiss_gpu.IndexShards_swigregister -IndexShards_swigregister(IndexShards) - -class IndexBinaryShards(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryShards, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryShards, name) - __repr__ = _swig_repr - __swig_setmethods__["shard_indexes"] = _swigfaiss_gpu.IndexBinaryShards_shard_indexes_set - __swig_getmethods__["shard_indexes"] = _swigfaiss_gpu.IndexBinaryShards_shard_indexes_get - if _newclass: - shard_indexes = _swig_property(_swigfaiss_gpu.IndexBinaryShards_shard_indexes_get, _swigfaiss_gpu.IndexBinaryShards_shard_indexes_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryShards_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryShards_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexBinaryShards_own_fields_get, _swigfaiss_gpu.IndexBinaryShards_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss_gpu.IndexBinaryShards_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss_gpu.IndexBinaryShards_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss_gpu.IndexBinaryShards_threaded_get, _swigfaiss_gpu.IndexBinaryShards_threaded_set) - __swig_setmethods__["successive_ids"] = _swigfaiss_gpu.IndexBinaryShards_successive_ids_set - __swig_getmethods__["successive_ids"] = _swigfaiss_gpu.IndexBinaryShards_successive_ids_get - if _newclass: - successive_ids = _swig_property(_swigfaiss_gpu.IndexBinaryShards_successive_ids_get, _swigfaiss_gpu.IndexBinaryShards_successive_ids_set) - - def __init__(self, d, threaded=False, successive_ids=True): - this = _swigfaiss_gpu.new_IndexBinaryShards(d, threaded, successive_ids) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_shard(self, arg2): - return _swigfaiss_gpu.IndexBinaryShards_add_shard(self, arg2) - - def sync_with_shard_indexes(self): - return _swigfaiss_gpu.IndexBinaryShards_sync_with_shard_indexes(self) - - def at(self, i): - return _swigfaiss_gpu.IndexBinaryShards_at(self, i) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryShards_add(self, n, x) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexBinaryShards_add_with_ids(self, n, x, xids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryShards_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinaryShards_train(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexBinaryShards_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryShards - __del__ = lambda self: None -IndexBinaryShards_swigregister = _swigfaiss_gpu.IndexBinaryShards_swigregister -IndexBinaryShards_swigregister(IndexBinaryShards) - -class IndexReplicas(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexReplicas, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexReplicas, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_IndexReplicas() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexReplicas - __del__ = lambda self: None - - def addIndex(self, index): - return _swigfaiss_gpu.IndexReplicas_addIndex(self, index) - - def removeIndex(self, index): - return _swigfaiss_gpu.IndexReplicas_removeIndex(self, index) - - def runOnIndex(self, f): - return _swigfaiss_gpu.IndexReplicas_runOnIndex(self, f) - - def reset(self): - return _swigfaiss_gpu.IndexReplicas_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.IndexReplicas_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexReplicas_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexReplicas_search(self, n, x, k, distances, labels) - - def reconstruct(self, arg2, v): - return _swigfaiss_gpu.IndexReplicas_reconstruct(self, arg2, v) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexReplicas_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexReplicas_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexReplicas_own_fields_get, _swigfaiss_gpu.IndexReplicas_own_fields_set) - - def count(self): - return _swigfaiss_gpu.IndexReplicas_count(self) - - def at(self, *args): - return _swigfaiss_gpu.IndexReplicas_at(self, *args) -IndexReplicas_swigregister = _swigfaiss_gpu.IndexReplicas_swigregister -IndexReplicas_swigregister(IndexReplicas) - -class IndexBinaryReplicas(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexBinaryReplicas, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexBinaryReplicas, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_IndexBinaryReplicas() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_IndexBinaryReplicas - __del__ = lambda self: None - - def addIndex(self, index): - return _swigfaiss_gpu.IndexBinaryReplicas_addIndex(self, index) - - def removeIndex(self, index): - return _swigfaiss_gpu.IndexBinaryReplicas_removeIndex(self, index) - - def runOnIndex(self, f): - return _swigfaiss_gpu.IndexBinaryReplicas_runOnIndex(self, f) - - def reset(self): - return _swigfaiss_gpu.IndexBinaryReplicas_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.IndexBinaryReplicas_train(self, n, x) - - def add(self, n, x): - return _swigfaiss_gpu.IndexBinaryReplicas_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexBinaryReplicas_search(self, n, x, k, distances, labels) - - def reconstruct(self, arg2, v): - return _swigfaiss_gpu.IndexBinaryReplicas_reconstruct(self, arg2, v) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryReplicas_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexBinaryReplicas_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexBinaryReplicas_own_fields_get, _swigfaiss_gpu.IndexBinaryReplicas_own_fields_set) - - def count(self): - return _swigfaiss_gpu.IndexBinaryReplicas_count(self) - - def at(self, *args): - return _swigfaiss_gpu.IndexBinaryReplicas_at(self, *args) -IndexBinaryReplicas_swigregister = _swigfaiss_gpu.IndexBinaryReplicas_swigregister -IndexBinaryReplicas_swigregister(IndexBinaryReplicas) - -class IndexIDMap(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIDMap, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIDMap, name) - __repr__ = _swig_repr - __swig_setmethods__["index"] = _swigfaiss_gpu.IndexIDMap_index_set - __swig_getmethods__["index"] = _swigfaiss_gpu.IndexIDMap_index_get - if _newclass: - index = _swig_property(_swigfaiss_gpu.IndexIDMap_index_get, _swigfaiss_gpu.IndexIDMap_index_set) - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexIDMap_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexIDMap_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexIDMap_own_fields_get, _swigfaiss_gpu.IndexIDMap_own_fields_set) - __swig_setmethods__["id_map"] = _swigfaiss_gpu.IndexIDMap_id_map_set - __swig_getmethods__["id_map"] = _swigfaiss_gpu.IndexIDMap_id_map_get - if _newclass: - id_map = _swig_property(_swigfaiss_gpu.IndexIDMap_id_map_get, _swigfaiss_gpu.IndexIDMap_id_map_set) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIDMap_add_with_ids(self, n, x, xids) - - def add(self, n, x): - return _swigfaiss_gpu.IndexIDMap_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexIDMap_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss_gpu.IndexIDMap_train(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexIDMap_reset(self) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexIDMap_remove_ids(self, sel) - - def range_search(self, n, x, radius, result): - return _swigfaiss_gpu.IndexIDMap_range_search(self, n, x, radius, result) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIDMap - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIDMap(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexIDMap_swigregister = _swigfaiss_gpu.IndexIDMap_swigregister -IndexIDMap_swigregister(IndexIDMap) - -class IndexIDMap2(IndexIDMap): - __swig_setmethods__ = {} - for _s in [IndexIDMap]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexIDMap2, name, value) - __swig_getmethods__ = {} - for _s in [IndexIDMap]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexIDMap2, name) - __repr__ = _swig_repr - __swig_setmethods__["rev_map"] = _swigfaiss_gpu.IndexIDMap2_rev_map_set - __swig_getmethods__["rev_map"] = _swigfaiss_gpu.IndexIDMap2_rev_map_get - if _newclass: - rev_map = _swig_property(_swigfaiss_gpu.IndexIDMap2_rev_map_get, _swigfaiss_gpu.IndexIDMap2_rev_map_set) - - def construct_rev_map(self): - return _swigfaiss_gpu.IndexIDMap2_construct_rev_map(self) - - def add_with_ids(self, n, x, xids): - return _swigfaiss_gpu.IndexIDMap2_add_with_ids(self, n, x, xids) - - def remove_ids(self, sel): - return _swigfaiss_gpu.IndexIDMap2_remove_ids(self, sel) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.IndexIDMap2_reconstruct(self, key, recons) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexIDMap2 - __del__ = lambda self: None - - def __init__(self, *args): - this = _swigfaiss_gpu.new_IndexIDMap2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -IndexIDMap2_swigregister = _swigfaiss_gpu.IndexIDMap2_swigregister -IndexIDMap2_swigregister(IndexIDMap2) - -class IndexSplitVectors(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IndexSplitVectors, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IndexSplitVectors, name) - __repr__ = _swig_repr - __swig_setmethods__["own_fields"] = _swigfaiss_gpu.IndexSplitVectors_own_fields_set - __swig_getmethods__["own_fields"] = _swigfaiss_gpu.IndexSplitVectors_own_fields_get - if _newclass: - own_fields = _swig_property(_swigfaiss_gpu.IndexSplitVectors_own_fields_get, _swigfaiss_gpu.IndexSplitVectors_own_fields_set) - __swig_setmethods__["threaded"] = _swigfaiss_gpu.IndexSplitVectors_threaded_set - __swig_getmethods__["threaded"] = _swigfaiss_gpu.IndexSplitVectors_threaded_get - if _newclass: - threaded = _swig_property(_swigfaiss_gpu.IndexSplitVectors_threaded_get, _swigfaiss_gpu.IndexSplitVectors_threaded_set) - __swig_setmethods__["sub_indexes"] = _swigfaiss_gpu.IndexSplitVectors_sub_indexes_set - __swig_getmethods__["sub_indexes"] = _swigfaiss_gpu.IndexSplitVectors_sub_indexes_get - if _newclass: - sub_indexes = _swig_property(_swigfaiss_gpu.IndexSplitVectors_sub_indexes_get, _swigfaiss_gpu.IndexSplitVectors_sub_indexes_set) - __swig_setmethods__["sum_d"] = _swigfaiss_gpu.IndexSplitVectors_sum_d_set - __swig_getmethods__["sum_d"] = _swigfaiss_gpu.IndexSplitVectors_sum_d_get - if _newclass: - sum_d = _swig_property(_swigfaiss_gpu.IndexSplitVectors_sum_d_get, _swigfaiss_gpu.IndexSplitVectors_sum_d_set) - - def __init__(self, d, threaded=False): - this = _swigfaiss_gpu.new_IndexSplitVectors(d, threaded) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def add_sub_index(self, arg2): - return _swigfaiss_gpu.IndexSplitVectors_add_sub_index(self, arg2) - - def sync_with_sub_indexes(self): - return _swigfaiss_gpu.IndexSplitVectors_sync_with_sub_indexes(self) - - def add(self, n, x): - return _swigfaiss_gpu.IndexSplitVectors_add(self, n, x) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.IndexSplitVectors_search(self, n, x, k, distances, labels) - - def train(self, n, x): - return _swigfaiss_gpu.IndexSplitVectors_train(self, n, x) - - def reset(self): - return _swigfaiss_gpu.IndexSplitVectors_reset(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IndexSplitVectors - __del__ = lambda self: None -IndexSplitVectors_swigregister = _swigfaiss_gpu.IndexSplitVectors_swigregister -IndexSplitVectors_swigregister(IndexSplitVectors) - -INDICES_CPU = _swigfaiss_gpu.INDICES_CPU -INDICES_IVF = _swigfaiss_gpu.INDICES_IVF -INDICES_32_BIT = _swigfaiss_gpu.INDICES_32_BIT -INDICES_64_BIT = _swigfaiss_gpu.INDICES_64_BIT -class GpuClonerOptions(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuClonerOptions, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GpuClonerOptions, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuClonerOptions() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["indicesOptions"] = _swigfaiss_gpu.GpuClonerOptions_indicesOptions_set - __swig_getmethods__["indicesOptions"] = _swigfaiss_gpu.GpuClonerOptions_indicesOptions_get - if _newclass: - indicesOptions = _swig_property(_swigfaiss_gpu.GpuClonerOptions_indicesOptions_get, _swigfaiss_gpu.GpuClonerOptions_indicesOptions_set) - __swig_setmethods__["useFloat16CoarseQuantizer"] = _swigfaiss_gpu.GpuClonerOptions_useFloat16CoarseQuantizer_set - __swig_getmethods__["useFloat16CoarseQuantizer"] = _swigfaiss_gpu.GpuClonerOptions_useFloat16CoarseQuantizer_get - if _newclass: - useFloat16CoarseQuantizer = _swig_property(_swigfaiss_gpu.GpuClonerOptions_useFloat16CoarseQuantizer_get, _swigfaiss_gpu.GpuClonerOptions_useFloat16CoarseQuantizer_set) - __swig_setmethods__["useFloat16"] = _swigfaiss_gpu.GpuClonerOptions_useFloat16_set - __swig_getmethods__["useFloat16"] = _swigfaiss_gpu.GpuClonerOptions_useFloat16_get - if _newclass: - useFloat16 = _swig_property(_swigfaiss_gpu.GpuClonerOptions_useFloat16_get, _swigfaiss_gpu.GpuClonerOptions_useFloat16_set) - __swig_setmethods__["usePrecomputed"] = _swigfaiss_gpu.GpuClonerOptions_usePrecomputed_set - __swig_getmethods__["usePrecomputed"] = _swigfaiss_gpu.GpuClonerOptions_usePrecomputed_get - if _newclass: - usePrecomputed = _swig_property(_swigfaiss_gpu.GpuClonerOptions_usePrecomputed_get, _swigfaiss_gpu.GpuClonerOptions_usePrecomputed_set) - __swig_setmethods__["reserveVecs"] = _swigfaiss_gpu.GpuClonerOptions_reserveVecs_set - __swig_getmethods__["reserveVecs"] = _swigfaiss_gpu.GpuClonerOptions_reserveVecs_get - if _newclass: - reserveVecs = _swig_property(_swigfaiss_gpu.GpuClonerOptions_reserveVecs_get, _swigfaiss_gpu.GpuClonerOptions_reserveVecs_set) - __swig_setmethods__["storeTransposed"] = _swigfaiss_gpu.GpuClonerOptions_storeTransposed_set - __swig_getmethods__["storeTransposed"] = _swigfaiss_gpu.GpuClonerOptions_storeTransposed_get - if _newclass: - storeTransposed = _swig_property(_swigfaiss_gpu.GpuClonerOptions_storeTransposed_get, _swigfaiss_gpu.GpuClonerOptions_storeTransposed_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.GpuClonerOptions_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.GpuClonerOptions_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.GpuClonerOptions_verbose_get, _swigfaiss_gpu.GpuClonerOptions_verbose_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuClonerOptions - __del__ = lambda self: None -GpuClonerOptions_swigregister = _swigfaiss_gpu.GpuClonerOptions_swigregister -GpuClonerOptions_swigregister(GpuClonerOptions) - -class GpuMultipleClonerOptions(GpuClonerOptions): - __swig_setmethods__ = {} - for _s in [GpuClonerOptions]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuMultipleClonerOptions, name, value) - __swig_getmethods__ = {} - for _s in [GpuClonerOptions]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuMultipleClonerOptions, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuMultipleClonerOptions() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["shard"] = _swigfaiss_gpu.GpuMultipleClonerOptions_shard_set - __swig_getmethods__["shard"] = _swigfaiss_gpu.GpuMultipleClonerOptions_shard_get - if _newclass: - shard = _swig_property(_swigfaiss_gpu.GpuMultipleClonerOptions_shard_get, _swigfaiss_gpu.GpuMultipleClonerOptions_shard_set) - __swig_setmethods__["shard_type"] = _swigfaiss_gpu.GpuMultipleClonerOptions_shard_type_set - __swig_getmethods__["shard_type"] = _swigfaiss_gpu.GpuMultipleClonerOptions_shard_type_get - if _newclass: - shard_type = _swig_property(_swigfaiss_gpu.GpuMultipleClonerOptions_shard_type_get, _swigfaiss_gpu.GpuMultipleClonerOptions_shard_type_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuMultipleClonerOptions - __del__ = lambda self: None -GpuMultipleClonerOptions_swigregister = _swigfaiss_gpu.GpuMultipleClonerOptions_swigregister -GpuMultipleClonerOptions_swigregister(GpuMultipleClonerOptions) - -Device = _swigfaiss_gpu.Device -Unified = _swigfaiss_gpu.Unified -HostPinned = _swigfaiss_gpu.HostPinned - -def allocMemorySpaceV(space, p, size): - return _swigfaiss_gpu.allocMemorySpaceV(space, p, size) -allocMemorySpaceV = _swigfaiss_gpu.allocMemorySpaceV - -def freeMemorySpace(space, p): - return _swigfaiss_gpu.freeMemorySpace(space, p) -freeMemorySpace = _swigfaiss_gpu.freeMemorySpace -class GpuIndexConfig(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexConfig, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["device"] = _swigfaiss_gpu.GpuIndexConfig_device_set - __swig_getmethods__["device"] = _swigfaiss_gpu.GpuIndexConfig_device_get - if _newclass: - device = _swig_property(_swigfaiss_gpu.GpuIndexConfig_device_get, _swigfaiss_gpu.GpuIndexConfig_device_set) - __swig_setmethods__["memorySpace"] = _swigfaiss_gpu.GpuIndexConfig_memorySpace_set - __swig_getmethods__["memorySpace"] = _swigfaiss_gpu.GpuIndexConfig_memorySpace_get - if _newclass: - memorySpace = _swig_property(_swigfaiss_gpu.GpuIndexConfig_memorySpace_get, _swigfaiss_gpu.GpuIndexConfig_memorySpace_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexConfig - __del__ = lambda self: None -GpuIndexConfig_swigregister = _swigfaiss_gpu.GpuIndexConfig_swigregister -GpuIndexConfig_swigregister(GpuIndexConfig) - -class GpuIndex(Index): - __swig_setmethods__ = {} - for _s in [Index]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndex, name, value) - __swig_getmethods__ = {} - for _s in [Index]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndex, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def getDevice(self): - return _swigfaiss_gpu.GpuIndex_getDevice(self) - - def getResources(self): - return _swigfaiss_gpu.GpuIndex_getResources(self) - - def setMinPagingSize(self, size): - return _swigfaiss_gpu.GpuIndex_setMinPagingSize(self, size) - - def getMinPagingSize(self): - return _swigfaiss_gpu.GpuIndex_getMinPagingSize(self) - - def add(self, arg2, x): - return _swigfaiss_gpu.GpuIndex_add(self, arg2, x) - - def add_with_ids(self, n, x, ids): - return _swigfaiss_gpu.GpuIndex_add_with_ids(self, n, x, ids) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.GpuIndex_search(self, n, x, k, distances, labels) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndex - __del__ = lambda self: None -GpuIndex_swigregister = _swigfaiss_gpu.GpuIndex_swigregister -GpuIndex_swigregister(GpuIndex) - -class GpuIndexFlatConfig(GpuIndexConfig): - __swig_setmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexFlatConfig, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexFlatConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexFlatConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["useFloat16"] = _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16_set - __swig_getmethods__["useFloat16"] = _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16_get - if _newclass: - useFloat16 = _swig_property(_swigfaiss_gpu.GpuIndexFlatConfig_useFloat16_get, _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16_set) - __swig_setmethods__["useFloat16Accumulator"] = _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16Accumulator_set - __swig_getmethods__["useFloat16Accumulator"] = _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16Accumulator_get - if _newclass: - useFloat16Accumulator = _swig_property(_swigfaiss_gpu.GpuIndexFlatConfig_useFloat16Accumulator_get, _swigfaiss_gpu.GpuIndexFlatConfig_useFloat16Accumulator_set) - __swig_setmethods__["storeTransposed"] = _swigfaiss_gpu.GpuIndexFlatConfig_storeTransposed_set - __swig_getmethods__["storeTransposed"] = _swigfaiss_gpu.GpuIndexFlatConfig_storeTransposed_get - if _newclass: - storeTransposed = _swig_property(_swigfaiss_gpu.GpuIndexFlatConfig_storeTransposed_get, _swigfaiss_gpu.GpuIndexFlatConfig_storeTransposed_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexFlatConfig - __del__ = lambda self: None -GpuIndexFlatConfig_swigregister = _swigfaiss_gpu.GpuIndexFlatConfig_swigregister -GpuIndexFlatConfig_swigregister(GpuIndexFlatConfig) - -class GpuIndexFlat(GpuIndex): - __swig_setmethods__ = {} - for _s in [GpuIndex]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexFlat, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndex]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexFlat, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexFlat - __del__ = lambda self: None - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexFlat_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexFlat_copyTo(self, index) - - def getNumVecs(self): - return _swigfaiss_gpu.GpuIndexFlat_getNumVecs(self) - - def reset(self): - return _swigfaiss_gpu.GpuIndexFlat_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.GpuIndexFlat_train(self, n, x) - - def add(self, arg2, x): - return _swigfaiss_gpu.GpuIndexFlat_add(self, arg2, x) - - def reconstruct(self, key, out): - return _swigfaiss_gpu.GpuIndexFlat_reconstruct(self, key, out) - - def reconstruct_n(self, i0, num, out): - return _swigfaiss_gpu.GpuIndexFlat_reconstruct_n(self, i0, num, out) - - def getGpuData(self): - return _swigfaiss_gpu.GpuIndexFlat_getGpuData(self) -GpuIndexFlat_swigregister = _swigfaiss_gpu.GpuIndexFlat_swigregister -GpuIndexFlat_swigregister(GpuIndexFlat) - -class GpuIndexFlatL2(GpuIndexFlat): - __swig_setmethods__ = {} - for _s in [GpuIndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexFlatL2, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexFlatL2, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexFlatL2(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexFlatL2_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexFlatL2_copyTo(self, index) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexFlatL2 - __del__ = lambda self: None -GpuIndexFlatL2_swigregister = _swigfaiss_gpu.GpuIndexFlatL2_swigregister -GpuIndexFlatL2_swigregister(GpuIndexFlatL2) - -class GpuIndexFlatIP(GpuIndexFlat): - __swig_setmethods__ = {} - for _s in [GpuIndexFlat]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexFlatIP, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexFlat]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexFlatIP, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexFlatIP(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexFlatIP_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexFlatIP_copyTo(self, index) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexFlatIP - __del__ = lambda self: None -GpuIndexFlatIP_swigregister = _swigfaiss_gpu.GpuIndexFlatIP_swigregister -GpuIndexFlatIP_swigregister(GpuIndexFlatIP) - -class GpuIndexIVFConfig(GpuIndexConfig): - __swig_setmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVFConfig, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVFConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexIVFConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["indicesOptions"] = _swigfaiss_gpu.GpuIndexIVFConfig_indicesOptions_set - __swig_getmethods__["indicesOptions"] = _swigfaiss_gpu.GpuIndexIVFConfig_indicesOptions_get - if _newclass: - indicesOptions = _swig_property(_swigfaiss_gpu.GpuIndexIVFConfig_indicesOptions_get, _swigfaiss_gpu.GpuIndexIVFConfig_indicesOptions_set) - __swig_setmethods__["flatConfig"] = _swigfaiss_gpu.GpuIndexIVFConfig_flatConfig_set - __swig_getmethods__["flatConfig"] = _swigfaiss_gpu.GpuIndexIVFConfig_flatConfig_get - if _newclass: - flatConfig = _swig_property(_swigfaiss_gpu.GpuIndexIVFConfig_flatConfig_get, _swigfaiss_gpu.GpuIndexIVFConfig_flatConfig_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVFConfig - __del__ = lambda self: None -GpuIndexIVFConfig_swigregister = _swigfaiss_gpu.GpuIndexIVFConfig_swigregister -GpuIndexIVFConfig_swigregister(GpuIndexIVFConfig) - -class GpuIndexIVF(GpuIndex): - __swig_setmethods__ = {} - for _s in [GpuIndex]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVF, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndex]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVF, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVF - __del__ = lambda self: None - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexIVF_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexIVF_copyTo(self, index) - - def getNumLists(self): - return _swigfaiss_gpu.GpuIndexIVF_getNumLists(self) - - def getQuantizer(self): - return _swigfaiss_gpu.GpuIndexIVF_getQuantizer(self) - - def setNumProbes(self, nprobe): - return _swigfaiss_gpu.GpuIndexIVF_setNumProbes(self, nprobe) - - def getNumProbes(self): - return _swigfaiss_gpu.GpuIndexIVF_getNumProbes(self) - __swig_setmethods__["cp"] = _swigfaiss_gpu.GpuIndexIVF_cp_set - __swig_getmethods__["cp"] = _swigfaiss_gpu.GpuIndexIVF_cp_get - if _newclass: - cp = _swig_property(_swigfaiss_gpu.GpuIndexIVF_cp_get, _swigfaiss_gpu.GpuIndexIVF_cp_set) -GpuIndexIVF_swigregister = _swigfaiss_gpu.GpuIndexIVF_swigregister -GpuIndexIVF_swigregister(GpuIndexIVF) - -class GpuIndexIVFPQConfig(GpuIndexIVFConfig): - __swig_setmethods__ = {} - for _s in [GpuIndexIVFConfig]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVFPQConfig, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexIVFConfig]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVFPQConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexIVFPQConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["useFloat16LookupTables"] = _swigfaiss_gpu.GpuIndexIVFPQConfig_useFloat16LookupTables_set - __swig_getmethods__["useFloat16LookupTables"] = _swigfaiss_gpu.GpuIndexIVFPQConfig_useFloat16LookupTables_get - if _newclass: - useFloat16LookupTables = _swig_property(_swigfaiss_gpu.GpuIndexIVFPQConfig_useFloat16LookupTables_get, _swigfaiss_gpu.GpuIndexIVFPQConfig_useFloat16LookupTables_set) - __swig_setmethods__["usePrecomputedTables"] = _swigfaiss_gpu.GpuIndexIVFPQConfig_usePrecomputedTables_set - __swig_getmethods__["usePrecomputedTables"] = _swigfaiss_gpu.GpuIndexIVFPQConfig_usePrecomputedTables_get - if _newclass: - usePrecomputedTables = _swig_property(_swigfaiss_gpu.GpuIndexIVFPQConfig_usePrecomputedTables_get, _swigfaiss_gpu.GpuIndexIVFPQConfig_usePrecomputedTables_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVFPQConfig - __del__ = lambda self: None -GpuIndexIVFPQConfig_swigregister = _swigfaiss_gpu.GpuIndexIVFPQConfig_swigregister -GpuIndexIVFPQConfig_swigregister(GpuIndexIVFPQConfig) - -class GpuIndexIVFPQ(GpuIndexIVF): - __swig_setmethods__ = {} - for _s in [GpuIndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVFPQ, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVFPQ, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexIVFPQ(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVFPQ - __del__ = lambda self: None - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexIVFPQ_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexIVFPQ_copyTo(self, index) - - def reserveMemory(self, numVecs): - return _swigfaiss_gpu.GpuIndexIVFPQ_reserveMemory(self, numVecs) - - def setPrecomputedCodes(self, enable): - return _swigfaiss_gpu.GpuIndexIVFPQ_setPrecomputedCodes(self, enable) - - def getPrecomputedCodes(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_getPrecomputedCodes(self) - - def getNumSubQuantizers(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_getNumSubQuantizers(self) - - def getBitsPerCode(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_getBitsPerCode(self) - - def getCentroidsPerSubQuantizer(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_getCentroidsPerSubQuantizer(self) - - def reclaimMemory(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_reclaimMemory(self) - - def reset(self): - return _swigfaiss_gpu.GpuIndexIVFPQ_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.GpuIndexIVFPQ_train(self, n, x) - - def getListLength(self, listId): - return _swigfaiss_gpu.GpuIndexIVFPQ_getListLength(self, listId) - - def getListCodes(self, listId): - return _swigfaiss_gpu.GpuIndexIVFPQ_getListCodes(self, listId) - - def getListIndices(self, listId): - return _swigfaiss_gpu.GpuIndexIVFPQ_getListIndices(self, listId) -GpuIndexIVFPQ_swigregister = _swigfaiss_gpu.GpuIndexIVFPQ_swigregister -GpuIndexIVFPQ_swigregister(GpuIndexIVFPQ) - -class GpuIndexIVFFlatConfig(GpuIndexIVFConfig): - __swig_setmethods__ = {} - for _s in [GpuIndexIVFConfig]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVFFlatConfig, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexIVFConfig]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVFFlatConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexIVFFlatConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["useFloat16IVFStorage"] = _swigfaiss_gpu.GpuIndexIVFFlatConfig_useFloat16IVFStorage_set - __swig_getmethods__["useFloat16IVFStorage"] = _swigfaiss_gpu.GpuIndexIVFFlatConfig_useFloat16IVFStorage_get - if _newclass: - useFloat16IVFStorage = _swig_property(_swigfaiss_gpu.GpuIndexIVFFlatConfig_useFloat16IVFStorage_get, _swigfaiss_gpu.GpuIndexIVFFlatConfig_useFloat16IVFStorage_set) - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVFFlatConfig - __del__ = lambda self: None -GpuIndexIVFFlatConfig_swigregister = _swigfaiss_gpu.GpuIndexIVFFlatConfig_swigregister -GpuIndexIVFFlatConfig_swigregister(GpuIndexIVFFlatConfig) - -class GpuIndexIVFFlat(GpuIndexIVF): - __swig_setmethods__ = {} - for _s in [GpuIndexIVF]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexIVFFlat, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexIVF]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexIVFFlat, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexIVFFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexIVFFlat - __del__ = lambda self: None - - def reserveMemory(self, numVecs): - return _swigfaiss_gpu.GpuIndexIVFFlat_reserveMemory(self, numVecs) - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexIVFFlat_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexIVFFlat_copyTo(self, index) - - def reclaimMemory(self): - return _swigfaiss_gpu.GpuIndexIVFFlat_reclaimMemory(self) - - def reset(self): - return _swigfaiss_gpu.GpuIndexIVFFlat_reset(self) - - def train(self, n, x): - return _swigfaiss_gpu.GpuIndexIVFFlat_train(self, n, x) -GpuIndexIVFFlat_swigregister = _swigfaiss_gpu.GpuIndexIVFFlat_swigregister -GpuIndexIVFFlat_swigregister(GpuIndexIVFFlat) - -class GpuIndexBinaryFlatConfig(GpuIndexConfig): - __swig_setmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexBinaryFlatConfig, name, value) - __swig_getmethods__ = {} - for _s in [GpuIndexConfig]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexBinaryFlatConfig, name) - __repr__ = _swig_repr - - def __init__(self): - this = _swigfaiss_gpu.new_GpuIndexBinaryFlatConfig() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexBinaryFlatConfig - __del__ = lambda self: None -GpuIndexBinaryFlatConfig_swigregister = _swigfaiss_gpu.GpuIndexBinaryFlatConfig_swigregister -GpuIndexBinaryFlatConfig_swigregister(GpuIndexBinaryFlatConfig) - -class GpuIndexBinaryFlat(IndexBinary): - __swig_setmethods__ = {} - for _s in [IndexBinary]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuIndexBinaryFlat, name, value) - __swig_getmethods__ = {} - for _s in [IndexBinary]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuIndexBinaryFlat, name) - __repr__ = _swig_repr - - def __init__(self, *args): - this = _swigfaiss_gpu.new_GpuIndexBinaryFlat(*args) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuIndexBinaryFlat - __del__ = lambda self: None - - def copyFrom(self, index): - return _swigfaiss_gpu.GpuIndexBinaryFlat_copyFrom(self, index) - - def copyTo(self, index): - return _swigfaiss_gpu.GpuIndexBinaryFlat_copyTo(self, index) - - def add(self, n, x): - return _swigfaiss_gpu.GpuIndexBinaryFlat_add(self, n, x) - - def reset(self): - return _swigfaiss_gpu.GpuIndexBinaryFlat_reset(self) - - def search(self, n, x, k, distances, labels): - return _swigfaiss_gpu.GpuIndexBinaryFlat_search(self, n, x, k, distances, labels) - - def reconstruct(self, key, recons): - return _swigfaiss_gpu.GpuIndexBinaryFlat_reconstruct(self, key, recons) -GpuIndexBinaryFlat_swigregister = _swigfaiss_gpu.GpuIndexBinaryFlat_swigregister -GpuIndexBinaryFlat_swigregister(GpuIndexBinaryFlat) - - -def bruteForceKnn(resources, metric, vectors, numVectors, queries, numQueries, dims, k, outDistances, outIndices): - return _swigfaiss_gpu.bruteForceKnn(resources, metric, vectors, numVectors, queries, numQueries, dims, k, outDistances, outIndices) -bruteForceKnn = _swigfaiss_gpu.bruteForceKnn - -def downcast_index(index): - return _swigfaiss_gpu.downcast_index(index) -downcast_index = _swigfaiss_gpu.downcast_index - -def downcast_VectorTransform(vt): - return _swigfaiss_gpu.downcast_VectorTransform(vt) -downcast_VectorTransform = _swigfaiss_gpu.downcast_VectorTransform - -def downcast_IndexBinary(index): - return _swigfaiss_gpu.downcast_IndexBinary(index) -downcast_IndexBinary = _swigfaiss_gpu.downcast_IndexBinary - -def write_index(*args): - return _swigfaiss_gpu.write_index(*args) -write_index = _swigfaiss_gpu.write_index - -def write_index_binary(*args): - return _swigfaiss_gpu.write_index_binary(*args) -write_index_binary = _swigfaiss_gpu.write_index_binary - -def read_index(*args): - return _swigfaiss_gpu.read_index(*args) -read_index = _swigfaiss_gpu.read_index - -def read_index_binary(*args): - return _swigfaiss_gpu.read_index_binary(*args) -read_index_binary = _swigfaiss_gpu.read_index_binary - -def write_VectorTransform(vt, fname): - return _swigfaiss_gpu.write_VectorTransform(vt, fname) -write_VectorTransform = _swigfaiss_gpu.write_VectorTransform - -def read_VectorTransform(fname): - return _swigfaiss_gpu.read_VectorTransform(fname) -read_VectorTransform = _swigfaiss_gpu.read_VectorTransform - -def read_ProductQuantizer(*args): - return _swigfaiss_gpu.read_ProductQuantizer(*args) -read_ProductQuantizer = _swigfaiss_gpu.read_ProductQuantizer - -def write_ProductQuantizer(*args): - return _swigfaiss_gpu.write_ProductQuantizer(*args) -write_ProductQuantizer = _swigfaiss_gpu.write_ProductQuantizer - -def write_InvertedLists(ils, f): - return _swigfaiss_gpu.write_InvertedLists(ils, f) -write_InvertedLists = _swigfaiss_gpu.write_InvertedLists - -def read_InvertedLists(reader, io_flags=0): - return _swigfaiss_gpu.read_InvertedLists(reader, io_flags) -read_InvertedLists = _swigfaiss_gpu.read_InvertedLists - -def clone_index(arg1): - return _swigfaiss_gpu.clone_index(arg1) -clone_index = _swigfaiss_gpu.clone_index -class Cloner(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Cloner, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Cloner, name) - __repr__ = _swig_repr - - def clone_VectorTransform(self, arg2): - return _swigfaiss_gpu.Cloner_clone_VectorTransform(self, arg2) - - def clone_Index(self, arg2): - return _swigfaiss_gpu.Cloner_clone_Index(self, arg2) - - def clone_IndexIVF(self, arg2): - return _swigfaiss_gpu.Cloner_clone_IndexIVF(self, arg2) - __swig_destroy__ = _swigfaiss_gpu.delete_Cloner - __del__ = lambda self: None - - def __init__(self): - this = _swigfaiss_gpu.new_Cloner() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this -Cloner_swigregister = _swigfaiss_gpu.Cloner_swigregister -Cloner_swigregister(Cloner) -IO_FLAG_MMAP = cvar.IO_FLAG_MMAP -IO_FLAG_READ_ONLY = cvar.IO_FLAG_READ_ONLY -IO_FLAG_ONDISK_SAME_DIR = cvar.IO_FLAG_ONDISK_SAME_DIR - -class AutoTuneCriterion(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, AutoTuneCriterion, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, AutoTuneCriterion, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss_gpu.AutoTuneCriterion_nq_set - __swig_getmethods__["nq"] = _swigfaiss_gpu.AutoTuneCriterion_nq_get - if _newclass: - nq = _swig_property(_swigfaiss_gpu.AutoTuneCriterion_nq_get, _swigfaiss_gpu.AutoTuneCriterion_nq_set) - __swig_setmethods__["nnn"] = _swigfaiss_gpu.AutoTuneCriterion_nnn_set - __swig_getmethods__["nnn"] = _swigfaiss_gpu.AutoTuneCriterion_nnn_get - if _newclass: - nnn = _swig_property(_swigfaiss_gpu.AutoTuneCriterion_nnn_get, _swigfaiss_gpu.AutoTuneCriterion_nnn_set) - __swig_setmethods__["gt_nnn"] = _swigfaiss_gpu.AutoTuneCriterion_gt_nnn_set - __swig_getmethods__["gt_nnn"] = _swigfaiss_gpu.AutoTuneCriterion_gt_nnn_get - if _newclass: - gt_nnn = _swig_property(_swigfaiss_gpu.AutoTuneCriterion_gt_nnn_get, _swigfaiss_gpu.AutoTuneCriterion_gt_nnn_set) - __swig_setmethods__["gt_D"] = _swigfaiss_gpu.AutoTuneCriterion_gt_D_set - __swig_getmethods__["gt_D"] = _swigfaiss_gpu.AutoTuneCriterion_gt_D_get - if _newclass: - gt_D = _swig_property(_swigfaiss_gpu.AutoTuneCriterion_gt_D_get, _swigfaiss_gpu.AutoTuneCriterion_gt_D_set) - __swig_setmethods__["gt_I"] = _swigfaiss_gpu.AutoTuneCriterion_gt_I_set - __swig_getmethods__["gt_I"] = _swigfaiss_gpu.AutoTuneCriterion_gt_I_get - if _newclass: - gt_I = _swig_property(_swigfaiss_gpu.AutoTuneCriterion_gt_I_get, _swigfaiss_gpu.AutoTuneCriterion_gt_I_set) - - def set_groundtruth(self, gt_nnn, gt_D_in, gt_I_in): - return _swigfaiss_gpu.AutoTuneCriterion_set_groundtruth(self, gt_nnn, gt_D_in, gt_I_in) - - def evaluate(self, D, I): - return _swigfaiss_gpu.AutoTuneCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss_gpu.delete_AutoTuneCriterion - __del__ = lambda self: None -AutoTuneCriterion_swigregister = _swigfaiss_gpu.AutoTuneCriterion_swigregister -AutoTuneCriterion_swigregister(AutoTuneCriterion) - -class OneRecallAtRCriterion(AutoTuneCriterion): - __swig_setmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, OneRecallAtRCriterion, name, value) - __swig_getmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, OneRecallAtRCriterion, name) - __repr__ = _swig_repr - __swig_setmethods__["R"] = _swigfaiss_gpu.OneRecallAtRCriterion_R_set - __swig_getmethods__["R"] = _swigfaiss_gpu.OneRecallAtRCriterion_R_get - if _newclass: - R = _swig_property(_swigfaiss_gpu.OneRecallAtRCriterion_R_get, _swigfaiss_gpu.OneRecallAtRCriterion_R_set) - - def __init__(self, nq, R): - this = _swigfaiss_gpu.new_OneRecallAtRCriterion(nq, R) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def evaluate(self, D, I): - return _swigfaiss_gpu.OneRecallAtRCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss_gpu.delete_OneRecallAtRCriterion - __del__ = lambda self: None -OneRecallAtRCriterion_swigregister = _swigfaiss_gpu.OneRecallAtRCriterion_swigregister -OneRecallAtRCriterion_swigregister(OneRecallAtRCriterion) - -class IntersectionCriterion(AutoTuneCriterion): - __swig_setmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IntersectionCriterion, name, value) - __swig_getmethods__ = {} - for _s in [AutoTuneCriterion]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IntersectionCriterion, name) - __repr__ = _swig_repr - __swig_setmethods__["R"] = _swigfaiss_gpu.IntersectionCriterion_R_set - __swig_getmethods__["R"] = _swigfaiss_gpu.IntersectionCriterion_R_get - if _newclass: - R = _swig_property(_swigfaiss_gpu.IntersectionCriterion_R_get, _swigfaiss_gpu.IntersectionCriterion_R_set) - - def __init__(self, nq, R): - this = _swigfaiss_gpu.new_IntersectionCriterion(nq, R) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def evaluate(self, D, I): - return _swigfaiss_gpu.IntersectionCriterion_evaluate(self, D, I) - __swig_destroy__ = _swigfaiss_gpu.delete_IntersectionCriterion - __del__ = lambda self: None -IntersectionCriterion_swigregister = _swigfaiss_gpu.IntersectionCriterion_swigregister -IntersectionCriterion_swigregister(IntersectionCriterion) - -class OperatingPoint(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPoint, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPoint, name) - __repr__ = _swig_repr - __swig_setmethods__["perf"] = _swigfaiss_gpu.OperatingPoint_perf_set - __swig_getmethods__["perf"] = _swigfaiss_gpu.OperatingPoint_perf_get - if _newclass: - perf = _swig_property(_swigfaiss_gpu.OperatingPoint_perf_get, _swigfaiss_gpu.OperatingPoint_perf_set) - __swig_setmethods__["t"] = _swigfaiss_gpu.OperatingPoint_t_set - __swig_getmethods__["t"] = _swigfaiss_gpu.OperatingPoint_t_get - if _newclass: - t = _swig_property(_swigfaiss_gpu.OperatingPoint_t_get, _swigfaiss_gpu.OperatingPoint_t_set) - __swig_setmethods__["key"] = _swigfaiss_gpu.OperatingPoint_key_set - __swig_getmethods__["key"] = _swigfaiss_gpu.OperatingPoint_key_get - if _newclass: - key = _swig_property(_swigfaiss_gpu.OperatingPoint_key_get, _swigfaiss_gpu.OperatingPoint_key_set) - __swig_setmethods__["cno"] = _swigfaiss_gpu.OperatingPoint_cno_set - __swig_getmethods__["cno"] = _swigfaiss_gpu.OperatingPoint_cno_get - if _newclass: - cno = _swig_property(_swigfaiss_gpu.OperatingPoint_cno_get, _swigfaiss_gpu.OperatingPoint_cno_set) - - def __init__(self): - this = _swigfaiss_gpu.new_OperatingPoint() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_OperatingPoint - __del__ = lambda self: None -OperatingPoint_swigregister = _swigfaiss_gpu.OperatingPoint_swigregister -OperatingPoint_swigregister(OperatingPoint) - -class OperatingPoints(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, OperatingPoints, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, OperatingPoints, name) - __repr__ = _swig_repr - __swig_setmethods__["all_pts"] = _swigfaiss_gpu.OperatingPoints_all_pts_set - __swig_getmethods__["all_pts"] = _swigfaiss_gpu.OperatingPoints_all_pts_get - if _newclass: - all_pts = _swig_property(_swigfaiss_gpu.OperatingPoints_all_pts_get, _swigfaiss_gpu.OperatingPoints_all_pts_set) - __swig_setmethods__["optimal_pts"] = _swigfaiss_gpu.OperatingPoints_optimal_pts_set - __swig_getmethods__["optimal_pts"] = _swigfaiss_gpu.OperatingPoints_optimal_pts_get - if _newclass: - optimal_pts = _swig_property(_swigfaiss_gpu.OperatingPoints_optimal_pts_get, _swigfaiss_gpu.OperatingPoints_optimal_pts_set) - - def __init__(self): - this = _swigfaiss_gpu.new_OperatingPoints() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def merge_with(self, *args): - return _swigfaiss_gpu.OperatingPoints_merge_with(self, *args) - - def clear(self): - return _swigfaiss_gpu.OperatingPoints_clear(self) - - def add(self, perf, t, key, cno=0): - return _swigfaiss_gpu.OperatingPoints_add(self, perf, t, key, cno) - - def t_for_perf(self, perf): - return _swigfaiss_gpu.OperatingPoints_t_for_perf(self, perf) - - def display(self, only_optimal=True): - return _swigfaiss_gpu.OperatingPoints_display(self, only_optimal) - - def all_to_gnuplot(self, fname): - return _swigfaiss_gpu.OperatingPoints_all_to_gnuplot(self, fname) - - def optimal_to_gnuplot(self, fname): - return _swigfaiss_gpu.OperatingPoints_optimal_to_gnuplot(self, fname) - __swig_destroy__ = _swigfaiss_gpu.delete_OperatingPoints - __del__ = lambda self: None -OperatingPoints_swigregister = _swigfaiss_gpu.OperatingPoints_swigregister -OperatingPoints_swigregister(OperatingPoints) - -class ParameterRange(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ParameterRange, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ParameterRange, name) - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss_gpu.ParameterRange_name_set - __swig_getmethods__["name"] = _swigfaiss_gpu.ParameterRange_name_get - if _newclass: - name = _swig_property(_swigfaiss_gpu.ParameterRange_name_get, _swigfaiss_gpu.ParameterRange_name_set) - __swig_setmethods__["values"] = _swigfaiss_gpu.ParameterRange_values_set - __swig_getmethods__["values"] = _swigfaiss_gpu.ParameterRange_values_get - if _newclass: - values = _swig_property(_swigfaiss_gpu.ParameterRange_values_get, _swigfaiss_gpu.ParameterRange_values_set) - - def __init__(self): - this = _swigfaiss_gpu.new_ParameterRange() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_ParameterRange - __del__ = lambda self: None -ParameterRange_swigregister = _swigfaiss_gpu.ParameterRange_swigregister -ParameterRange_swigregister(ParameterRange) - -class ParameterSpace(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, ParameterSpace, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, ParameterSpace, name) - __repr__ = _swig_repr - __swig_setmethods__["parameter_ranges"] = _swigfaiss_gpu.ParameterSpace_parameter_ranges_set - __swig_getmethods__["parameter_ranges"] = _swigfaiss_gpu.ParameterSpace_parameter_ranges_get - if _newclass: - parameter_ranges = _swig_property(_swigfaiss_gpu.ParameterSpace_parameter_ranges_get, _swigfaiss_gpu.ParameterSpace_parameter_ranges_set) - __swig_setmethods__["verbose"] = _swigfaiss_gpu.ParameterSpace_verbose_set - __swig_getmethods__["verbose"] = _swigfaiss_gpu.ParameterSpace_verbose_get - if _newclass: - verbose = _swig_property(_swigfaiss_gpu.ParameterSpace_verbose_get, _swigfaiss_gpu.ParameterSpace_verbose_set) - __swig_setmethods__["n_experiments"] = _swigfaiss_gpu.ParameterSpace_n_experiments_set - __swig_getmethods__["n_experiments"] = _swigfaiss_gpu.ParameterSpace_n_experiments_get - if _newclass: - n_experiments = _swig_property(_swigfaiss_gpu.ParameterSpace_n_experiments_get, _swigfaiss_gpu.ParameterSpace_n_experiments_set) - __swig_setmethods__["batchsize"] = _swigfaiss_gpu.ParameterSpace_batchsize_set - __swig_getmethods__["batchsize"] = _swigfaiss_gpu.ParameterSpace_batchsize_get - if _newclass: - batchsize = _swig_property(_swigfaiss_gpu.ParameterSpace_batchsize_get, _swigfaiss_gpu.ParameterSpace_batchsize_set) - __swig_setmethods__["thread_over_batches"] = _swigfaiss_gpu.ParameterSpace_thread_over_batches_set - __swig_getmethods__["thread_over_batches"] = _swigfaiss_gpu.ParameterSpace_thread_over_batches_get - if _newclass: - thread_over_batches = _swig_property(_swigfaiss_gpu.ParameterSpace_thread_over_batches_get, _swigfaiss_gpu.ParameterSpace_thread_over_batches_set) - __swig_setmethods__["min_test_duration"] = _swigfaiss_gpu.ParameterSpace_min_test_duration_set - __swig_getmethods__["min_test_duration"] = _swigfaiss_gpu.ParameterSpace_min_test_duration_get - if _newclass: - min_test_duration = _swig_property(_swigfaiss_gpu.ParameterSpace_min_test_duration_get, _swigfaiss_gpu.ParameterSpace_min_test_duration_set) - - def __init__(self): - this = _swigfaiss_gpu.new_ParameterSpace() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def n_combinations(self): - return _swigfaiss_gpu.ParameterSpace_n_combinations(self) - - def combination_ge(self, c1, c2): - return _swigfaiss_gpu.ParameterSpace_combination_ge(self, c1, c2) - - def combination_name(self, cno): - return _swigfaiss_gpu.ParameterSpace_combination_name(self, cno) - - def display(self): - return _swigfaiss_gpu.ParameterSpace_display(self) - - def add_range(self, name): - return _swigfaiss_gpu.ParameterSpace_add_range(self, name) - - def initialize(self, index): - return _swigfaiss_gpu.ParameterSpace_initialize(self, index) - - def set_index_parameters(self, *args): - return _swigfaiss_gpu.ParameterSpace_set_index_parameters(self, *args) - - def set_index_parameter(self, index, name, val): - return _swigfaiss_gpu.ParameterSpace_set_index_parameter(self, index, name, val) - - def update_bounds(self, cno, op, upper_bound_perf, lower_bound_t): - return _swigfaiss_gpu.ParameterSpace_update_bounds(self, cno, op, upper_bound_perf, lower_bound_t) - - def explore(self, index, nq, xq, crit, ops): - return _swigfaiss_gpu.ParameterSpace_explore(self, index, nq, xq, crit, ops) - __swig_destroy__ = _swigfaiss_gpu.delete_ParameterSpace - __del__ = lambda self: None -ParameterSpace_swigregister = _swigfaiss_gpu.ParameterSpace_swigregister -ParameterSpace_swigregister(ParameterSpace) - - -def index_factory(*args): - return _swigfaiss_gpu.index_factory(*args) -index_factory = _swigfaiss_gpu.index_factory - -def index_binary_factory(d, description): - return _swigfaiss_gpu.index_binary_factory(d, description) -index_binary_factory = _swigfaiss_gpu.index_binary_factory -class MatrixStats(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, MatrixStats, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, MatrixStats, name) - __repr__ = _swig_repr - - def __init__(self, n, d, x): - this = _swigfaiss_gpu.new_MatrixStats(n, d, x) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["comments"] = _swigfaiss_gpu.MatrixStats_comments_set - __swig_getmethods__["comments"] = _swigfaiss_gpu.MatrixStats_comments_get - if _newclass: - comments = _swig_property(_swigfaiss_gpu.MatrixStats_comments_get, _swigfaiss_gpu.MatrixStats_comments_set) - __swig_setmethods__["n"] = _swigfaiss_gpu.MatrixStats_n_set - __swig_getmethods__["n"] = _swigfaiss_gpu.MatrixStats_n_get - if _newclass: - n = _swig_property(_swigfaiss_gpu.MatrixStats_n_get, _swigfaiss_gpu.MatrixStats_n_set) - __swig_setmethods__["d"] = _swigfaiss_gpu.MatrixStats_d_set - __swig_getmethods__["d"] = _swigfaiss_gpu.MatrixStats_d_get - if _newclass: - d = _swig_property(_swigfaiss_gpu.MatrixStats_d_get, _swigfaiss_gpu.MatrixStats_d_set) - __swig_setmethods__["n_collision"] = _swigfaiss_gpu.MatrixStats_n_collision_set - __swig_getmethods__["n_collision"] = _swigfaiss_gpu.MatrixStats_n_collision_get - if _newclass: - n_collision = _swig_property(_swigfaiss_gpu.MatrixStats_n_collision_get, _swigfaiss_gpu.MatrixStats_n_collision_set) - __swig_setmethods__["n_valid"] = _swigfaiss_gpu.MatrixStats_n_valid_set - __swig_getmethods__["n_valid"] = _swigfaiss_gpu.MatrixStats_n_valid_get - if _newclass: - n_valid = _swig_property(_swigfaiss_gpu.MatrixStats_n_valid_get, _swigfaiss_gpu.MatrixStats_n_valid_set) - __swig_setmethods__["n0"] = _swigfaiss_gpu.MatrixStats_n0_set - __swig_getmethods__["n0"] = _swigfaiss_gpu.MatrixStats_n0_get - if _newclass: - n0 = _swig_property(_swigfaiss_gpu.MatrixStats_n0_get, _swigfaiss_gpu.MatrixStats_n0_set) - __swig_setmethods__["min_norm2"] = _swigfaiss_gpu.MatrixStats_min_norm2_set - __swig_getmethods__["min_norm2"] = _swigfaiss_gpu.MatrixStats_min_norm2_get - if _newclass: - min_norm2 = _swig_property(_swigfaiss_gpu.MatrixStats_min_norm2_get, _swigfaiss_gpu.MatrixStats_min_norm2_set) - __swig_setmethods__["max_norm2"] = _swigfaiss_gpu.MatrixStats_max_norm2_set - __swig_getmethods__["max_norm2"] = _swigfaiss_gpu.MatrixStats_max_norm2_get - if _newclass: - max_norm2 = _swig_property(_swigfaiss_gpu.MatrixStats_max_norm2_get, _swigfaiss_gpu.MatrixStats_max_norm2_set) - __swig_setmethods__["per_dim_stats"] = _swigfaiss_gpu.MatrixStats_per_dim_stats_set - __swig_getmethods__["per_dim_stats"] = _swigfaiss_gpu.MatrixStats_per_dim_stats_get - if _newclass: - per_dim_stats = _swig_property(_swigfaiss_gpu.MatrixStats_per_dim_stats_get, _swigfaiss_gpu.MatrixStats_per_dim_stats_set) - __swig_setmethods__["occurrences"] = _swigfaiss_gpu.MatrixStats_occurrences_set - __swig_getmethods__["occurrences"] = _swigfaiss_gpu.MatrixStats_occurrences_get - if _newclass: - occurrences = _swig_property(_swigfaiss_gpu.MatrixStats_occurrences_get, _swigfaiss_gpu.MatrixStats_occurrences_set) - __swig_setmethods__["buf"] = _swigfaiss_gpu.MatrixStats_buf_set - __swig_getmethods__["buf"] = _swigfaiss_gpu.MatrixStats_buf_get - if _newclass: - buf = _swig_property(_swigfaiss_gpu.MatrixStats_buf_get, _swigfaiss_gpu.MatrixStats_buf_set) - __swig_setmethods__["nbuf"] = _swigfaiss_gpu.MatrixStats_nbuf_set - __swig_getmethods__["nbuf"] = _swigfaiss_gpu.MatrixStats_nbuf_get - if _newclass: - nbuf = _swig_property(_swigfaiss_gpu.MatrixStats_nbuf_get, _swigfaiss_gpu.MatrixStats_nbuf_set) - - def do_comment(self, fmt): - return _swigfaiss_gpu.MatrixStats_do_comment(self, fmt) - __swig_destroy__ = _swigfaiss_gpu.delete_MatrixStats - __del__ = lambda self: None -MatrixStats_swigregister = _swigfaiss_gpu.MatrixStats_swigregister -MatrixStats_swigregister(MatrixStats) - - -def index_gpu_to_cpu(gpu_index): - return _swigfaiss_gpu.index_gpu_to_cpu(gpu_index) -index_gpu_to_cpu = _swigfaiss_gpu.index_gpu_to_cpu - -def index_cpu_to_gpu(resources, device, index, options=None): - return _swigfaiss_gpu.index_cpu_to_gpu(resources, device, index, options) -index_cpu_to_gpu = _swigfaiss_gpu.index_cpu_to_gpu - -def index_cpu_to_gpu_multiple(resources, devices, index, options=None): - return _swigfaiss_gpu.index_cpu_to_gpu_multiple(resources, devices, index, options) -index_cpu_to_gpu_multiple = _swigfaiss_gpu.index_cpu_to_gpu_multiple -class GpuParameterSpace(ParameterSpace): - __swig_setmethods__ = {} - for _s in [ParameterSpace]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, GpuParameterSpace, name, value) - __swig_getmethods__ = {} - for _s in [ParameterSpace]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, GpuParameterSpace, name) - __repr__ = _swig_repr - - def initialize(self, index): - return _swigfaiss_gpu.GpuParameterSpace_initialize(self, index) - - def set_index_parameter(self, index, name, val): - return _swigfaiss_gpu.GpuParameterSpace_set_index_parameter(self, index, name, val) - - def __init__(self): - this = _swigfaiss_gpu.new_GpuParameterSpace() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_GpuParameterSpace - __del__ = lambda self: None -GpuParameterSpace_swigregister = _swigfaiss_gpu.GpuParameterSpace_swigregister -GpuParameterSpace_swigregister(GpuParameterSpace) - - -def swig_ptr(a): - return _swigfaiss_gpu.swig_ptr(a) -swig_ptr = _swigfaiss_gpu.swig_ptr - -def rev_swig_ptr(*args): - return _swigfaiss_gpu.rev_swig_ptr(*args) -rev_swig_ptr = _swigfaiss_gpu.rev_swig_ptr -class float_minheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, float_minheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, float_minheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss_gpu.float_minheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss_gpu.float_minheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss_gpu.float_minheap_array_t_nh_get, _swigfaiss_gpu.float_minheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.float_minheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.float_minheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.float_minheap_array_t_k_get, _swigfaiss_gpu.float_minheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss_gpu.float_minheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss_gpu.float_minheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss_gpu.float_minheap_array_t_ids_get, _swigfaiss_gpu.float_minheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss_gpu.float_minheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss_gpu.float_minheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss_gpu.float_minheap_array_t_val_get, _swigfaiss_gpu.float_minheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss_gpu.float_minheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss_gpu.float_minheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss_gpu.float_minheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss_gpu.float_minheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss_gpu.float_minheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss_gpu.float_minheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss_gpu.float_minheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss_gpu.new_float_minheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_float_minheap_array_t - __del__ = lambda self: None -float_minheap_array_t_swigregister = _swigfaiss_gpu.float_minheap_array_t_swigregister -float_minheap_array_t_swigregister(float_minheap_array_t) - -class int_minheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, int_minheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, int_minheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss_gpu.int_minheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss_gpu.int_minheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss_gpu.int_minheap_array_t_nh_get, _swigfaiss_gpu.int_minheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.int_minheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.int_minheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.int_minheap_array_t_k_get, _swigfaiss_gpu.int_minheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss_gpu.int_minheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss_gpu.int_minheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss_gpu.int_minheap_array_t_ids_get, _swigfaiss_gpu.int_minheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss_gpu.int_minheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss_gpu.int_minheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss_gpu.int_minheap_array_t_val_get, _swigfaiss_gpu.int_minheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss_gpu.int_minheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss_gpu.int_minheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss_gpu.int_minheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss_gpu.int_minheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss_gpu.int_minheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss_gpu.int_minheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss_gpu.int_minheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss_gpu.new_int_minheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_int_minheap_array_t - __del__ = lambda self: None -int_minheap_array_t_swigregister = _swigfaiss_gpu.int_minheap_array_t_swigregister -int_minheap_array_t_swigregister(int_minheap_array_t) - -class float_maxheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, float_maxheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, float_maxheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss_gpu.float_maxheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss_gpu.float_maxheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss_gpu.float_maxheap_array_t_nh_get, _swigfaiss_gpu.float_maxheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.float_maxheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.float_maxheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.float_maxheap_array_t_k_get, _swigfaiss_gpu.float_maxheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss_gpu.float_maxheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss_gpu.float_maxheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss_gpu.float_maxheap_array_t_ids_get, _swigfaiss_gpu.float_maxheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss_gpu.float_maxheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss_gpu.float_maxheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss_gpu.float_maxheap_array_t_val_get, _swigfaiss_gpu.float_maxheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss_gpu.float_maxheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss_gpu.float_maxheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss_gpu.float_maxheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss_gpu.float_maxheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss_gpu.float_maxheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss_gpu.float_maxheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss_gpu.float_maxheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss_gpu.new_float_maxheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_float_maxheap_array_t - __del__ = lambda self: None -float_maxheap_array_t_swigregister = _swigfaiss_gpu.float_maxheap_array_t_swigregister -float_maxheap_array_t_swigregister(float_maxheap_array_t) - -class int_maxheap_array_t(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, int_maxheap_array_t, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, int_maxheap_array_t, name) - __repr__ = _swig_repr - __swig_setmethods__["nh"] = _swigfaiss_gpu.int_maxheap_array_t_nh_set - __swig_getmethods__["nh"] = _swigfaiss_gpu.int_maxheap_array_t_nh_get - if _newclass: - nh = _swig_property(_swigfaiss_gpu.int_maxheap_array_t_nh_get, _swigfaiss_gpu.int_maxheap_array_t_nh_set) - __swig_setmethods__["k"] = _swigfaiss_gpu.int_maxheap_array_t_k_set - __swig_getmethods__["k"] = _swigfaiss_gpu.int_maxheap_array_t_k_get - if _newclass: - k = _swig_property(_swigfaiss_gpu.int_maxheap_array_t_k_get, _swigfaiss_gpu.int_maxheap_array_t_k_set) - __swig_setmethods__["ids"] = _swigfaiss_gpu.int_maxheap_array_t_ids_set - __swig_getmethods__["ids"] = _swigfaiss_gpu.int_maxheap_array_t_ids_get - if _newclass: - ids = _swig_property(_swigfaiss_gpu.int_maxheap_array_t_ids_get, _swigfaiss_gpu.int_maxheap_array_t_ids_set) - __swig_setmethods__["val"] = _swigfaiss_gpu.int_maxheap_array_t_val_set - __swig_getmethods__["val"] = _swigfaiss_gpu.int_maxheap_array_t_val_get - if _newclass: - val = _swig_property(_swigfaiss_gpu.int_maxheap_array_t_val_get, _swigfaiss_gpu.int_maxheap_array_t_val_set) - - def get_val(self, key): - return _swigfaiss_gpu.int_maxheap_array_t_get_val(self, key) - - def get_ids(self, key): - return _swigfaiss_gpu.int_maxheap_array_t_get_ids(self, key) - - def heapify(self): - return _swigfaiss_gpu.int_maxheap_array_t_heapify(self) - - def addn(self, nj, vin, j0=0, i0=0, ni=-1): - return _swigfaiss_gpu.int_maxheap_array_t_addn(self, nj, vin, j0, i0, ni) - - def addn_with_ids(self, nj, vin, id_in=None, id_stride=0, i0=0, ni=-1): - return _swigfaiss_gpu.int_maxheap_array_t_addn_with_ids(self, nj, vin, id_in, id_stride, i0, ni) - - def reorder(self): - return _swigfaiss_gpu.int_maxheap_array_t_reorder(self) - - def per_line_extrema(self, vals_out, idx_out): - return _swigfaiss_gpu.int_maxheap_array_t_per_line_extrema(self, vals_out, idx_out) - - def __init__(self): - this = _swigfaiss_gpu.new_int_maxheap_array_t() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_int_maxheap_array_t - __del__ = lambda self: None -int_maxheap_array_t_swigregister = _swigfaiss_gpu.int_maxheap_array_t_swigregister -int_maxheap_array_t_swigregister(int_maxheap_array_t) - - -def omp_set_num_threads(num_threads): - return _swigfaiss_gpu.omp_set_num_threads(num_threads) -omp_set_num_threads = _swigfaiss_gpu.omp_set_num_threads - -def omp_get_max_threads(): - return _swigfaiss_gpu.omp_get_max_threads() -omp_get_max_threads = _swigfaiss_gpu.omp_get_max_threads - -def memcpy(dest, src, n): - return _swigfaiss_gpu.memcpy(dest, src, n) -memcpy = _swigfaiss_gpu.memcpy - -def cast_integer_to_float_ptr(x): - return _swigfaiss_gpu.cast_integer_to_float_ptr(x) -cast_integer_to_float_ptr = _swigfaiss_gpu.cast_integer_to_float_ptr - -def cast_integer_to_long_ptr(x): - return _swigfaiss_gpu.cast_integer_to_long_ptr(x) -cast_integer_to_long_ptr = _swigfaiss_gpu.cast_integer_to_long_ptr - -def cast_integer_to_int_ptr(x): - return _swigfaiss_gpu.cast_integer_to_int_ptr(x) -cast_integer_to_int_ptr = _swigfaiss_gpu.cast_integer_to_int_ptr -class RangeSearchResult(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeSearchResult, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RangeSearchResult, name) - __repr__ = _swig_repr - __swig_setmethods__["nq"] = _swigfaiss_gpu.RangeSearchResult_nq_set - __swig_getmethods__["nq"] = _swigfaiss_gpu.RangeSearchResult_nq_get - if _newclass: - nq = _swig_property(_swigfaiss_gpu.RangeSearchResult_nq_get, _swigfaiss_gpu.RangeSearchResult_nq_set) - __swig_setmethods__["lims"] = _swigfaiss_gpu.RangeSearchResult_lims_set - __swig_getmethods__["lims"] = _swigfaiss_gpu.RangeSearchResult_lims_get - if _newclass: - lims = _swig_property(_swigfaiss_gpu.RangeSearchResult_lims_get, _swigfaiss_gpu.RangeSearchResult_lims_set) - __swig_setmethods__["labels"] = _swigfaiss_gpu.RangeSearchResult_labels_set - __swig_getmethods__["labels"] = _swigfaiss_gpu.RangeSearchResult_labels_get - if _newclass: - labels = _swig_property(_swigfaiss_gpu.RangeSearchResult_labels_get, _swigfaiss_gpu.RangeSearchResult_labels_set) - __swig_setmethods__["distances"] = _swigfaiss_gpu.RangeSearchResult_distances_set - __swig_getmethods__["distances"] = _swigfaiss_gpu.RangeSearchResult_distances_get - if _newclass: - distances = _swig_property(_swigfaiss_gpu.RangeSearchResult_distances_get, _swigfaiss_gpu.RangeSearchResult_distances_set) - __swig_setmethods__["buffer_size"] = _swigfaiss_gpu.RangeSearchResult_buffer_size_set - __swig_getmethods__["buffer_size"] = _swigfaiss_gpu.RangeSearchResult_buffer_size_get - if _newclass: - buffer_size = _swig_property(_swigfaiss_gpu.RangeSearchResult_buffer_size_get, _swigfaiss_gpu.RangeSearchResult_buffer_size_set) - - def __init__(self, nq, alloc_lims=True): - this = _swigfaiss_gpu.new_RangeSearchResult(nq, alloc_lims) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def do_allocation(self): - return _swigfaiss_gpu.RangeSearchResult_do_allocation(self) - __swig_destroy__ = _swigfaiss_gpu.delete_RangeSearchResult - __del__ = lambda self: None -RangeSearchResult_swigregister = _swigfaiss_gpu.RangeSearchResult_swigregister -RangeSearchResult_swigregister(RangeSearchResult) - -class IDSelector(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelector, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IDSelector, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def is_member(self, id): - return _swigfaiss_gpu.IDSelector_is_member(self, id) - __swig_destroy__ = _swigfaiss_gpu.delete_IDSelector - __del__ = lambda self: None -IDSelector_swigregister = _swigfaiss_gpu.IDSelector_swigregister -IDSelector_swigregister(IDSelector) - -class IDSelectorRange(IDSelector): - __swig_setmethods__ = {} - for _s in [IDSelector]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelectorRange, name, value) - __swig_getmethods__ = {} - for _s in [IDSelector]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IDSelectorRange, name) - __repr__ = _swig_repr - __swig_setmethods__["imin"] = _swigfaiss_gpu.IDSelectorRange_imin_set - __swig_getmethods__["imin"] = _swigfaiss_gpu.IDSelectorRange_imin_get - if _newclass: - imin = _swig_property(_swigfaiss_gpu.IDSelectorRange_imin_get, _swigfaiss_gpu.IDSelectorRange_imin_set) - __swig_setmethods__["imax"] = _swigfaiss_gpu.IDSelectorRange_imax_set - __swig_getmethods__["imax"] = _swigfaiss_gpu.IDSelectorRange_imax_get - if _newclass: - imax = _swig_property(_swigfaiss_gpu.IDSelectorRange_imax_get, _swigfaiss_gpu.IDSelectorRange_imax_set) - - def __init__(self, imin, imax): - this = _swigfaiss_gpu.new_IDSelectorRange(imin, imax) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def is_member(self, id): - return _swigfaiss_gpu.IDSelectorRange_is_member(self, id) - __swig_destroy__ = _swigfaiss_gpu.delete_IDSelectorRange - __del__ = lambda self: None -IDSelectorRange_swigregister = _swigfaiss_gpu.IDSelectorRange_swigregister -IDSelectorRange_swigregister(IDSelectorRange) - -class IDSelectorBatch(IDSelector): - __swig_setmethods__ = {} - for _s in [IDSelector]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, IDSelectorBatch, name, value) - __swig_getmethods__ = {} - for _s in [IDSelector]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, IDSelectorBatch, name) - __repr__ = _swig_repr - __swig_setmethods__["nbits"] = _swigfaiss_gpu.IDSelectorBatch_nbits_set - __swig_getmethods__["nbits"] = _swigfaiss_gpu.IDSelectorBatch_nbits_get - if _newclass: - nbits = _swig_property(_swigfaiss_gpu.IDSelectorBatch_nbits_get, _swigfaiss_gpu.IDSelectorBatch_nbits_set) - __swig_setmethods__["mask"] = _swigfaiss_gpu.IDSelectorBatch_mask_set - __swig_getmethods__["mask"] = _swigfaiss_gpu.IDSelectorBatch_mask_get - if _newclass: - mask = _swig_property(_swigfaiss_gpu.IDSelectorBatch_mask_get, _swigfaiss_gpu.IDSelectorBatch_mask_set) - - def __init__(self, n, indices): - this = _swigfaiss_gpu.new_IDSelectorBatch(n, indices) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - - def is_member(self, id): - return _swigfaiss_gpu.IDSelectorBatch_is_member(self, id) - __swig_destroy__ = _swigfaiss_gpu.delete_IDSelectorBatch - __del__ = lambda self: None -IDSelectorBatch_swigregister = _swigfaiss_gpu.IDSelectorBatch_swigregister -IDSelectorBatch_swigregister(IDSelectorBatch) - -class BufferList(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, BufferList, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, BufferList, name) - __repr__ = _swig_repr - __swig_setmethods__["buffer_size"] = _swigfaiss_gpu.BufferList_buffer_size_set - __swig_getmethods__["buffer_size"] = _swigfaiss_gpu.BufferList_buffer_size_get - if _newclass: - buffer_size = _swig_property(_swigfaiss_gpu.BufferList_buffer_size_get, _swigfaiss_gpu.BufferList_buffer_size_set) - __swig_setmethods__["buffers"] = _swigfaiss_gpu.BufferList_buffers_set - __swig_getmethods__["buffers"] = _swigfaiss_gpu.BufferList_buffers_get - if _newclass: - buffers = _swig_property(_swigfaiss_gpu.BufferList_buffers_get, _swigfaiss_gpu.BufferList_buffers_set) - __swig_setmethods__["wp"] = _swigfaiss_gpu.BufferList_wp_set - __swig_getmethods__["wp"] = _swigfaiss_gpu.BufferList_wp_get - if _newclass: - wp = _swig_property(_swigfaiss_gpu.BufferList_wp_get, _swigfaiss_gpu.BufferList_wp_set) - - def __init__(self, buffer_size): - this = _swigfaiss_gpu.new_BufferList(buffer_size) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_BufferList - __del__ = lambda self: None - - def append_buffer(self): - return _swigfaiss_gpu.BufferList_append_buffer(self) - - def add(self, id, dis): - return _swigfaiss_gpu.BufferList_add(self, id, dis) - - def copy_range(self, ofs, n, dest_ids, dest_dis): - return _swigfaiss_gpu.BufferList_copy_range(self, ofs, n, dest_ids, dest_dis) -BufferList_swigregister = _swigfaiss_gpu.BufferList_swigregister -BufferList_swigregister(BufferList) - -class RangeQueryResult(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeQueryResult, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, RangeQueryResult, name) - __repr__ = _swig_repr - __swig_setmethods__["qno"] = _swigfaiss_gpu.RangeQueryResult_qno_set - __swig_getmethods__["qno"] = _swigfaiss_gpu.RangeQueryResult_qno_get - if _newclass: - qno = _swig_property(_swigfaiss_gpu.RangeQueryResult_qno_get, _swigfaiss_gpu.RangeQueryResult_qno_set) - __swig_setmethods__["nres"] = _swigfaiss_gpu.RangeQueryResult_nres_set - __swig_getmethods__["nres"] = _swigfaiss_gpu.RangeQueryResult_nres_get - if _newclass: - nres = _swig_property(_swigfaiss_gpu.RangeQueryResult_nres_get, _swigfaiss_gpu.RangeQueryResult_nres_set) - __swig_setmethods__["pres"] = _swigfaiss_gpu.RangeQueryResult_pres_set - __swig_getmethods__["pres"] = _swigfaiss_gpu.RangeQueryResult_pres_get - if _newclass: - pres = _swig_property(_swigfaiss_gpu.RangeQueryResult_pres_get, _swigfaiss_gpu.RangeQueryResult_pres_set) - - def add(self, dis, id): - return _swigfaiss_gpu.RangeQueryResult_add(self, dis, id) - - def __init__(self): - this = _swigfaiss_gpu.new_RangeQueryResult() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_RangeQueryResult - __del__ = lambda self: None -RangeQueryResult_swigregister = _swigfaiss_gpu.RangeQueryResult_swigregister -RangeQueryResult_swigregister(RangeQueryResult) - -class RangeSearchPartialResult(BufferList): - __swig_setmethods__ = {} - for _s in [BufferList]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, RangeSearchPartialResult, name, value) - __swig_getmethods__ = {} - for _s in [BufferList]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, RangeSearchPartialResult, name) - __repr__ = _swig_repr - __swig_setmethods__["res"] = _swigfaiss_gpu.RangeSearchPartialResult_res_set - __swig_getmethods__["res"] = _swigfaiss_gpu.RangeSearchPartialResult_res_get - if _newclass: - res = _swig_property(_swigfaiss_gpu.RangeSearchPartialResult_res_get, _swigfaiss_gpu.RangeSearchPartialResult_res_set) - - def __init__(self, res_in): - this = _swigfaiss_gpu.new_RangeSearchPartialResult(res_in) - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_setmethods__["queries"] = _swigfaiss_gpu.RangeSearchPartialResult_queries_set - __swig_getmethods__["queries"] = _swigfaiss_gpu.RangeSearchPartialResult_queries_get - if _newclass: - queries = _swig_property(_swigfaiss_gpu.RangeSearchPartialResult_queries_get, _swigfaiss_gpu.RangeSearchPartialResult_queries_set) - - def new_result(self, qno): - return _swigfaiss_gpu.RangeSearchPartialResult_new_result(self, qno) - - def finalize(self): - return _swigfaiss_gpu.RangeSearchPartialResult_finalize(self) - - def set_lims(self): - return _swigfaiss_gpu.RangeSearchPartialResult_set_lims(self) - - def set_result(self, incremental=False): - return _swigfaiss_gpu.RangeSearchPartialResult_set_result(self, incremental) - __swig_destroy__ = _swigfaiss_gpu.delete_RangeSearchPartialResult - __del__ = lambda self: None -RangeSearchPartialResult_swigregister = _swigfaiss_gpu.RangeSearchPartialResult_swigregister -RangeSearchPartialResult_swigregister(RangeSearchPartialResult) - -class IOReader(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IOReader, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IOReader, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss_gpu.IOReader_name_set - __swig_getmethods__["name"] = _swigfaiss_gpu.IOReader_name_get - if _newclass: - name = _swig_property(_swigfaiss_gpu.IOReader_name_get, _swigfaiss_gpu.IOReader_name_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss_gpu.IOReader___call__(self, ptr, size, nitems) - - def fileno(self): - return _swigfaiss_gpu.IOReader_fileno(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IOReader - __del__ = lambda self: None -IOReader_swigregister = _swigfaiss_gpu.IOReader_swigregister -IOReader_swigregister(IOReader) - -class IOWriter(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, IOWriter, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, IOWriter, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_setmethods__["name"] = _swigfaiss_gpu.IOWriter_name_set - __swig_getmethods__["name"] = _swigfaiss_gpu.IOWriter_name_get - if _newclass: - name = _swig_property(_swigfaiss_gpu.IOWriter_name_get, _swigfaiss_gpu.IOWriter_name_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss_gpu.IOWriter___call__(self, ptr, size, nitems) - - def fileno(self): - return _swigfaiss_gpu.IOWriter_fileno(self) - __swig_destroy__ = _swigfaiss_gpu.delete_IOWriter - __del__ = lambda self: None -IOWriter_swigregister = _swigfaiss_gpu.IOWriter_swigregister -IOWriter_swigregister(IOWriter) - -class VectorIOReader(IOReader): - __swig_setmethods__ = {} - for _s in [IOReader]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorIOReader, name, value) - __swig_getmethods__ = {} - for _s in [IOReader]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, VectorIOReader, name) - __repr__ = _swig_repr - __swig_setmethods__["data"] = _swigfaiss_gpu.VectorIOReader_data_set - __swig_getmethods__["data"] = _swigfaiss_gpu.VectorIOReader_data_get - if _newclass: - data = _swig_property(_swigfaiss_gpu.VectorIOReader_data_get, _swigfaiss_gpu.VectorIOReader_data_set) - __swig_setmethods__["rp"] = _swigfaiss_gpu.VectorIOReader_rp_set - __swig_getmethods__["rp"] = _swigfaiss_gpu.VectorIOReader_rp_get - if _newclass: - rp = _swig_property(_swigfaiss_gpu.VectorIOReader_rp_get, _swigfaiss_gpu.VectorIOReader_rp_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss_gpu.VectorIOReader___call__(self, ptr, size, nitems) - - def __init__(self): - this = _swigfaiss_gpu.new_VectorIOReader() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_VectorIOReader - __del__ = lambda self: None -VectorIOReader_swigregister = _swigfaiss_gpu.VectorIOReader_swigregister -VectorIOReader_swigregister(VectorIOReader) - -class VectorIOWriter(IOWriter): - __swig_setmethods__ = {} - for _s in [IOWriter]: - __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {})) - __setattr__ = lambda self, name, value: _swig_setattr(self, VectorIOWriter, name, value) - __swig_getmethods__ = {} - for _s in [IOWriter]: - __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {})) - __getattr__ = lambda self, name: _swig_getattr(self, VectorIOWriter, name) - __repr__ = _swig_repr - __swig_setmethods__["data"] = _swigfaiss_gpu.VectorIOWriter_data_set - __swig_getmethods__["data"] = _swigfaiss_gpu.VectorIOWriter_data_get - if _newclass: - data = _swig_property(_swigfaiss_gpu.VectorIOWriter_data_get, _swigfaiss_gpu.VectorIOWriter_data_set) - - def __call__(self, ptr, size, nitems): - return _swigfaiss_gpu.VectorIOWriter___call__(self, ptr, size, nitems) - - def __init__(self): - this = _swigfaiss_gpu.new_VectorIOWriter() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_VectorIOWriter - __del__ = lambda self: None -VectorIOWriter_swigregister = _swigfaiss_gpu.VectorIOWriter_swigregister -VectorIOWriter_swigregister(VectorIOWriter) - -class DistanceComputer(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, DistanceComputer, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, DistanceComputer, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def set_query(self, x): - return _swigfaiss_gpu.DistanceComputer_set_query(self, x) - - def __call__(self, i): - return _swigfaiss_gpu.DistanceComputer___call__(self, i) - - def symmetric_dis(self, i, j): - return _swigfaiss_gpu.DistanceComputer_symmetric_dis(self, i, j) - __swig_destroy__ = _swigfaiss_gpu.delete_DistanceComputer - __del__ = lambda self: None -DistanceComputer_swigregister = _swigfaiss_gpu.DistanceComputer_swigregister -DistanceComputer_swigregister(DistanceComputer) - -class InterruptCallback(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, InterruptCallback, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, InterruptCallback, name) - - def __init__(self, *args, **kwargs): - raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - - def want_interrupt(self): - return _swigfaiss_gpu.InterruptCallback_want_interrupt(self) - __swig_destroy__ = _swigfaiss_gpu.delete_InterruptCallback - __del__ = lambda self: None - if _newclass: - check = staticmethod(_swigfaiss_gpu.InterruptCallback_check) - else: - check = _swigfaiss_gpu.InterruptCallback_check - if _newclass: - is_interrupted = staticmethod(_swigfaiss_gpu.InterruptCallback_is_interrupted) - else: - is_interrupted = _swigfaiss_gpu.InterruptCallback_is_interrupted - if _newclass: - get_period_hint = staticmethod(_swigfaiss_gpu.InterruptCallback_get_period_hint) - else: - get_period_hint = _swigfaiss_gpu.InterruptCallback_get_period_hint -InterruptCallback_swigregister = _swigfaiss_gpu.InterruptCallback_swigregister -InterruptCallback_swigregister(InterruptCallback) - -def InterruptCallback_check(): - return _swigfaiss_gpu.InterruptCallback_check() -InterruptCallback_check = _swigfaiss_gpu.InterruptCallback_check - -def InterruptCallback_is_interrupted(): - return _swigfaiss_gpu.InterruptCallback_is_interrupted() -InterruptCallback_is_interrupted = _swigfaiss_gpu.InterruptCallback_is_interrupted - -def InterruptCallback_get_period_hint(flops): - return _swigfaiss_gpu.InterruptCallback_get_period_hint(flops) -InterruptCallback_get_period_hint = _swigfaiss_gpu.InterruptCallback_get_period_hint - - -def ignore_SIGTTIN(): - return _swigfaiss_gpu.ignore_SIGTTIN() -ignore_SIGTTIN = _swigfaiss_gpu.ignore_SIGTTIN -class MapLong2Long(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, MapLong2Long, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, MapLong2Long, name) - __repr__ = _swig_repr - __swig_setmethods__["map"] = _swigfaiss_gpu.MapLong2Long_map_set - __swig_getmethods__["map"] = _swigfaiss_gpu.MapLong2Long_map_get - if _newclass: - map = _swig_property(_swigfaiss_gpu.MapLong2Long_map_get, _swigfaiss_gpu.MapLong2Long_map_set) - - def add(self, n, keys, vals): - return _swigfaiss_gpu.MapLong2Long_add(self, n, keys, vals) - - def search(self, key): - return _swigfaiss_gpu.MapLong2Long_search(self, key) - - def search_multiple(self, n, keys, vals): - return _swigfaiss_gpu.MapLong2Long_search_multiple(self, n, keys, vals) - - def __init__(self): - this = _swigfaiss_gpu.new_MapLong2Long() - try: - self.this.append(this) - except __builtin__.Exception: - self.this = this - __swig_destroy__ = _swigfaiss_gpu.delete_MapLong2Long - __del__ = lambda self: None -MapLong2Long_swigregister = _swigfaiss_gpu.MapLong2Long_swigregister -MapLong2Long_swigregister(MapLong2Long) - -# This file is compatible with both classic and new-style classes. - - diff --git a/python/swigfaiss_gpu_wrap.cpp b/python/swigfaiss_gpu_wrap.cpp deleted file mode 100644 index afbc81ae1..000000000 --- a/python/swigfaiss_gpu_wrap.cpp +++ /dev/null @@ -1,98027 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#endif - - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - SWIG errors code. - - Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#define SWIG_CASTRANKLIMIT (1 << 8) -/* The NewMask denotes the object was created (using new/malloc) */ -#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ -#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) -/* Simple returning values */ -#define SWIG_BADOBJ (SWIG_ERROR) -#define SWIG_OLDOBJ (SWIG_OK) -#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) -#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ -#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) -#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) -#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#define PyString_Size(str) PyBytes_Size(str) -#define PyString_InternFromString(key) PyUnicode_InternFromString(key) -#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) -#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -/* Warning: This function will allocate a new string in Python 3, - * so please call SWIG_Python_str_DelForPy3(x) to free the space. - */ -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; - str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - return newstr; -#else - return PyString_AsString(str); -#endif -} - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) -#else -# define SWIG_Python_str_DelForPy3(x) -#endif - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) -# define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - data->newargs = obj; - Py_INCREF(obj); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { - PyObject *ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { -# ifdef METH_NOARGS - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); - - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(val, type, tb); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; -#endif - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; -#endif - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); -#else -# ifdef SWIGPY_USE_CAPSULE - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE -SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif -{ -#ifdef SWIGPY_USE_CAPSULE - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - swig_this = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif -#ifdef SWIGPY_USE_CAPSULE - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#endif -} - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { -#ifdef SWIGPY_USE_CAPSULE - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE - obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); - } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - SWIG_Python_str_DelForPy3(cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); -#if SWIG_POINTER_EXCEPTION - if (flags) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } -#endif - } - return result; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_Crev swig_types[0] -#define SWIGTYPE_p_FILE swig_types[1] -#define SWIGTYPE_p_MapLong2Long swig_types[2] -#define SWIGTYPE_p_Node swig_types[3] -#define SWIGTYPE_p_T swig_types[4] -#define SWIGTYPE_p_TI swig_types[5] -#define SWIGTYPE_p_char swig_types[6] -#define SWIGTYPE_p_component_t swig_types[7] -#define SWIGTYPE_p_cublasHandle_t swig_types[8] -#define SWIGTYPE_p_cudaStream_t swig_types[9] -#define SWIGTYPE_p_distance_t swig_types[10] -#define SWIGTYPE_p_double swig_types[11] -#define SWIGTYPE_p_faiss__ArrayInvertedLists swig_types[12] -#define SWIGTYPE_p_faiss__AutoTuneCriterion swig_types[13] -#define SWIGTYPE_p_faiss__BinaryInvertedListScanner swig_types[14] -#define SWIGTYPE_p_faiss__BufferList swig_types[15] -#define SWIGTYPE_p_faiss__CenteringTransform swig_types[16] -#define SWIGTYPE_p_faiss__Cloner swig_types[17] -#define SWIGTYPE_p_faiss__Clustering swig_types[18] -#define SWIGTYPE_p_faiss__ClusteringParameters swig_types[19] -#define SWIGTYPE_p_faiss__ConcatenatedInvertedLists swig_types[20] -#define SWIGTYPE_p_faiss__DistanceComputer swig_types[21] -#define SWIGTYPE_p_faiss__GenHammingComputer16 swig_types[22] -#define SWIGTYPE_p_faiss__GenHammingComputer32 swig_types[23] -#define SWIGTYPE_p_faiss__GenHammingComputer8 swig_types[24] -#define SWIGTYPE_p_faiss__GenHammingComputerM8 swig_types[25] -#define SWIGTYPE_p_faiss__HNSW swig_types[26] -#define SWIGTYPE_p_faiss__HNSWStats swig_types[27] -#define SWIGTYPE_p_faiss__HNSW__MinimaxHeap swig_types[28] -#define SWIGTYPE_p_faiss__HammingComputer16 swig_types[29] -#define SWIGTYPE_p_faiss__HammingComputer20 swig_types[30] -#define SWIGTYPE_p_faiss__HammingComputer32 swig_types[31] -#define SWIGTYPE_p_faiss__HammingComputer4 swig_types[32] -#define SWIGTYPE_p_faiss__HammingComputer64 swig_types[33] -#define SWIGTYPE_p_faiss__HammingComputer8 swig_types[34] -#define SWIGTYPE_p_faiss__HammingComputerDefault swig_types[35] -#define SWIGTYPE_p_faiss__HammingComputerM4 swig_types[36] -#define SWIGTYPE_p_faiss__HammingComputerM8 swig_types[37] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t swig_types[38] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t swig_types[39] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t swig_types[40] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t swig_types[41] -#define SWIGTYPE_p_faiss__IDSelector swig_types[42] -#define SWIGTYPE_p_faiss__IDSelectorBatch swig_types[43] -#define SWIGTYPE_p_faiss__IDSelectorRange swig_types[44] -#define SWIGTYPE_p_faiss__IOReader swig_types[45] -#define SWIGTYPE_p_faiss__IOWriter swig_types[46] -#define SWIGTYPE_p_faiss__IVFPQSearchParameters swig_types[47] -#define SWIGTYPE_p_faiss__IVFSearchParameters swig_types[48] -#define SWIGTYPE_p_faiss__Index swig_types[49] -#define SWIGTYPE_p_faiss__Index2Layer swig_types[50] -#define SWIGTYPE_p_faiss__IndexBinary swig_types[51] -#define SWIGTYPE_p_faiss__IndexBinaryFlat swig_types[52] -#define SWIGTYPE_p_faiss__IndexBinaryFromFloat swig_types[53] -#define SWIGTYPE_p_faiss__IndexBinaryHNSW swig_types[54] -#define SWIGTYPE_p_faiss__IndexBinaryIVF swig_types[55] -#define SWIGTYPE_p_faiss__IndexFlat swig_types[56] -#define SWIGTYPE_p_faiss__IndexFlat1D swig_types[57] -#define SWIGTYPE_p_faiss__IndexFlatIP swig_types[58] -#define SWIGTYPE_p_faiss__IndexFlatL2 swig_types[59] -#define SWIGTYPE_p_faiss__IndexFlatL2BaseShift swig_types[60] -#define SWIGTYPE_p_faiss__IndexHNSW swig_types[61] -#define SWIGTYPE_p_faiss__IndexHNSW2Level swig_types[62] -#define SWIGTYPE_p_faiss__IndexHNSWFlat swig_types[63] -#define SWIGTYPE_p_faiss__IndexHNSWPQ swig_types[64] -#define SWIGTYPE_p_faiss__IndexHNSWSQ swig_types[65] -#define SWIGTYPE_p_faiss__IndexIDMap swig_types[66] -#define SWIGTYPE_p_faiss__IndexIDMap2 swig_types[67] -#define SWIGTYPE_p_faiss__IndexIVF swig_types[68] -#define SWIGTYPE_p_faiss__IndexIVFFlat swig_types[69] -#define SWIGTYPE_p_faiss__IndexIVFFlatDedup swig_types[70] -#define SWIGTYPE_p_faiss__IndexIVFPQ swig_types[71] -#define SWIGTYPE_p_faiss__IndexIVFPQR swig_types[72] -#define SWIGTYPE_p_faiss__IndexIVFPQStats swig_types[73] -#define SWIGTYPE_p_faiss__IndexIVFScalarQuantizer swig_types[74] -#define SWIGTYPE_p_faiss__IndexIVFStats swig_types[75] -#define SWIGTYPE_p_faiss__IndexLSH swig_types[76] -#define SWIGTYPE_p_faiss__IndexPQ swig_types[77] -#define SWIGTYPE_p_faiss__IndexPQStats swig_types[78] -#define SWIGTYPE_p_faiss__IndexPreTransform swig_types[79] -#define SWIGTYPE_p_faiss__IndexRefineFlat swig_types[80] -#define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t swig_types[81] -#define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[82] -#define SWIGTYPE_p_faiss__IndexScalarQuantizer swig_types[83] -#define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t swig_types[84] -#define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[85] -#define SWIGTYPE_p_faiss__IndexSplitVectors swig_types[86] -#define SWIGTYPE_p_faiss__InterruptCallback swig_types[87] -#define SWIGTYPE_p_faiss__IntersectionCriterion swig_types[88] -#define SWIGTYPE_p_faiss__InvertedListScanner swig_types[89] -#define SWIGTYPE_p_faiss__InvertedLists swig_types[90] -#define SWIGTYPE_p_faiss__Level1Quantizer swig_types[91] -#define SWIGTYPE_p_faiss__LinearTransform swig_types[92] -#define SWIGTYPE_p_faiss__LockLevels swig_types[93] -#define SWIGTYPE_p_faiss__MatrixStats swig_types[94] -#define SWIGTYPE_p_faiss__MultiIndexQuantizer swig_types[95] -#define SWIGTYPE_p_faiss__MultiIndexQuantizer2 swig_types[96] -#define SWIGTYPE_p_faiss__NormalizationTransform swig_types[97] -#define SWIGTYPE_p_faiss__OPQMatrix swig_types[98] -#define SWIGTYPE_p_faiss__OnDiskInvertedLists swig_types[99] -#define SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch swig_types[100] -#define SWIGTYPE_p_faiss__OneRecallAtRCriterion swig_types[101] -#define SWIGTYPE_p_faiss__OperatingPoint swig_types[102] -#define SWIGTYPE_p_faiss__OperatingPoints swig_types[103] -#define SWIGTYPE_p_faiss__PCAMatrix swig_types[104] -#define SWIGTYPE_p_faiss__ParameterRange swig_types[105] -#define SWIGTYPE_p_faiss__ParameterSpace swig_types[106] -#define SWIGTYPE_p_faiss__PermutationObjective swig_types[107] -#define SWIGTYPE_p_faiss__PolysemousTraining swig_types[108] -#define SWIGTYPE_p_faiss__ProductQuantizer swig_types[109] -#define SWIGTYPE_p_faiss__RandomGenerator swig_types[110] -#define SWIGTYPE_p_faiss__RandomRotationMatrix swig_types[111] -#define SWIGTYPE_p_faiss__RangeQueryResult swig_types[112] -#define SWIGTYPE_p_faiss__RangeSearchPartialResult swig_types[113] -#define SWIGTYPE_p_faiss__RangeSearchResult swig_types[114] -#define SWIGTYPE_p_faiss__ReconstructFromNeighbors swig_types[115] -#define SWIGTYPE_p_faiss__RemapDimensionsTransform swig_types[116] -#define SWIGTYPE_p_faiss__ReproduceDistancesObjective swig_types[117] -#define SWIGTYPE_p_faiss__SQDistanceComputer swig_types[118] -#define SWIGTYPE_p_faiss__ScalarQuantizer swig_types[119] -#define SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer swig_types[120] -#define SWIGTYPE_p_faiss__SimulatedAnnealingParameters swig_types[121] -#define SWIGTYPE_p_faiss__VectorIOReader swig_types[122] -#define SWIGTYPE_p_faiss__VectorIOWriter swig_types[123] -#define SWIGTYPE_p_faiss__VectorTransform swig_types[124] -#define SWIGTYPE_p_faiss__VisitedTable swig_types[125] -#define SWIGTYPE_p_faiss__gpu__FlatIndex swig_types[126] -#define SWIGTYPE_p_faiss__gpu__GpuClonerOptions swig_types[127] -#define SWIGTYPE_p_faiss__gpu__GpuIndex swig_types[128] -#define SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat swig_types[129] -#define SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig swig_types[130] -#define SWIGTYPE_p_faiss__gpu__GpuIndexConfig swig_types[131] -#define SWIGTYPE_p_faiss__gpu__GpuIndexFlat swig_types[132] -#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig swig_types[133] -#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP swig_types[134] -#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2 swig_types[135] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVF swig_types[136] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig swig_types[137] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat swig_types[138] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig swig_types[139] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ swig_types[140] -#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig swig_types[141] -#define SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions swig_types[142] -#define SWIGTYPE_p_faiss__gpu__GpuParameterSpace swig_types[143] -#define SWIGTYPE_p_faiss__gpu__GpuResources swig_types[144] -#define SWIGTYPE_p_faiss__gpu__StandardGpuResources swig_types[145] -#define SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow swig_types[146] -#define SWIGTYPE_p_float swig_types[147] -#define SWIGTYPE_p_idx_t swig_types[148] -#define SWIGTYPE_p_int swig_types[149] -#define SWIGTYPE_p_long swig_types[150] -#define SWIGTYPE_p_omp_lock_t swig_types[151] -#define SWIGTYPE_p_p_faiss__ArrayInvertedLists swig_types[152] -#define SWIGTYPE_p_p_faiss__CenteringTransform swig_types[153] -#define SWIGTYPE_p_p_faiss__ConcatenatedInvertedLists swig_types[154] -#define SWIGTYPE_p_p_faiss__Index swig_types[155] -#define SWIGTYPE_p_p_faiss__Index2Layer swig_types[156] -#define SWIGTYPE_p_p_faiss__IndexFlat swig_types[157] -#define SWIGTYPE_p_p_faiss__IndexFlat1D swig_types[158] -#define SWIGTYPE_p_p_faiss__IndexFlatIP swig_types[159] -#define SWIGTYPE_p_p_faiss__IndexFlatL2 swig_types[160] -#define SWIGTYPE_p_p_faiss__IndexFlatL2BaseShift swig_types[161] -#define SWIGTYPE_p_p_faiss__IndexHNSW swig_types[162] -#define SWIGTYPE_p_p_faiss__IndexHNSW2Level swig_types[163] -#define SWIGTYPE_p_p_faiss__IndexHNSWFlat swig_types[164] -#define SWIGTYPE_p_p_faiss__IndexHNSWPQ swig_types[165] -#define SWIGTYPE_p_p_faiss__IndexHNSWSQ swig_types[166] -#define SWIGTYPE_p_p_faiss__IndexIDMap swig_types[167] -#define SWIGTYPE_p_p_faiss__IndexIDMap2 swig_types[168] -#define SWIGTYPE_p_p_faiss__IndexIVF swig_types[169] -#define SWIGTYPE_p_p_faiss__IndexIVFFlat swig_types[170] -#define SWIGTYPE_p_p_faiss__IndexIVFFlatDedup swig_types[171] -#define SWIGTYPE_p_p_faiss__IndexIVFPQ swig_types[172] -#define SWIGTYPE_p_p_faiss__IndexIVFPQR swig_types[173] -#define SWIGTYPE_p_p_faiss__IndexIVFScalarQuantizer swig_types[174] -#define SWIGTYPE_p_p_faiss__IndexLSH swig_types[175] -#define SWIGTYPE_p_p_faiss__IndexPQ swig_types[176] -#define SWIGTYPE_p_p_faiss__IndexPreTransform swig_types[177] -#define SWIGTYPE_p_p_faiss__IndexRefineFlat swig_types[178] -#define SWIGTYPE_p_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[179] -#define SWIGTYPE_p_p_faiss__IndexScalarQuantizer swig_types[180] -#define SWIGTYPE_p_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[181] -#define SWIGTYPE_p_p_faiss__IndexSplitVectors swig_types[182] -#define SWIGTYPE_p_p_faiss__InvertedLists swig_types[183] -#define SWIGTYPE_p_p_faiss__LinearTransform swig_types[184] -#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer swig_types[185] -#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer2 swig_types[186] -#define SWIGTYPE_p_p_faiss__NormalizationTransform swig_types[187] -#define SWIGTYPE_p_p_faiss__OPQMatrix swig_types[188] -#define SWIGTYPE_p_p_faiss__OnDiskInvertedLists swig_types[189] -#define SWIGTYPE_p_p_faiss__PCAMatrix swig_types[190] -#define SWIGTYPE_p_p_faiss__RandomRotationMatrix swig_types[191] -#define SWIGTYPE_p_p_faiss__RemapDimensionsTransform swig_types[192] -#define SWIGTYPE_p_p_faiss__VectorTransform swig_types[193] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndex swig_types[194] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlat swig_types[195] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlatIP swig_types[196] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlatL2 swig_types[197] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVF swig_types[198] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVFFlat swig_types[199] -#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVFPQ swig_types[200] -#define SWIGTYPE_p_p_faiss__gpu__GpuResources swig_types[201] -#define SWIGTYPE_p_p_faiss__gpu__StandardGpuResources swig_types[202] -#define SWIGTYPE_p_p_void swig_types[203] -#define SWIGTYPE_p_std__functionT_void_ffaiss__IndexBinary_pF_t swig_types[204] -#define SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t swig_types[205] -#define SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t swig_types[206] -#define SWIGTYPE_p_std__mt19937 swig_types[207] -#define SWIGTYPE_p_std__pairT_float_int_t swig_types[208] -#define SWIGTYPE_p_std__pairT_void_p_unsigned_long_t swig_types[209] -#define SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t swig_types[210] -#define SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t swig_types[211] -#define SWIGTYPE_p_std__unordered_mapT_long_long_t swig_types[212] -#define SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t swig_types[213] -#define SWIGTYPE_p_std__unordered_multimapT_long_long_t swig_types[214] -#define SWIGTYPE_p_std__vectorT_char_t swig_types[215] -#define SWIGTYPE_p_std__vectorT_cudaStream_t_t swig_types[216] -#define SWIGTYPE_p_std__vectorT_double_t swig_types[217] -#define SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t swig_types[218] -#define SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t swig_types[219] -#define SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t swig_types[220] -#define SWIGTYPE_p_std__vectorT_faiss__Index_p_t swig_types[221] -#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t swig_types[222] -#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t swig_types[223] -#define SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t swig_types[224] -#define SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t swig_types[225] -#define SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t swig_types[226] -#define SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t swig_types[227] -#define SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t swig_types[228] -#define SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t swig_types[229] -#define SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t swig_types[230] -#define SWIGTYPE_p_std__vectorT_float_t swig_types[231] -#define SWIGTYPE_p_std__vectorT_int_t swig_types[232] -#define SWIGTYPE_p_std__vectorT_long_t swig_types[233] -#define SWIGTYPE_p_std__vectorT_omp_lock_t_t swig_types[234] -#define SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t swig_types[235] -#define SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t swig_types[236] -#define SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t swig_types[237] -#define SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t swig_types[238] -#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[239] -#define SWIGTYPE_p_std__vectorT_unsigned_long_t swig_types[240] -#define SWIGTYPE_p_storage_idx_t swig_types[241] -#define SWIGTYPE_p_uint32_t swig_types[242] -#define SWIGTYPE_p_unsigned_char swig_types[243] -#define SWIGTYPE_p_unsigned_long swig_types[244] -#define SWIGTYPE_p_void swig_types[245] -static swig_type_info *swig_types[247]; -static swig_module_info swig_module = {swig_types, 246, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif - -/*----------------------------------------------- - @(target):= _swigfaiss_gpu.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__swigfaiss_gpu - -#else -# define SWIG_init init_swigfaiss_gpu - -#endif -#define SWIG_name "_swigfaiss_gpu" - -#define SWIGVERSION 0x030012 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - - - -#include -#include - - -#ifdef SWIGLUA - -#include - -extern "C" { - -#include -#include -#undef THTensor - -} - -#endif - - -#ifdef SWIGPYTHON - -#undef popcount64 - -#define SWIG_FILE_WITH_INIT -#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION -#include - -#endif - - -#include "IndexFlat.h" -#include "VectorTransform.h" -#include "IndexLSH.h" -#include "IndexPQ.h" -#include "IndexIVF.h" -#include "IndexIVFPQ.h" -#include "IndexIVFFlat.h" -#include "IndexScalarQuantizer.h" -#include "IndexShards.h" -#include "IndexReplicas.h" -#include "HNSW.h" -#include "IndexHNSW.h" -#include "MetaIndexes.h" -#include "FaissAssert.h" - -#include "IndexBinaryFlat.h" -#include "IndexBinaryIVF.h" -#include "IndexBinaryFromFloat.h" -#include "IndexBinaryHNSW.h" - -#include "index_io.h" - -#include "IVFlib.h" -#include "utils.h" -#include "Heap.h" -#include "AuxIndexStructures.h" -#include "OnDiskInvertedLists.h" - -#include "Clustering.h" - -#include "hamming.h" - -#include "AutoTune.h" - - - - - -#include - - -#include - - -/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ -#ifndef SWIG_isfinite -/* isfinite() is a macro for C99 */ -# if defined(isfinite) -# define SWIG_isfinite(X) (isfinite(X)) -# elif defined __cplusplus && __cplusplus >= 201103L -/* Use a template so that this works whether isfinite() is std::isfinite() or - * in the global namespace. The reality seems to vary between compiler - * versions. - * - * Make sure namespace std exists to avoid compiler warnings. - * - * extern "C++" is required as this fragment can end up inside an extern "C" { } block - */ -namespace std { } -extern "C++" template -inline int SWIG_isfinite_func(T x) { - using namespace std; - return isfinite(x); -} -# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) -# elif defined(_MSC_VER) -# define SWIG_isfinite(X) (_finite(X)) -# elif defined(__sun) && defined(__SVR4) -# include -# define SWIG_isfinite(X) (finite(X)) -# endif -#endif - - -/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ -#ifdef SWIG_isfinite -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) -#else -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) -#endif - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -SWIGINTERN int -SWIG_AsVal_float (PyObject * obj, float *val) -{ - double v; - int res = SWIG_AsVal_double (obj, &v); - if (SWIG_IsOK(res)) { - if (SWIG_Float_Overflow_Check(v)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< float >(v); - } - } - return res; -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value)); -} -#endif - - -SWIGINTERNINLINE PyObject * -SWIG_From_size_t (size_t value) -{ -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(size_t) <= sizeof(unsigned long long) */ - return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value)); - } -#endif -} - - -SWIGINTERNINLINE int -SWIG_CanCastAsInteger(double *d, double min, double max) { - double x = *d; - if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) -{ - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - } -#endif - return res; -} - - - #define SWIG_From_double PyFloat_FromDouble - - -SWIGINTERNINLINE PyObject * -SWIG_From_float (float value) -{ - return SWIG_From_double (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned char >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -#else - if (PyUnicode_Check(obj)) -#endif -#else - if (PyString_Check(obj)) -#endif - { - char *cstr; Py_ssize_t len; -#if PY_VERSION_HEX>=0x03000000 -#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if(alloc) *alloc = SWIG_NEWOBJ; -#endif - PyBytes_AsStringAndSize(obj, &cstr, &len); -#else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -#endif -#else - *cptr = SWIG_Python_str_AsChar(obj); -#endif - } - } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -#endif - return SWIG_OK; - } else { -#if defined(SWIG_PYTHON_2_UNICODE) -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -#endif -#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -#endif -#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsCharArray(PyObject * obj, char *val, size_t size) -{ - char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; - int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); - if (SWIG_IsOK(res)) { - /* special case of single char conversion when we don't need space for NUL */ - if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; - if (csize <= size) { - if (val) { - if (csize) memcpy(val, cptr, csize*sizeof(char)); - if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); - } - if (alloc == SWIG_NEWOBJ) { - delete[] cptr; - res = SWIG_DelNewMask(res); - } - return res; - } - if (alloc == SWIG_NEWOBJ) delete[] cptr; - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_char (PyObject * obj, char *val) -{ - int res = SWIG_AsCharArray(obj, val, 1); - if (!SWIG_IsOK(res)) { - long v; - res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); - if (SWIG_IsOK(res)) { - if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { - if (val) *val = static_cast< char >(v); - } else { - res = SWIG_OverflowError; - } - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#else -#if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif -#endif -#else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_char (char c) -{ - return SWIG_FromCharPtrAndSize(&c,1); -} - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -#include - - - -#include "gpu/StandardGpuResources.h" -#include "gpu/GpuIndicesOptions.h" -#include "gpu/GpuClonerOptions.h" -#include "gpu/utils/MemorySpace.h" -#include "gpu/GpuIndex.h" -#include "gpu/GpuIndexFlat.h" -#include "gpu/GpuIndexIVF.h" -#include "gpu/GpuIndexIVFPQ.h" -#include "gpu/GpuIndexIVFFlat.h" -#include "gpu/GpuIndexBinaryFlat.h" -#include "gpu/GpuAutoTune.h" -#include "gpu/GpuDistance.h" - -int get_num_gpus() -{ - return faiss::gpu::getNumDevices(); -} - - - -SWIGINTERN int -SWIG_AsVal_bool (PyObject *obj, bool *val) -{ - int r; - if (!PyBool_Check(obj)) - return SWIG_ERROR; - r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - - -SWIGINTERN int -SWIG_AsPtr_std_string (PyObject * obj, std::string **val) -{ - char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; - if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) delete[] buf; - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } else { - static int init = 0; - static swig_type_info* descriptor = 0; - if (!init) { - descriptor = SWIG_TypeQuery("std::string" " *"); - init = 1; - } - if (descriptor) { - std::string *vptr; - int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); - if (SWIG_IsOK(res) && val) *val = vptr; - return res; - } - } - return SWIG_ERROR; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_std_string (const std::string& s) -{ - return SWIG_FromCharPtrAndSize(s.data(), s.size()); -} - - - - - -faiss::Index * downcast_index (faiss::Index *index) -{ - return index; -} -faiss::VectorTransform * downcast_VectorTransform (faiss::VectorTransform *vt) -{ - return vt; -} -faiss::IndexBinary * downcast_IndexBinary (faiss::IndexBinary *index) -{ - return index; -} - - -PyObject *swig_ptr (PyObject *a) -{ - if(!PyArray_Check(a)) { - PyErr_SetString(PyExc_ValueError, "input not a numpy array"); - return NULL; - } - PyArrayObject *ao = (PyArrayObject *)a; - - if(!PyArray_ISCONTIGUOUS(ao)) { - PyErr_SetString(PyExc_ValueError, "array is not C-contiguous"); - return NULL; - } - void * data = PyArray_DATA(ao); - if(PyArray_TYPE(ao) == NPY_FLOAT32) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_float, 0); - } - if(PyArray_TYPE(ao) == NPY_FLOAT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_double, 0); - } - if(PyArray_TYPE(ao) == NPY_INT32) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_int, 0); - } - if(PyArray_TYPE(ao) == NPY_UINT8) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_char, 0); - } - if(PyArray_TYPE(ao) == NPY_INT8) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_char, 0); - } - if(PyArray_TYPE(ao) == NPY_UINT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); - } - if(PyArray_TYPE(ao) == NPY_INT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0); - } - PyErr_SetString(PyExc_ValueError, "did not recognize array type"); - return NULL; -} - - -struct PythonInterruptCallback: faiss::InterruptCallback { - - bool want_interrupt () override { - int err; - { - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); - err = PyErr_CheckSignals(); - PyGILState_Release(gstate); - } - return err == -1; - } - -}; - - - - -PyObject * rev_swig_ptr(float *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_FLOAT32, src); -} - - -PyObject * rev_swig_ptr(int *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_INT32, src); -} - - -PyObject * rev_swig_ptr(unsigned char *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_UINT8, src); -} - - -PyObject * rev_swig_ptr(unsigned long *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_UINT64, src); -} - - -PyObject * rev_swig_ptr(long *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_INT64, src); -} - - -float * cast_integer_to_float_ptr (long x) { - return (float*)x; -} - -long * cast_integer_to_long_ptr (long x) { - return (long*)x; -} - -int * cast_integer_to_int_ptr (long x) { - return (int*)x; -} - - - -// may be useful for lua code launched in background from shell - -#include -void ignore_SIGTTIN() { - signal(SIGTTIN, SIG_IGN); -} - - - -// numpy misses a hash table implementation, hence this class. It -// represents not found values as -1 like in the Index implementation - -struct MapLong2Long { - std::unordered_map map; - - void add(size_t n, const long *keys, const long *vals) { - map.reserve(map.size() + n); - for (size_t i = 0; i < n; i++) { - map[keys[i]] = vals[i]; - } - } - - long search(long key) { - if (map.count(key) == 0) { - return -1; - } else { - return map[key]; - } - } - - void search_multiple(size_t n, const long *keys, long * vals) { - for (size_t i = 0; i < n; i++) { - vals[i] = search(keys[i]); - } - } -}; - - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_new_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_FloatVector")) SWIG_fail; - result = (std::vector< float > *)new std::vector< float >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_push_back" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_push_back" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_clear" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_data" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - result = (float *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_size" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_at" "', argument " "1"" of type '" "std::vector< float > const *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (float)((std::vector< float > const *)arg1)->at(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_resize" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - std::vector< float > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_swap" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVector" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *FloatVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_float_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_DoubleVector")) SWIG_fail; - result = (std::vector< double > *)new std::vector< double >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_push_back" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_push_back" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_clear" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_data" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - result = (double *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_size" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_at" "', argument " "1"" of type '" "std::vector< double > const *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (double)((std::vector< double > const *)arg1)->at(arg2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_resize" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - std::vector< double > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_swap" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DoubleVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DoubleVector" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *DoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ByteVector")) SWIG_fail; - result = (std::vector< uint8_t > *)new std::vector< uint8_t >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_push_back" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_push_back" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_clear" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_data" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - result = (unsigned char *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_size" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - unsigned char result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_at" "', argument " "1"" of type '" "std::vector< uint8_t > const *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (unsigned char)((std::vector< uint8_t > const *)arg1)->at(arg2); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_resize" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - std::vector< unsigned char > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_swap" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'"); - } - arg2 = reinterpret_cast< std::vector< unsigned char > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVector" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ByteVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CharVector")) SWIG_fail; - result = (std::vector< char > *)new std::vector< char >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_push_back" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_push_back" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_clear" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_data" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - result = (char *)(arg1)->data(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_size" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char result; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_at" "', argument " "1"" of type '" "std::vector< char > const *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (char)((std::vector< char > const *)arg1)->at(arg2); - resultobj = SWIG_From_char(static_cast< char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_resize" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - std::vector< char > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_swap" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = reinterpret_cast< std::vector< char > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_CharVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CharVector" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CharVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_char_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Uint64Vector")) SWIG_fail; - result = (std::vector< unsigned long > *)new std::vector< unsigned long >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - unsigned long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_push_back" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_push_back" "', argument " "2"" of type '" "unsigned long""'"); - } - arg2 = static_cast< unsigned long >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_clear" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_data" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - result = (unsigned long *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_size" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - unsigned long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_at" "', argument " "1"" of type '" "std::vector< unsigned long > const *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (unsigned long)((std::vector< unsigned long > const *)arg1)->at(arg2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_resize" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - std::vector< unsigned long > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_swap" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'"); - } - arg2 = reinterpret_cast< std::vector< unsigned long > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Uint64Vector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Uint64Vector" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Uint64Vector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LongVector")) SWIG_fail; - result = (std::vector< long > *)new std::vector< long >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_push_back" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_push_back" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_clear" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_data" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - result = (long *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_size" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_at" "', argument " "1"" of type '" "std::vector< long > const *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (long)((std::vector< long > const *)arg1)->at(arg2); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_resize" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - std::vector< long > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_swap" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVector" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LongVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_long_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IntVector")) SWIG_fail; - result = (std::vector< int > *)new std::vector< int >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_push_back" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_push_back" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_clear" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_data" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - result = (int *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_size" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_at" "', argument " "1"" of type '" "std::vector< int > const *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (int)((std::vector< int > const *)arg1)->at(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_resize" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - std::vector< int > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_swap" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IntVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntVector" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_int_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorTransformVector")) SWIG_fail; - result = (std::vector< faiss::VectorTransform * > *)new std::vector< faiss::VectorTransform * >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_push_back" "', argument " "2"" of type '" "faiss::VectorTransform *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_clear" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_data" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - result = (faiss::VectorTransform **)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__VectorTransform, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_size" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_at" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::VectorTransform *)((std::vector< faiss::VectorTransform * > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_resize" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - std::vector< faiss::VectorTransform * > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_swap" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransformVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransformVector" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorTransformVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPointVector")) SWIG_fail; - result = (std::vector< faiss::OperatingPoint > *)new std::vector< faiss::OperatingPoint >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - faiss::OperatingPoint arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoint, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'"); - } else { - faiss::OperatingPoint * temp = reinterpret_cast< faiss::OperatingPoint * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_clear" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OperatingPoint *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_data" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - result = (faiss::OperatingPoint *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_size" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OperatingPoint result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_at" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< faiss::OperatingPoint > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new faiss::OperatingPoint(static_cast< const faiss::OperatingPoint& >(result))), SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_resize" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_swap" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPointVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPointVector" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPointVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_InvertedListsPtrVector")) SWIG_fail; - result = (std::vector< faiss::InvertedLists * > *)new std::vector< faiss::InvertedLists * >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_push_back" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_clear" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_data" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - result = (faiss::InvertedLists **)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_size" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_at" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::InvertedLists *)((std::vector< faiss::InvertedLists * > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_resize" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - std::vector< faiss::InvertedLists * > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_swap" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InvertedListsPtrVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InvertedListsPtrVector" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InvertedListsPtrVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_FloatVectorVector")) SWIG_fail; - result = (std::vector< std::vector< float > > *)new std::vector< std::vector< float > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - std::vector< float > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'"); - } else { - std::vector< float > * temp = reinterpret_cast< std::vector< float > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - result = (std::vector< float > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< float > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< float > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< float > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< float >(static_cast< const std::vector< float >& >(result))), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - std::vector< std::vector< float > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< float > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *FloatVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ByteVectorVector")) SWIG_fail; - result = (std::vector< std::vector< unsigned char > > *)new std::vector< std::vector< unsigned char > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - std::vector< unsigned char > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'"); - } else { - std::vector< unsigned char > * temp = reinterpret_cast< std::vector< unsigned char > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< unsigned char > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - result = (std::vector< unsigned char > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< unsigned char > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< unsigned char > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< unsigned char >(static_cast< const std::vector< unsigned char >& >(result))), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - std::vector< std::vector< unsigned char > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ByteVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LongVectorVector")) SWIG_fail; - result = (std::vector< std::vector< long > > *)new std::vector< std::vector< long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - std::vector< long > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'"); - } else { - std::vector< long > * temp = reinterpret_cast< std::vector< long > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - result = (std::vector< long > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< long > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< long > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< long > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< long >(static_cast< const std::vector< long >& >(result))), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - std::vector< std::vector< long > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< long > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LongVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuResourcesVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuResourcesVector")) SWIG_fail; - result = (std::vector< faiss::gpu::GpuResources * > *)new std::vector< faiss::gpu::GpuResources * >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - faiss::gpu::GpuResources *arg2 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResourcesVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuResourcesVector_push_back" "', argument " "2"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg2 = reinterpret_cast< faiss::gpu::GpuResources * >(argp2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResourcesVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_clear" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::GpuResources **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResourcesVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_data" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - result = (faiss::gpu::GpuResources **)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__gpu__GpuResources, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResourcesVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_size" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuResources *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResourcesVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_at" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResourcesVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::gpu::GpuResources *)((std::vector< faiss::gpu::GpuResources * > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResourcesVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_resize" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResourcesVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResourcesVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - std::vector< faiss::gpu::GpuResources * > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResourcesVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResourcesVector_swap" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuResourcesVector_swap" "', argument " "2"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GpuResourcesVector_swap" "', argument " "2"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuResourcesVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = (std::vector< faiss::gpu::GpuResources * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuResourcesVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuResourcesVector" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuResourcesVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_hamming_batch_size_set(PyObject *_val) { - { - size_t val; - int res = SWIG_AsVal_size_t(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::hamming_batch_size""' of type '""size_t""'"); - } - faiss::hamming_batch_size = static_cast< size_t >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_hamming_batch_size_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_size_t(static_cast< size_t >(faiss::hamming_batch_size)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_popcount64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint64_t arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:popcount64",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "popcount64" "', argument " "1"" of type '" "uint64_t""'"); - } - arg1 = static_cast< uint64_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::popcount64(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - hamdis_t *arg6 = (hamdis_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "hammings" "', argument " "6"" of type '" "hamdis_t *""'"); - } - arg6 = reinterpret_cast< hamdis_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_bitvec_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:bitvec_print",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bitvec_print" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bitvec_print" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::bitvec_print((unsigned char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs2bitvecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs2bitvecs",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvecs2bitvecs" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs2bitvecs" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs2bitvecs" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvecs2bitvecs" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvecs2bitvecs((float const *)arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec2bitvec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec2bitvec",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec2bitvec" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec2bitvec" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec2bitvec" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec2bitvec((float const *)arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn_hc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_hc" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn_mc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - int32_t *arg7 = (int32_t *) 0 ; - long *arg8 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:hammings_knn_mc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_mc" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_mc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings_knn_mc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_mc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_mc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_mc" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hammings_knn_mc" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "hammings_knn_mc" "', argument " "8"" of type '" "long *""'"); - } - arg8 = reinterpret_cast< long * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn_mc((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - hamdis_t arg5 ; - size_t arg6 ; - size_t *arg7 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:hamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hamming_count_thres" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hamming_count_thres" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hamming_count_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hamming_count_thres" "', argument " "5"" of type '" "hamdis_t""'"); - } - arg5 = static_cast< hamdis_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hamming_count_thres" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hamming_count_thres" "', argument " "7"" of type '" "size_t *""'"); - } - arg7 = reinterpret_cast< size_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hamming_count_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_match_hamming_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - hamdis_t arg5 ; - size_t arg6 ; - long *arg7 = (long *) 0 ; - hamdis_t *arg8 = (hamdis_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:match_hamming_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "match_hamming_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "match_hamming_thres" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "match_hamming_thres" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "match_hamming_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "match_hamming_thres" "', argument " "5"" of type '" "hamdis_t""'"); - } - arg5 = static_cast< hamdis_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "match_hamming_thres" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "match_hamming_thres" "', argument " "7"" of type '" "long *""'"); - } - arg7 = reinterpret_cast< long * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "match_hamming_thres" "', argument " "8"" of type '" "hamdis_t *""'"); - } - arg8 = reinterpret_cast< hamdis_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::match_hamming_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_crosshamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - hamdis_t arg3 ; - size_t arg4 ; - size_t *arg5 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:crosshamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "crosshamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "crosshamming_count_thres" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "crosshamming_count_thres" "', argument " "3"" of type '" "hamdis_t""'"); - } - arg3 = static_cast< hamdis_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "crosshamming_count_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "crosshamming_count_thres" "', argument " "5"" of type '" "size_t *""'"); - } - arg5 = reinterpret_cast< size_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::crosshamming_count_thres((unsigned char const *)arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'"); - } else { - uint32_t * temp = reinterpret_cast< uint32_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer4_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - result = ((arg1)->a0); - resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer4")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer4 *)new faiss::HammingComputer4(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer4",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer4" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer4" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer4 *)new faiss::HammingComputer4((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer4__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer4__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer4'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer4::HammingComputer4()\n" - " faiss::HammingComputer4::HammingComputer4(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer4_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer4_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_hamming" "', argument " "1"" of type '" "faiss::HammingComputer4 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer4 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer4",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer4" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer4, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer8_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer8")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer8 *)new faiss::HammingComputer8(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer8 *)new faiss::HammingComputer8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer8__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer8__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer8'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer8::HammingComputer8()\n" - " faiss::HammingComputer8::HammingComputer8(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer8_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer8_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_hamming" "', argument " "1"" of type '" "faiss::HammingComputer8 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer8" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer16")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer16 *)new faiss::HammingComputer16(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer16",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer16" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer16 *)new faiss::HammingComputer16((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer16__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer16__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer16'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer16::HammingComputer16()\n" - " faiss::HammingComputer16::HammingComputer16(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer16_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer16_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_hamming" "', argument " "1"" of type '" "faiss::HammingComputer16 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer16",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer16" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer16, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer20_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'"); - } else { - uint32_t * temp = reinterpret_cast< uint32_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = ((arg1)->a2); - resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer20")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer20 *)new faiss::HammingComputer20(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer20 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer20",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer20" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer20" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer20 *)new faiss::HammingComputer20((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer20__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer20__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer20'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer20::HammingComputer20()\n" - " faiss::HammingComputer20::HammingComputer20(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer20_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer20_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_hamming" "', argument " "1"" of type '" "faiss::HammingComputer20 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer20 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer20(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer20",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer20" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer20_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer20, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer32")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer32 *)new faiss::HammingComputer32(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer32" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer32 *)new faiss::HammingComputer32((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer32__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer32__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer32'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer32::HammingComputer32()\n" - " faiss::HammingComputer32::HammingComputer32(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer32_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer32_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_hamming" "', argument " "1"" of type '" "faiss::HammingComputer32 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer32" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer32, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer64_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a4_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a4_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a4 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a4_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a4_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a4); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a5_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a5_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a5_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a5 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a5_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a5_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a5); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a6_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a6_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a6_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a6 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a6_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a6_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a6); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a7_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a7_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a7_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a7 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a7_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a7_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a7); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer64")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer64 *)new faiss::HammingComputer64(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer64 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer64" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer64" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer64 *)new faiss::HammingComputer64((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer64__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer64__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer64'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer64::HammingComputer64()\n" - " faiss::HammingComputer64::HammingComputer64(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer64_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer64_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_hamming" "', argument " "1"" of type '" "faiss::HammingComputer64 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer64 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer64" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer64_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer64, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_a_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - if (arg1) (arg1)->a = (uint8_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - result = (uint8_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerDefault_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerDefault")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerDefault *)new faiss::HammingComputerDefault(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerDefault *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerDefault",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerDefault" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerDefault" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerDefault *)new faiss::HammingComputerDefault((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerDefault__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerDefault__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerDefault'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerDefault::HammingComputerDefault()\n" - " faiss::HammingComputerDefault::HammingComputerDefault(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerDefault_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerDefault_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_hamming" "', argument " "1"" of type '" "faiss::HammingComputerDefault const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerDefault const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerDefault(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerDefault",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerDefault" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerDefault_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint64_t *arg2 = (uint64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'"); - } - arg2 = reinterpret_cast< uint64_t * >(argp2); - if (arg1) (arg1)->a = (uint64_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - result = (uint64_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM8_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM8")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM8 *)new faiss::HammingComputerM8(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM8 *)new faiss::HammingComputerM8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerM8__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerM8__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM8'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerM8::HammingComputerM8()\n" - " faiss::HammingComputerM8::HammingComputerM8(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM8_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM8_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM8 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM8" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerM4_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint32_t *arg2 = (uint32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_uint32_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_a_set" "', argument " "2"" of type '" "uint32_t const *""'"); - } - arg2 = reinterpret_cast< uint32_t * >(argp2); - if (arg1) (arg1)->a = (uint32_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - result = (uint32_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint32_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM4_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM4")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM4 *)new faiss::HammingComputerM4(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerM4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM4",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM4" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM4" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM4 *)new faiss::HammingComputerM4((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerM4__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerM4__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM4'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerM4::HammingComputerM4()\n" - " faiss::HammingComputerM4::HammingComputerM4(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM4_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM4_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM4 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerM4 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerM4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM4",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM4" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerM4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM4, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_generalized_hamming_64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint64_t arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:generalized_hamming_64",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "generalized_hamming_64" "', argument " "1"" of type '" "uint64_t""'"); - } - arg1 = static_cast< uint64_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::generalized_hamming_64(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer8_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer8 *)new faiss::GenHammingComputer8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer8 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer8" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer16",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer16" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer16 *)new faiss::GenHammingComputer16((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer16 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer16",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer16" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer32" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer32 *)new faiss::GenHammingComputer32((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer32 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer32" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - uint64_t *arg2 = (uint64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'"); - } - arg2 = reinterpret_cast< uint64_t * >(argp2); - if (arg1) (arg1)->a = (uint64_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - result = (uint64_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputerM8_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputerM8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputerM8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputerM8 *)new faiss::GenHammingComputerM8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputerM8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputerM8" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "generalized_hammings_knn_hc" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_generalized_hammings_knn_hc__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_generalized_hammings_knn_hc__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'generalized_hammings_knn_hc'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t,int)\n" - " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_get_num_gpus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int result; - - if (!PyArg_ParseTuple(args,(char *)":get_num_gpus")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)get_num_gpus(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuResources(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuResources",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuResources" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_initializeForDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_initializeForDevice",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_initializeForDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_initializeForDevice" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->initializeForDevice(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getBlasHandle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cublasHandle_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_getBlasHandle",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getBlasHandle" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_getBlasHandle" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getBlasHandle(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cublasHandle_t(static_cast< const cublasHandle_t& >(result))), SWIGTYPE_p_cublasHandle_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getDefaultStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_getDefaultStream",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getDefaultStream" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_getDefaultStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getDefaultStream(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getAlternateStreams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - SwigValueWrapper< std::vector< cudaStream_t > > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_getAlternateStreams",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getAlternateStreams" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_getAlternateStreams" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAlternateStreams(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::vector< cudaStream_t >(static_cast< const std::vector< cudaStream_t >& >(result))), SWIGTYPE_p_std__vectorT_cudaStream_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getPinnedMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::pair< void *,size_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_getPinnedMemory",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getPinnedMemory" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getPinnedMemory(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::pair< void *,size_t >(static_cast< const std::pair< void *,size_t >& >(result))), SWIGTYPE_p_std__pairT_void_p_unsigned_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getAsyncCopyStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_getAsyncCopyStream",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getAsyncCopyStream" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_getAsyncCopyStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAsyncCopyStream(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getBlasHandleCurrentDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - cublasHandle_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_getBlasHandleCurrentDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getBlasHandleCurrentDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getBlasHandleCurrentDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cublasHandle_t(static_cast< const cublasHandle_t& >(result))), SWIGTYPE_p_cublasHandle_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getDefaultStreamCurrentDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_getDefaultStreamCurrentDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getDefaultStreamCurrentDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getDefaultStreamCurrentDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_syncDefaultStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuResources_syncDefaultStream",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_syncDefaultStream" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuResources_syncDefaultStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->syncDefaultStream(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_syncDefaultStreamCurrentDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_syncDefaultStreamCurrentDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_syncDefaultStreamCurrentDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->syncDefaultStreamCurrentDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getAlternateStreamsCurrentDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - SwigValueWrapper< std::vector< cudaStream_t > > result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_getAlternateStreamsCurrentDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getAlternateStreamsCurrentDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAlternateStreamsCurrentDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::vector< cudaStream_t >(static_cast< const std::vector< cudaStream_t >& >(result))), SWIGTYPE_p_std__vectorT_cudaStream_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuResources_getAsyncCopyStreamCurrentDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuResources_getAsyncCopyStreamCurrentDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuResources_getAsyncCopyStreamCurrentDevice" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAsyncCopyStreamCurrentDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuResources_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuResources, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_StandardGpuResources(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_StandardGpuResources")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::StandardGpuResources *)new faiss::gpu::StandardGpuResources(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__StandardGpuResources, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_StandardGpuResources(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_StandardGpuResources",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StandardGpuResources" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_noTempMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:StandardGpuResources_noTempMemory",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_noTempMemory" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->noTempMemory(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_setTempMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_setTempMemory",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_setTempMemory" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_setTempMemory" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setTempMemory(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_setPinnedMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_setPinnedMemory",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_setPinnedMemory" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_setPinnedMemory" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setPinnedMemory(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_setDefaultStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - cudaStream_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:StandardGpuResources_setDefaultStream",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_setDefaultStream" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_setDefaultStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_cudaStream_t, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StandardGpuResources_setDefaultStream" "', argument " "3"" of type '" "cudaStream_t""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StandardGpuResources_setDefaultStream" "', argument " "3"" of type '" "cudaStream_t""'"); - } else { - cudaStream_t * temp = reinterpret_cast< cudaStream_t * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setDefaultStream(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_setDefaultNullStreamAllDevices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:StandardGpuResources_setDefaultNullStreamAllDevices",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_setDefaultNullStreamAllDevices" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setDefaultNullStreamAllDevices(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_setCudaMallocWarning(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_setCudaMallocWarning",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_setCudaMallocWarning" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_setCudaMallocWarning" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setCudaMallocWarning(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_initializeForDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_initializeForDevice",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_initializeForDevice" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_initializeForDevice" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->initializeForDevice(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_getBlasHandle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cublasHandle_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_getBlasHandle",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_getBlasHandle" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_getBlasHandle" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getBlasHandle(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cublasHandle_t(static_cast< const cublasHandle_t& >(result))), SWIGTYPE_p_cublasHandle_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_getDefaultStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_getDefaultStream",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_getDefaultStream" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_getDefaultStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getDefaultStream(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_getAlternateStreams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - SwigValueWrapper< std::vector< cudaStream_t > > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_getAlternateStreams",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_getAlternateStreams" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_getAlternateStreams" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAlternateStreams(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::vector< cudaStream_t >(static_cast< const std::vector< cudaStream_t >& >(result))), SWIGTYPE_p_std__vectorT_cudaStream_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_getPinnedMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::pair< void *,size_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:StandardGpuResources_getPinnedMemory",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_getPinnedMemory" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getPinnedMemory(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::pair< void *,size_t >(static_cast< const std::pair< void *,size_t >& >(result))), SWIGTYPE_p_std__pairT_void_p_unsigned_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_StandardGpuResources_getAsyncCopyStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - cudaStream_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:StandardGpuResources_getAsyncCopyStream",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__StandardGpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StandardGpuResources_getAsyncCopyStream" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_getAsyncCopyStream" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (arg1)->getAsyncCopyStream(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new cudaStream_t(static_cast< const cudaStream_t& >(result))), SWIGTYPE_p_cudaStream_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *StandardGpuResources_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__StandardGpuResources, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_getmillisecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double result; - - if (!PyArg_ParseTuple(args,(char *)":getmillisecs")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::getmillisecs(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_get_mem_usage_kb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)":get_mem_usage_kb")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::get_mem_usage_kb(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_mt_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - std::mt19937 arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_mt_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_set" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mt19937, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'"); - } else { - std::mt19937 * temp = reinterpret_cast< std::mt19937 * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->mt = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_mt_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::mt19937 result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_mt_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_get" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - result = ((arg1)->mt); - resultobj = SWIG_NewPointerObj((new std::mt19937(static_cast< const std::mt19937& >(result))), SWIGTYPE_p_std__mt19937, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_int",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->rand_int(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_long",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_long" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->rand_long(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_rand_int",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomGenerator_rand_int" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->rand_int(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_RandomGenerator_rand_int__SWIG_0(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_RandomGenerator_rand_int__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'RandomGenerator_rand_int'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomGenerator::rand_int()\n" - " faiss::RandomGenerator::rand_int(int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_float",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_float" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)(arg1)->rand_float(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_double(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_double",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_double" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->rand_double(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RandomGenerator",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomGenerator" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomGenerator *)new faiss::RandomGenerator(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RandomGenerator")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomGenerator *)new faiss::RandomGenerator(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RandomGenerator__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RandomGenerator__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomGenerator'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomGenerator::RandomGenerator(long)\n" - " faiss::RandomGenerator::RandomGenerator()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RandomGenerator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomGenerator",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomGenerator" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RandomGenerator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomGenerator, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_float_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_rand" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::float_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_randn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_randn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_randn" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_randn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_randn" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::float_randn(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_long_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long *arg1 = (long *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:long_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "long_rand" "', argument " "1"" of type '" "long *""'"); - } - arg1 = reinterpret_cast< long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "long_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "long_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::long_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_byte_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:byte_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "byte_rand" "', argument " "1"" of type '" "uint8_t *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "byte_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "byte_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::byte_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rand_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:rand_perm",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_perm" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_perm" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rand_perm" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::rand_perm(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_L2sqr",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_L2sqr((float const *)arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_inner_product",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_inner_product((float const *)arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - long *arg3 = (long *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:imbalance_factor",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "imbalance_factor" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::imbalance_factor(arg1,arg2,(long const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int *arg2 = (int *) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:imbalance_factor",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::imbalance_factor(arg1,(int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_imbalance_factor__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_imbalance_factor__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'imbalance_factor'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::imbalance_factor(int,int,long const *)\n" - " faiss::imbalance_factor(int,int const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long arg8 ; - long arg9 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - long val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - ecode9 = SWIG_AsVal_long(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "pairwise_L2sqr" "', argument " "9"" of type '" "long""'"); - } - arg9 = static_cast< long >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long arg8 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[10] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 9) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_3(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_2(self, args); - } - } - } - } - } - } - } - } - if (argc == 8) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'pairwise_L2sqr'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_products_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_inner_products_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_ny" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_ny" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_ny" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_inner_products_ny" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_ny" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_inner_products_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_L2sqr_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_ny" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_ny" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_ny" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_L2sqr_ny" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_ny" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_L2sqr_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norm_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:fvec_norm_L2sqr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norm_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_norm_L2sqr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_norm_L2sqr((float const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norms_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_norms_L2(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norms_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2sqr",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2sqr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_norms_L2sqr(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_renorm_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_renorm_L2",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_renorm_L2" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_renorm_L2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_renorm_L2" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_renorm_L2(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_inner_product_to_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:inner_product_to_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "inner_product_to_L2sqr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "inner_product_to_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "inner_product_to_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "inner_product_to_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "inner_product_to_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::inner_product_to_L2sqr(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_by_idx" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_by_idx" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_inner_products_by_idx" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_inner_products_by_idx" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_inner_products_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_by_idx" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_by_idx" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_L2sqr_by_idx" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_L2sqr_by_idx" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_L2sqr_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN int Swig_var_distance_compute_blas_threshold_set(PyObject *_val) { - { - int val; - int res = SWIG_AsVal_int(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::distance_compute_blas_threshold""' of type '""int""'"); - } - faiss::distance_compute_blas_threshold = static_cast< int >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_distance_compute_blas_threshold_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::distance_compute_blas_threshold)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_knn_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_product" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_product" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_inner_product" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr_base_shift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_base_shift",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_base_shift" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_base_shift" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr_base_shift" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_base_shift" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_base_shift" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr_base_shift" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_base_shift" "', argument " "7"" of type '" "float const *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr_base_shift((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,(float const *)arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - faiss::float_minheap_array_t *arg7 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_products_by_idx" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_inner_products_by_idx" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_products_by_idx" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_inner_products_by_idx" "', argument " "7"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg7 = reinterpret_cast< faiss::float_minheap_array_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_inner_products_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - faiss::float_maxheap_array_t *arg7 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_by_idx" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_L2sqr_by_idx" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_by_idx" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_by_idx" "', argument " "7"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg7 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_range_search_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - float arg6 ; - faiss::RangeSearchResult *arg7 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - float val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_float(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_L2sqr" "', argument " "6"" of type '" "float""'"); - } - arg6 = static_cast< float >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_L2sqr" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'"); - } - arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::range_search_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_range_search_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - float arg6 ; - faiss::RangeSearchResult *arg7 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - float val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_inner_product" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_inner_product" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_float(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_inner_product" "', argument " "6"" of type '" "float""'"); - } - arg6 = static_cast< float >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_inner_product" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'"); - } - arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::range_search_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_madd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - float arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_madd(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_madd_and_argmin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - float arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd_and_argmin",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd_and_argmin" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd_and_argmin" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd_and_argmin" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd_and_argmin" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd_and_argmin" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::fvec_madd_and_argmin(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_reflection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:reflection",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "reflection" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "reflection" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "reflection" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "reflection" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "reflection" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::reflection((float const *)arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_km_update_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:km_update_centroids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "km_update_centroids" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "km_update_centroids" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "km_update_centroids" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "km_update_centroids" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "km_update_centroids" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "km_update_centroids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "km_update_centroids" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::km_update_centroids((float const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_matrix_qr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float *arg3 = (float *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:matrix_qr",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "matrix_qr" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matrix_qr" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "matrix_qr" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::matrix_qr(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ranklist_handle_ties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - long *arg2 = (long *) 0 ; - float *arg3 = (float *) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ranklist_handle_ties",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_handle_ties" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_handle_ties" "', argument " "2"" of type '" "long *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ranklist_handle_ties" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ranklist_handle_ties(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ranklist_intersection_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - long *arg2 = (long *) 0 ; - size_t arg3 ; - long *arg4 = (long *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ranklist_intersection_size",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_intersection_size" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_intersection_size" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ranklist_intersection_size" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ranklist_intersection_size" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::ranklist_intersection_size(arg1,(long const *)arg2,arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - bool arg7 ; - long arg8 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 ; - bool val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "merge_result_table_with" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - bool arg7 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[9] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 8) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_merge_result_table_with__SWIG_2(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_merge_result_table_with__SWIG_1(self, args); - } - } - } - } - } - } - } - } - if (argc == 8) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_merge_result_table_with__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'merge_result_table_with'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool,long)\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool)\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_fvec_argsort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - size_t *arg3 = (size_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_argsort(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_argsort_parallel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - size_t *arg3 = (size_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort_parallel",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort_parallel" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort_parallel" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort_parallel" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_argsort_parallel(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ivec_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int *arg4 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ivec_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_hist" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_hist" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ivec_hist" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ivec_hist" "', argument " "4"" of type '" "int *""'"); - } - arg4 = reinterpret_cast< int * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::ivec_hist(arg1,(int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_bincode_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - int *arg4 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:bincode_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bincode_hist" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bincode_hist" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "bincode_hist" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "bincode_hist" "', argument " "4"" of type '" "int *""'"); - } - arg4 = reinterpret_cast< int * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::bincode_hist(arg1,arg2,(unsigned char const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ivec_checksum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - int *arg2 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ivec_checksum",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_checksum" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_checksum" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::ivec_checksum(arg1,(int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - bool arg5 ; - long arg6 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - bool val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - ecode5 = SWIG_AsVal_bool(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'"); - } - arg5 = static_cast< bool >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvecs_maybe_subsample" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - bool arg5 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - bool val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - ecode5 = SWIG_AsVal_bool(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'"); - } - arg5 = static_cast< bool >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'fvecs_maybe_subsample'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool,long)\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool)\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_binary_to_real(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:binary_to_real",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "binary_to_real" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "binary_to_real" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "binary_to_real" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::binary_to_real(arg1,(unsigned char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_real_to_binary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:real_to_binary",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "real_to_binary" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "real_to_binary" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "real_to_binary" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::real_to_binary(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hash_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:hash_bytes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hash_bytes" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "hash_bytes" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint64_t)faiss::hash_bytes((unsigned char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_check_openmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool result; - - if (!PyArg_ParseTuple(args,(char *)":check_openmp")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)faiss::check_openmp(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_d_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (int) ((arg1)->d); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_ntotal_set" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (faiss::Index::idx_t) ((arg1)->ntotal); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_metric_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_metric_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_metric_type_set" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - if (arg1) (arg1)->metric_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_metric_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::MetricType result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_metric_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (faiss::MetricType) ((arg1)->metric_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Index" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_train" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add_with_ids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Index_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_range_search" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - faiss::Index::idx_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_assign",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Index_assign" "', argument " "5"" of type '" "faiss::Index::idx_t""'"); - } - arg5 = static_cast< faiss::Index::idx_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_assign",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Index_assign__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_Index_assign__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Index_assign'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *,faiss::Index::idx_t)\n" - " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Index_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reset" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_remove_ids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct_n" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Index_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Index_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search_and_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Index_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_compute_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_compute_residual",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_compute_residual" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_compute_residual" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_compute_residual" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_compute_residual" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->compute_residual((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_display" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Index_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Index, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_niter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_niter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_niter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->niter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_nredo_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_nredo_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nredo = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_nredo_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->nredo); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_spherical_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_spherical_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->spherical = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_spherical_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->spherical); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_int_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->int_centroids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_int_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->int_centroids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_update_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_update_index_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->update_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_update_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->update_index); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_frozen_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->frozen_centroids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_frozen_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->frozen_centroids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_min_points_per_centroid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->min_points_per_centroid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_min_points_per_centroid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->min_points_per_centroid); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_max_points_per_centroid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->max_points_per_centroid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_max_points_per_centroid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->max_points_per_centroid); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_seed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_seed_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->seed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_seed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->seed); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ClusteringParameters")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ClusteringParameters *)new faiss::ClusteringParameters(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ClusteringParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ClusteringParameters" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ClusteringParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ClusteringParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Clustering_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->centroids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (std::vector< float > *)& ((arg1)->centroids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_obj_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_obj_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_obj_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->obj = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_obj_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (std::vector< float > *)& ((arg1)->obj); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Clustering *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Clustering",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - faiss::ClusteringParameters *arg3 = 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Clustering *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_Clustering",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'"); - } - arg3 = reinterpret_cast< faiss::ClusteringParameters * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2,(faiss::ClusteringParameters const &)*arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Clustering__SWIG_0(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__ClusteringParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Clustering__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Clustering'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Clustering::Clustering(int,int)\n" - " faiss::Clustering::Clustering(int,int,faiss::ClusteringParameters const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Clustering_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - faiss::Clustering::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index *arg4 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Clustering_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_train" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_train" "', argument " "2"" of type '" "faiss::Clustering::idx_t""'"); - } - arg2 = static_cast< faiss::Clustering::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Clustering_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_faiss__Index, 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'"); - } - if (!argp4) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'"); - } - arg4 = reinterpret_cast< faiss::Index * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3,*arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_post_process_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_post_process_centroids",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_post_process_centroids" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->post_process_centroids(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Clustering",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Clustering" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Clustering_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Clustering, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_kmeans_clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:kmeans_clustering",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "kmeans_clustering" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "kmeans_clustering" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "kmeans_clustering" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "kmeans_clustering" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "kmeans_clustering" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::kmeans_clustering(arg1,arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_M_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->M); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_nbits_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->nbits); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_dsub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_dsub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->dsub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_dsub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->dsub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_byte_per_idx_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->byte_per_idx = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_byte_per_idx_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->byte_per_idx); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_ksub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_ksub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ksub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_ksub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->ksub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::ProductQuantizer::train_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_train_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train_type_set" "', argument " "2"" of type '" "faiss::ProductQuantizer::train_type_t""'"); - } - arg2 = static_cast< faiss::ProductQuantizer::train_type_t >(val2); - if (arg1) (arg1)->train_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer::train_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_train_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::ProductQuantizer::train_type_t) ((arg1)->train_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_assign_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_assign_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->assign_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_assign_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::Index *) ((arg1)->assign_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->centroids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->centroids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_get_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_get_centroids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_get_centroids" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_get_centroids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_get_centroids" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)(arg1)->get_centroids(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t arg3 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_ProductQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ProductQuantizer" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ProductQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ProductQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)new faiss::ProductQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ProductQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)new faiss::ProductQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_ProductQuantizer__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ProductQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::ProductQuantizer(size_t,size_t,size_t)\n" - " faiss::ProductQuantizer::ProductQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_set_derived_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_set_derived_values",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_derived_values" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_derived_values(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_set_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_set_params",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_params" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_set_params" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_set_params" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_params((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_code((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_codes((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes_with_assign_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes_with_assign_index",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->compute_codes_with_assign_index((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_decode",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_decode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_decode" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_decode__SWIG_0(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_decode__SWIG_1(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_decode'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::decode(uint8_t const *,float *) const\n" - " faiss::ProductQuantizer::decode(uint8_t const *,float *,size_t) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code_from_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code_from_distance_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_code_from_distance_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_distance_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_distance_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_inner_prod_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_distance_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_distance_tables(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_inner_prod_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_tables(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_ip" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search_ip__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search_ip__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_ip'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_sdc_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->sdc_table = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_sdc_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->sdc_table); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_sdc_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_compute_sdc_table",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_sdc_table" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->compute_sdc_table(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_sdc" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search_sdc__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search_sdc__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_sdc'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_ProductQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ProductQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ProductQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorTransform_d_in_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_in_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_in_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d_in = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_in_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_in_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (int) ((arg1)->d_in); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_out_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_out_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_out_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d_out = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_out_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_out_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (int) ((arg1)->d_out); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_train" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_train" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_apply(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_apply",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::VectorTransform const *)arg1)->apply(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::VectorTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_reverse_transform" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::VectorTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_have_bias_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_have_bias_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->have_bias = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_have_bias_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->have_bias); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_is_orthonormal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_orthonormal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_is_orthonormal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->is_orthonormal); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_A_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_A_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_A_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->A = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_A_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_A_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->A); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_b_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_b_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_b_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->b = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_b_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_b_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->b); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - bool arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_LinearTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_LinearTransform" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_LinearTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_LinearTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LinearTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_LinearTransform__SWIG_3(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_LinearTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::LinearTransform::LinearTransform(int,int,bool)\n" - " faiss::LinearTransform::LinearTransform(int,int)\n" - " faiss::LinearTransform::LinearTransform(int)\n" - " faiss::LinearTransform::LinearTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_transform_transpose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_transform_transpose",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_transform_transpose" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_transform_transpose" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_transform_transpose" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_transform_transpose" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->transform_transpose(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_reverse_transform" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_set_is_orthonormal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_set_is_orthonormal",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_set_is_orthonormal" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_is_orthonormal(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LinearTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LinearTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearTransform" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LinearTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__LinearTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RandomRotationMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomRotationMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RandomRotationMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomRotationMatrix *)new faiss::RandomRotationMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomRotationMatrix_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomRotationMatrix_init",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_init" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_init" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomRotationMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:RandomRotationMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_train" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RandomRotationMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RandomRotationMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomRotationMatrix *)new faiss::RandomRotationMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RandomRotationMatrix__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RandomRotationMatrix__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomRotationMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomRotationMatrix::RandomRotationMatrix(int,int)\n" - " faiss::RandomRotationMatrix::RandomRotationMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RandomRotationMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomRotationMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomRotationMatrix" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RandomRotationMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigen_power_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_eigen_power_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->eigen_power = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigen_power_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (float) ((arg1)->eigen_power); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_random_rotation_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_random_rotation_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->random_rotation = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_random_rotation_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (bool) ((arg1)->random_rotation); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_max_points_per_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_points_per_d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_max_points_per_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (size_t) ((arg1)->max_points_per_d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_balanced_bins_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->balanced_bins = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_balanced_bins_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (int) ((arg1)->balanced_bins); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_mean_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->mean = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_mean_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->mean); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigenvalues_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->eigenvalues = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigenvalues_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->eigenvalues); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_PCAMat_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_PCAMat_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->PCAMat = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_PCAMat_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->PCAMat); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float arg3 ; - bool arg4 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_PCAMatrix",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_PCAMatrix" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_PCAMatrix",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_PCAMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_PCAMatrix",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_PCAMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_PCAMatrix__SWIG_4(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_3(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_PCAMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::PCAMatrix::PCAMatrix(int,int,float,bool)\n" - " faiss::PCAMatrix::PCAMatrix(int,int,float)\n" - " faiss::PCAMatrix::PCAMatrix(int,int)\n" - " faiss::PCAMatrix::PCAMatrix(int)\n" - " faiss::PCAMatrix::PCAMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:PCAMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_train" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PCAMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_copy_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - faiss::PCAMatrix *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_copy_from",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_copy_from" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__PCAMatrix, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'"); - } - arg2 = reinterpret_cast< faiss::PCAMatrix * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copy_from((faiss::PCAMatrix const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_prepare_Ab(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_prepare_Ab",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_prepare_Ab" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->prepare_Ab(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PCAMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PCAMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PCAMatrix" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PCAMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PCAMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OPQMatrix_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_M_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->M); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter_pq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter_pq); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter_pq_0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter_pq_0); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_max_train_points_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_max_train_points_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_train_points = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_max_train_points_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (size_t) ((arg1)->max_train_points); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPQMatrix_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (faiss::ProductQuantizer *) ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_OPQMatrix",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_OPQMatrix" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_OPQMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_OPQMatrix",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OPQMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_OPQMatrix__SWIG_3(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_OPQMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OPQMatrix::OPQMatrix(int,int,int)\n" - " faiss::OPQMatrix::OPQMatrix(int,int)\n" - " faiss::OPQMatrix::OPQMatrix(int)\n" - " faiss::OPQMatrix::OPQMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OPQMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_train" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OPQMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OPQMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OPQMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OPQMatrix" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OPQMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OPQMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RemapDimensionsTransform_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_set" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RemapDimensionsTransform_map_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RemapDimensionsTransform_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_get" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - result = (std::vector< int > *)& ((arg1)->map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int *arg3 = (int *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "int const *""'"); - } - arg3 = reinterpret_cast< int * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,(int const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - bool arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RemapDimensionsTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::RemapDimensionsTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::RemapDimensionsTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RemapDimensionsTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RemapDimensionsTransform__SWIG_3(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RemapDimensionsTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,int const *)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,bool)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RemapDimensionsTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RemapDimensionsTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RemapDimensionsTransform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RemapDimensionsTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:NormalizationTransform_norm_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_set" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_norm_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->norm = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:NormalizationTransform_norm_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_get" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - result = (float) ((arg1)->norm); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - float arg2 ; - int val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_NormalizationTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_NormalizationTransform" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_NormalizationTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_NormalizationTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_NormalizationTransform__SWIG_2(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_NormalizationTransform__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_NormalizationTransform__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_NormalizationTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::NormalizationTransform::NormalizationTransform(int,float)\n" - " faiss::NormalizationTransform::NormalizationTransform(int)\n" - " faiss::NormalizationTransform::NormalizationTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::NormalizationTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_reverse_transform" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::NormalizationTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_NormalizationTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_NormalizationTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_NormalizationTransform" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *NormalizationTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__NormalizationTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_CenteringTransform_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CenteringTransform_mean_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_set" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CenteringTransform_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->mean = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CenteringTransform_mean_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_get" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->mean); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::CenteringTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_CenteringTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CenteringTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::CenteringTransform *)new faiss::CenteringTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CenteringTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::CenteringTransform *)new faiss::CenteringTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_CenteringTransform__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CenteringTransform__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CenteringTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::CenteringTransform::CenteringTransform(int)\n" - " faiss::CenteringTransform::CenteringTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:CenteringTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_train" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::CenteringTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_reverse_transform" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::CenteringTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_CenteringTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_CenteringTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CenteringTransform" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CenteringTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__CenteringTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - std::vector< faiss::VectorTransform * > *arg2 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_chain_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_chain_set" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2); - if (arg1) (arg1)->chain = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::VectorTransform * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_chain_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (std::vector< faiss::VectorTransform * > *)& ((arg1)->chain); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexPreTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPreTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexPreTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IndexPreTransform" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexPreTransform__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexPreTransform__SWIG_0(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__VectorTransform, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexPreTransform__SWIG_2(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexPreTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexPreTransform::IndexPreTransform(faiss::Index *)\n" - " faiss::IndexPreTransform::IndexPreTransform()\n" - " faiss::IndexPreTransform::IndexPreTransform(faiss::VectorTransform *,faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_prepend_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_prepend_transform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_prepend_transform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_prepend_transform" "', argument " "2"" of type '" "faiss::VectorTransform *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->prepend_transform(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_train" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add_with_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reset" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_remove_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPreTransform_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexPreTransform_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_range_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexPreTransform_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_apply_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_apply_chain",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_apply_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_apply_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_apply_chain" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::IndexPreTransform const *)arg1)->apply_chain(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reverse_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reverse_chain",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reverse_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reverse_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reverse_chain" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reverse_chain" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reverse_chain(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPreTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPreTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPreTransform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPreTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPreTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlat_xb_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat_xb_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_set" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat_xb_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->xb = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_xb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_xb_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_get" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - result = (std::vector< float > *)& ((arg1)->xb); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - faiss::MetricType arg2 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexFlat",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexFlat" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlat",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_add" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_reset" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexFlat_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_range_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_reconstruct" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_compute_distance_subset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat_compute_distance_subset",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_compute_distance_subset" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_compute_distance_subset" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_compute_distance_subset" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_compute_distance_subset" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_compute_distance_subset" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat_compute_distance_subset" "', argument " "6"" of type '" "faiss::Index::idx_t const *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->compute_distance_subset(arg2,(float const *)arg3,arg4,arg5,(faiss::Index::idx_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_remove_ids" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlat__SWIG_2(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlat::IndexFlat(faiss::Index::idx_t,faiss::MetricType)\n" - " faiss::IndexFlat::IndexFlat(faiss::Index::idx_t)\n" - " faiss::IndexFlat::IndexFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlat" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlatIP",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatIP" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatIP *)new faiss::IndexFlatIP(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlatIP")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatIP *)new faiss::IndexFlatIP(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlatIP__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlatIP__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlatIP'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlatIP::IndexFlatIP(faiss::Index::idx_t)\n" - " faiss::IndexFlatIP::IndexFlatIP()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatIP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatIP *arg1 = (faiss::IndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatIP",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatIP" "', argument " "1"" of type '" "faiss::IndexFlatIP *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatIP * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatIP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatIP, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlatL2",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatL2" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2 *)new faiss::IndexFlatL2(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlatL2")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2 *)new faiss::IndexFlatL2(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlatL2__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlatL2__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlatL2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlatL2::IndexFlatL2(faiss::Index::idx_t)\n" - " faiss::IndexFlatL2::IndexFlatL2()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatL2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2 *arg1 = (faiss::IndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatL2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatL2" "', argument " "1"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatL2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatL2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_shift_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlatL2BaseShift_shift_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_shift_set" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlatL2BaseShift_shift_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->shift = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_shift_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlatL2BaseShift_shift_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_shift_get" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - result = (std::vector< float > *)& ((arg1)->shift); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2BaseShift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - long val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexFlatL2BaseShift *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexFlatL2BaseShift",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatL2BaseShift" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexFlatL2BaseShift" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_IndexFlatL2BaseShift" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2BaseShift *)new faiss::IndexFlatL2BaseShift(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlatL2BaseShift_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_search" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlatL2BaseShift_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlatL2BaseShift_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlatL2BaseShift_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlatL2BaseShift_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlatL2BaseShift_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlatL2BaseShift const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatL2BaseShift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatL2BaseShift",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatL2BaseShift" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatL2BaseShift_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_refine_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_refine_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_refine_index_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexRefineFlat_refine_index_set" "', argument " "2"" of type '" "faiss::IndexFlat *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - if (arg1) (arg1)->refine_index = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_refine_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_refine_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_refine_index_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (faiss::IndexFlat *)& ((arg1)->refine_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_base_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_base_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_base_index_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexRefineFlat_base_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->base_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_base_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_base_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_base_index_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (faiss::Index *) ((arg1)->base_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_own_fields_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_own_fields_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_k_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_k_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_k_factor_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_k_factor_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->k_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_k_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_k_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_k_factor_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (float) ((arg1)->k_factor); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexRefineFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexRefineFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexRefineFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexRefineFlat *)new faiss::IndexRefineFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexRefineFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexRefineFlat *)new faiss::IndexRefineFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexRefineFlat__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexRefineFlat__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexRefineFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexRefineFlat::IndexRefineFlat(faiss::Index *)\n" - " faiss::IndexRefineFlat::IndexRefineFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexRefineFlat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_train" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexRefineFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_add" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_reset" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexRefineFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_search" "', argument " "1"" of type '" "faiss::IndexRefineFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexRefineFlat_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexRefineFlat_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexRefineFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexRefineFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexRefineFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexRefineFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexRefineFlat" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexRefineFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlat1D_continuous_update_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat1D_continuous_update_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_continuous_update_set" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_continuous_update_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->continuous_update = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_continuous_update_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_continuous_update_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_continuous_update_get" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - result = (bool) ((arg1)->continuous_update); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_perm_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - std::vector< faiss::Index::idx_t > *arg2 = (std::vector< faiss::Index::idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat1D_perm_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_perm_set" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat1D_perm_set" "', argument " "2"" of type '" "std::vector< faiss::Index::idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index::idx_t > * >(argp2); - if (arg1) (arg1)->perm = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_perm_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index::idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_perm_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_perm_get" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - result = (std::vector< faiss::Index::idx_t > *)& ((arg1)->perm); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool arg1 ; - bool val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat1D *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlat1D",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_bool(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat1D" "', argument " "1"" of type '" "bool""'"); - } - arg1 = static_cast< bool >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat1D *)new faiss::IndexFlat1D(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlat1D")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat1D *)new faiss::IndexFlat1D(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlat1D__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_bool(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat1D__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlat1D'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlat1D::IndexFlat1D(bool)\n" - " faiss::IndexFlat1D::IndexFlat1D()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_update_permutation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_update_permutation",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_update_permutation" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_permutation(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat1D_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_add" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat1D_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_reset" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat1D_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_search" "', argument " "1"" of type '" "faiss::IndexFlat1D const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat1D_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat1D_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat1D_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat1D_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat1D const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlat1D(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlat1D",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlat1D" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlat1D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlat1D, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexLSH_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_nbits_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_nbits_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_nbits_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (int) ((arg1)->nbits); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_bytes_per_vec_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_bytes_per_vec_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_bytes_per_vec_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_bytes_per_vec_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->bytes_per_vec = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_bytes_per_vec_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_bytes_per_vec_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_bytes_per_vec_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (int) ((arg1)->bytes_per_vec); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rotate_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_rotate_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rotate_data_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_rotate_data_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->rotate_data = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rotate_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_rotate_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rotate_data_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (bool) ((arg1)->rotate_data); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train_thresholds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_train_thresholds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train_thresholds_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_train_thresholds_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->train_thresholds = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train_thresholds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_train_thresholds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train_thresholds_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (bool) ((arg1)->train_thresholds); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rrot_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::RandomRotationMatrix *arg2 = (faiss::RandomRotationMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_rrot_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rrot_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_rrot_set" "', argument " "2"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg2 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp2); - if (arg1) (arg1)->rrot = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rrot_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_rrot_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rrot_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (faiss::RandomRotationMatrix *)& ((arg1)->rrot); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_thresholds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_thresholds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_thresholds_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_thresholds_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->thresholds = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_thresholds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_thresholds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_thresholds_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (std::vector< float > *)& ((arg1)->thresholds); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - std::vector< faiss::IndexLSH::uint8_t > *arg2 = (std::vector< faiss::IndexLSH::uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_codes_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_codes_set" "', argument " "2"" of type '" "std::vector< faiss::IndexLSH::uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::IndexLSH::uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::IndexLSH::uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_codes_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (std::vector< faiss::IndexLSH::uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - bool arg3 ; - bool arg4 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexLSH",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexLSH" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexLSH" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexLSH",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexLSH" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexLSH",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_apply_preprocess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_apply_preprocess",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_apply_preprocess" "', argument " "1"" of type '" "faiss::IndexLSH const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_apply_preprocess" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_apply_preprocess" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::IndexLSH const *)arg1)->apply_preprocess(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_add" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexLSH_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_search" "', argument " "1"" of type '" "faiss::IndexLSH const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexLSH_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexLSH_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexLSH_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexLSH const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_reset" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_transfer_thresholds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::LinearTransform *arg2 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_transfer_thresholds",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_transfer_thresholds" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_transfer_thresholds" "', argument " "2"" of type '" "faiss::LinearTransform *""'"); - } - arg2 = reinterpret_cast< faiss::LinearTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->transfer_thresholds(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexLSH(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexLSH",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexLSH" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexLSH")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexLSH__SWIG_3(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexLSH'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int,bool,bool)\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int,bool)\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int)\n" - " faiss::IndexLSH::IndexLSH()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexLSH_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexLSH, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_temperature_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_init_temperature_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_temperature_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_init_temperature_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->init_temperature = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_temperature_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_init_temperature_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_temperature_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (double) ((arg1)->init_temperature); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_temperature_decay_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_temperature_decay_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_temperature_decay_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_temperature_decay_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->temperature_decay = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_temperature_decay_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_temperature_decay_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_temperature_decay_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (double) ((arg1)->temperature_decay); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_iter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_n_iter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_iter_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_n_iter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_iter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_iter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_n_iter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_iter_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->n_iter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_redo_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_n_redo_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_redo_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_n_redo_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_redo = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_redo_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_n_redo_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_redo_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->n_redo); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_seed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_seed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_seed_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_seed_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->seed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_seed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_seed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_seed_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->seed); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_verbose_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_verbose_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_verbose_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->verbose); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_only_bit_flips_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_only_bit_flips_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_only_bit_flips_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_only_bit_flips_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->only_bit_flips = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_only_bit_flips_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_only_bit_flips_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_only_bit_flips_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (bool) ((arg1)->only_bit_flips); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_random_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_init_random_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_random_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_init_random_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->init_random = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_random_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_init_random_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_random_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (bool) ((arg1)->init_random); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SimulatedAnnealingParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_SimulatedAnnealingParameters")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SimulatedAnnealingParameters *)new faiss::SimulatedAnnealingParameters(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SimulatedAnnealingParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SimulatedAnnealingParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SimulatedAnnealingParameters" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SimulatedAnnealingParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PermutationObjective_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PermutationObjective_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_n_set" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PermutationObjective_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PermutationObjective_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_n_get" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_compute_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:PermutationObjective_compute_cost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_compute_cost" "', argument " "1"" of type '" "faiss::PermutationObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PermutationObjective_compute_cost" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::PermutationObjective const *)arg1)->compute_cost((int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_cost_update(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PermutationObjective_cost_update",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_cost_update" "', argument " "1"" of type '" "faiss::PermutationObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PermutationObjective_cost_update" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PermutationObjective_cost_update" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "PermutationObjective_cost_update" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::PermutationObjective const *)arg1)->cost_update((int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PermutationObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PermutationObjective",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PermutationObjective" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PermutationObjective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PermutationObjective, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_dis_weight_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight_factor_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_dis_weight_factor_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dis_weight_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_dis_weight_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight_factor_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (double) ((arg1)->dis_weight_factor); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double arg1 ; - double val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_sqr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_double(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ReproduceDistancesObjective_sqr" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::ReproduceDistancesObjective::sqr(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_dis_weight",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_dis_weight" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->dis_weight(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_source_dis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_source_dis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_source_dis_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_source_dis_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->source_dis = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_source_dis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_source_dis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_source_dis_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (std::vector< double > *)& ((arg1)->source_dis); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_target_dis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double *arg2 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_target_dis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_target_dis_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_target_dis_set" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - if (arg1) (arg1)->target_dis = (double const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_target_dis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_target_dis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_target_dis_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (double *) ((arg1)->target_dis); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_weights_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_weights_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_weights_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_weights_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->weights = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_weights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_weights_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_weights_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (std::vector< double > *)& ((arg1)->weights); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_get_source_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReproduceDistancesObjective_get_source_dis",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->get_source_dis(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_compute_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_compute_cost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_compute_cost" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_compute_cost" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->compute_cost((int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_cost_update(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReproduceDistancesObjective_cost_update",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->cost_update((int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReproduceDistancesObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - double *arg2 = (double *) 0 ; - double *arg3 = (double *) 0 ; - double arg4 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::ReproduceDistancesObjective *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_ReproduceDistancesObjective",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ReproduceDistancesObjective" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ReproduceDistancesObjective" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ReproduceDistancesObjective" "', argument " "3"" of type '" "double const *""'"); - } - arg3 = reinterpret_cast< double * >(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ReproduceDistancesObjective" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReproduceDistancesObjective *)new faiss::ReproduceDistancesObjective(arg1,(double const *)arg2,(double const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_compute_mean_stdev(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double *arg1 = (double *) 0 ; - size_t arg2 ; - double *arg3 = (double *) 0 ; - double *arg4 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReproduceDistancesObjective_compute_mean_stdev",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "1"" of type '" "double const *""'"); - } - arg1 = reinterpret_cast< double * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "3"" of type '" "double *""'"); - } - arg3 = reinterpret_cast< double * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "4"" of type '" "double *""'"); - } - arg4 = reinterpret_cast< double * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ReproduceDistancesObjective::compute_mean_stdev((double const *)arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_set_affine_target_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double *arg2 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_set_affine_target_dis",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_set_affine_target_dis" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_set_affine_target_dis" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_affine_target_dis((double const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ReproduceDistancesObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ReproduceDistancesObjective",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReproduceDistancesObjective" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ReproduceDistancesObjective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_obj_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - faiss::PermutationObjective *arg2 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_obj_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_obj_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PermutationObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_obj_set" "', argument " "2"" of type '" "faiss::PermutationObjective *""'"); - } - arg2 = reinterpret_cast< faiss::PermutationObjective * >(argp2); - if (arg1) (arg1)->obj = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PermutationObjective *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_obj_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_obj_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (faiss::PermutationObjective *) ((arg1)->obj); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_n_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingOptimizer_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_n_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_logfile_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_logfile_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_logfile_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_logfile_set" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - if (arg1) (arg1)->logfile = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_logfile_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - FILE *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_logfile_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_logfile_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (FILE *) ((arg1)->logfile); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FILE, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SimulatedAnnealingOptimizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - faiss::SimulatedAnnealingParameters *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::SimulatedAnnealingOptimizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_SimulatedAnnealingOptimizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "2"" of type '" "faiss::SimulatedAnnealingParameters const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "2"" of type '" "faiss::SimulatedAnnealingParameters const &""'"); - } - arg2 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SimulatedAnnealingOptimizer *)new faiss::SimulatedAnnealingOptimizer(arg1,(faiss::SimulatedAnnealingParameters const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_rnd_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - faiss::RandomGenerator *arg2 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_rnd_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_rnd_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_rnd_set" "', argument " "2"" of type '" "faiss::RandomGenerator *""'"); - } - arg2 = reinterpret_cast< faiss::RandomGenerator * >(argp2); - if (arg1) (arg1)->rnd = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_rnd_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_rnd_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_rnd_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (faiss::RandomGenerator *) ((arg1)->rnd); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_init_cost_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_init_cost_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_init_cost_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingOptimizer_init_cost_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->init_cost = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_init_cost_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_init_cost_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_init_cost_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (double) ((arg1)->init_cost); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_optimize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_optimize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_optimize" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_optimize" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->optimize(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_run_optimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_run_optimization",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_run_optimization" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_run_optimization" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->run_optimization(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SimulatedAnnealingOptimizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SimulatedAnnealingOptimizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SimulatedAnnealingOptimizer" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SimulatedAnnealingOptimizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimization_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::PolysemousTraining::Optimization_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_optimization_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimization_type_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_optimization_type_set" "', argument " "2"" of type '" "faiss::PolysemousTraining::Optimization_type_t""'"); - } - arg2 = static_cast< faiss::PolysemousTraining::Optimization_type_t >(val2); - if (arg1) (arg1)->optimization_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimization_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining::Optimization_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_optimization_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimization_type_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (faiss::PolysemousTraining::Optimization_type_t) ((arg1)->optimization_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_ntrain_permutation_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_ntrain_permutation_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_ntrain_permutation_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_ntrain_permutation_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->ntrain_permutation = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_ntrain_permutation_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_ntrain_permutation_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_ntrain_permutation_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (int) ((arg1)->ntrain_permutation); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_dis_weight_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_dis_weight_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_dis_weight_factor_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_dis_weight_factor_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dis_weight_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_dis_weight_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_dis_weight_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_dis_weight_factor_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (double) ((arg1)->dis_weight_factor); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_log_pattern_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_log_pattern_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_log_pattern_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_log_pattern_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_log_pattern_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->log_pattern = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_log_pattern_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_log_pattern_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_log_pattern_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (std::string *) & ((arg1)->log_pattern); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PolysemousTraining(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_PolysemousTraining")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PolysemousTraining *)new faiss::PolysemousTraining(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_pq_for_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PolysemousTraining_optimize_pq_for_hamming",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_pq_for_hamming(*arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_ranking(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PolysemousTraining_optimize_ranking",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_ranking" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_ranking(*arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_reproduce_distances(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_optimize_reproduce_distances",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_reproduce_distances(*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PolysemousTraining(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PolysemousTraining",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PolysemousTraining" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PolysemousTraining_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PolysemousTraining, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPQ_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_pq_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_pq_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_codes_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_codes_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexPQ",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexPQ" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexPQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexPQ__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexPQ__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexPQ__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexPQ::IndexPQ(int,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexPQ::IndexPQ(int,size_t,size_t)\n" - " faiss::IndexPQ::IndexPQ()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_train" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_add" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reset" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPQ_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexPQ_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPQ_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reconstruct" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_remove_ids" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexPQ_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_do_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_do_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_do_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_do_polysemous_training_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->do_polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_do_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_do_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_do_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (bool) ((arg1)->do_polysemous_training); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::PolysemousTraining *arg2 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_polysemous_training_set" "', argument " "2"" of type '" "faiss::PolysemousTraining *""'"); - } - arg2 = reinterpret_cast< faiss::PolysemousTraining * >(argp2); - if (arg1) (arg1)->polysemous_training = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::PolysemousTraining *)& ((arg1)->polysemous_training); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::IndexPQ::Search_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_search_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_type_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search_type_set" "', argument " "2"" of type '" "faiss::IndexPQ::Search_type_t""'"); - } - arg2 = static_cast< faiss::IndexPQ::Search_type_t >(val2); - if (arg1) (arg1)->search_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexPQ::Search_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_search_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_type_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::IndexPQ::Search_type_t) ((arg1)->search_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_encode_signs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_encode_signs_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_encode_signs_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_encode_signs_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->encode_signs = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_encode_signs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_encode_signs_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_encode_signs_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (bool) ((arg1)->encode_signs); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_core_polysemous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_search_core_polysemous",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_core_polysemous" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search_core_polysemous" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_search_core_polysemous" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_search_core_polysemous" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_search_core_polysemous" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_search_core_polysemous" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->search_core_polysemous(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_hamming_distance_histogram(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - long *arg6 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_hamming_distance_histogram",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "6"" of type '" "long *""'"); - } - arg6 = reinterpret_cast< long * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->hamming_distance_histogram(arg2,(float const *)arg3,arg4,(float const *)arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_hamming_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - int32_t *arg4 = (int32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPQ_hamming_distance_table",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_hamming_distance_table" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_hamming_distance_table" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_hamming_distance_table" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPQ_hamming_distance_table" "', argument " "4"" of type '" "int32_t *""'"); - } - arg4 = reinterpret_cast< int32_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->hamming_distance_table(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPQ" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPQStats_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_nq_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_nq_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_ncode_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_ncode_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_ncode_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_ncode_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ncode = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_ncode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_ncode_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_ncode_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->ncode); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_n_hamming_pass_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_n_hamming_pass_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_n_hamming_pass_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_n_hamming_pass_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_hamming_pass = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_n_hamming_pass_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_n_hamming_pass_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_n_hamming_pass_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->n_hamming_pass); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPQStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQStats *)new faiss::IndexPQStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_reset" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPQStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPQStats" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPQStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPQStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexPQ_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexPQStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexPQ_stats""' of type '""faiss::IndexPQStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexPQ_stats""' of type '""faiss::IndexPQStats""'"); - } else { - faiss::IndexPQStats * temp; - temp = reinterpret_cast< faiss::IndexPQStats * >(argp); - faiss::indexPQ_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexPQ_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexPQ_stats), SWIGTYPE_p_faiss__IndexPQStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_pq_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiIndexQuantizer_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_pq_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::MultiIndexQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_MultiIndexQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_MultiIndexQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer *)new faiss::MultiIndexQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_train" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MultiIndexQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_search" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MultiIndexQuantizer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MultiIndexQuantizer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "MultiIndexQuantizer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_add" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_reset" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_MultiIndexQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer *)new faiss::MultiIndexQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_MultiIndexQuantizer__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_MultiIndexQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_MultiIndexQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::MultiIndexQuantizer::MultiIndexQuantizer(int,size_t,size_t)\n" - " faiss::MultiIndexQuantizer::MultiIndexQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MultiIndexQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MultiIndexQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiIndexQuantizer" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MultiIndexQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_assign_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer2_assign_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_assign_indexes_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiIndexQuantizer2_assign_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->assign_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_assign_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer2_assign_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_assign_indexes_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->assign_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer2_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_own_fields_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer2_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_own_fields_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - faiss::Index **arg4 = (faiss::Index **) 0 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::MultiIndexQuantizer2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_MultiIndexQuantizer2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer2" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_MultiIndexQuantizer2" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_MultiIndexQuantizer2" "', argument " "4"" of type '" "faiss::Index **""'"); - } - arg4 = reinterpret_cast< faiss::Index ** >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer2 *)new faiss::MultiIndexQuantizer2(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - faiss::Index *arg4 = (faiss::Index *) 0 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::MultiIndexQuantizer2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_MultiIndexQuantizer2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer2" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_MultiIndexQuantizer2" "', argument " "3"" of type '" "faiss::Index *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_MultiIndexQuantizer2" "', argument " "4"" of type '" "faiss::Index *""'"); - } - arg4 = reinterpret_cast< faiss::Index * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer2 *)new faiss::MultiIndexQuantizer2(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_MultiIndexQuantizer2__SWIG_1(self, args); - } - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_MultiIndexQuantizer2__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_MultiIndexQuantizer2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::MultiIndexQuantizer2::MultiIndexQuantizer2(int,size_t,size_t,faiss::Index **)\n" - " faiss::MultiIndexQuantizer2::MultiIndexQuantizer2(int,size_t,faiss::Index *,faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer2_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_train" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer2_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MultiIndexQuantizer2_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_search" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer2_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MultiIndexQuantizer2_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MultiIndexQuantizer2_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "MultiIndexQuantizer2_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer2 const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MultiIndexQuantizer2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MultiIndexQuantizer2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiIndexQuantizer2" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MultiIndexQuantizer2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_InvertedLists_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_nlist_set" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_nlist_get" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_code_size_set" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_code_size_get" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_list_size" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::InvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_codes" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::InvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_ids" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::InvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_release_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_release_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_release_codes" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_release_codes" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->release_codes((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_release_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::InvertedLists::idx_t *arg2 = (faiss::InvertedLists::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_release_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_release_ids" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_release_ids" "', argument " "2"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->release_ids((faiss::InvertedLists::idx_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_single_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::InvertedLists::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_get_single_id",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_single_id" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_single_id" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_get_single_id" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t)((faiss::InvertedLists const *)arg1)->get_single_id(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_single_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_get_single_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_single_code" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_single_code" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_get_single_code" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::InvertedLists const *)arg1)->get_single_code(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_prefetch_lists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - long *arg2 = (long *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_prefetch_lists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_prefetch_lists" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_prefetch_lists" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_prefetch_lists" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->prefetch_lists((long const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_add_entry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - faiss::InvertedLists::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:InvertedLists_add_entry",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_add_entry" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_add_entry" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_add_entry" "', argument " "3"" of type '" "faiss::InvertedLists::idx_t""'"); - } - arg3 = static_cast< faiss::InvertedLists::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "InvertedLists_add_entry" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entry(arg2,arg3,(uint8_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:InvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_add_entries" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "InvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_update_entry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t arg4 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:InvertedLists_update_entry",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_update_entry" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_update_entry" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_update_entry" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "InvertedLists_update_entry" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t""'"); - } - arg4 = static_cast< faiss::InvertedLists::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_update_entry" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entry(arg2,arg3,arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:InvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_update_entries" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "InvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "InvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_resize" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_reset" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_merge_from" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_merge_from" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_merge_from" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InvertedLists" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_imbalance_factor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_imbalance_factor",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_imbalance_factor" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::InvertedLists const *)arg1)->imbalance_factor(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_print_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_print_stats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_print_stats" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->print_stats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__InvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - std::vector< std::vector< uint8_t > > *arg2 = (std::vector< std::vector< uint8_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_codes_set" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ArrayInvertedLists_codes_set" "', argument " "2"" of type '" "std::vector< std::vector< uint8_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< uint8_t > > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< uint8_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ArrayInvertedLists_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_codes_get" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - result = (std::vector< std::vector< uint8_t > > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - std::vector< std::vector< faiss::InvertedLists::idx_t > > *arg2 = (std::vector< std::vector< faiss::InvertedLists::idx_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_ids_set" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ArrayInvertedLists_ids_set" "', argument " "2"" of type '" "std::vector< std::vector< faiss::InvertedLists::idx_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< faiss::InvertedLists::idx_t > > * >(argp2); - if (arg1) (arg1)->ids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< faiss::InvertedLists::idx_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ArrayInvertedLists_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_ids_get" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - result = (std::vector< std::vector< faiss::InvertedLists::idx_t > > *)& ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ArrayInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ArrayInvertedLists",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ArrayInvertedLists" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ArrayInvertedLists" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ArrayInvertedLists *)new faiss::ArrayInvertedLists(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_list_size" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ArrayInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ArrayInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::ArrayInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ArrayInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ArrayInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ArrayInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ArrayInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ArrayInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ArrayInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ArrayInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ArrayInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_resize" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ArrayInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ArrayInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ArrayInvertedLists" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ArrayInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_ils_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - std::vector< faiss::InvertedLists const * > *arg2 = (std::vector< faiss::InvertedLists const * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_ils_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_ils_set" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_ils_set" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists const * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::InvertedLists const * > * >(argp2); - if (arg1) (arg1)->ils = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_ils_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::InvertedLists const * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ConcatenatedInvertedLists_ils_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_ils_get" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - result = (std::vector< faiss::InvertedLists const * > *)& ((arg1)->ils); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ConcatenatedInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::InvertedLists **arg2 = (faiss::InvertedLists **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ConcatenatedInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ConcatenatedInvertedLists",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ConcatenatedInvertedLists" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ConcatenatedInvertedLists" "', argument " "2"" of type '" "faiss::InvertedLists const **""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists ** >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ConcatenatedInvertedLists *)new faiss::ConcatenatedInvertedLists(arg1,(faiss::InvertedLists const **)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_list_size" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ConcatenatedInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_release_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_release_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_release_codes" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_release_codes" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ConcatenatedInvertedLists const *)arg1)->release_codes((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_release_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - faiss::InvertedLists::idx_t *arg2 = (faiss::InvertedLists::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_release_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_release_ids" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_release_ids" "', argument " "2"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ConcatenatedInvertedLists const *)arg1)->release_ids((faiss::InvertedLists::idx_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_single_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::InvertedLists::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_get_single_id",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t)((faiss::ConcatenatedInvertedLists const *)arg1)->get_single_id(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_single_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_get_single_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_single_code(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ConcatenatedInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ConcatenatedInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ConcatenatedInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ConcatenatedInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ConcatenatedInvertedLists" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ConcatenatedInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_quantizer_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_quantizer_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->quantizer = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_quantizer_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::Index *) ((arg1)->quantizer); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_nlist_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_nlist_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_trains_alone_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_quantizer_trains_alone_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_trains_alone_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_quantizer_trains_alone_set" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - if (arg1) (arg1)->quantizer_trains_alone = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_trains_alone_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_quantizer_trains_alone_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_trains_alone_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (char) ((arg1)->quantizer_trains_alone); - resultobj = SWIG_From_char(static_cast< char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_own_fields_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_own_fields_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_cp_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_cp_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_clustering_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_clustering_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_clustering_index_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_clustering_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->clustering_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_clustering_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_clustering_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_clustering_index_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::Index *) ((arg1)->clustering_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_train_q1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - bool arg4 ; - faiss::MetricType arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Level1Quantizer_train_q1",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_train_q1" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_train_q1" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Level1Quantizer_train_q1" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Level1Quantizer_train_q1" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Level1Quantizer_train_q1" "', argument " "5"" of type '" "faiss::MetricType""'"); - } - arg5 = static_cast< faiss::MetricType >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_q1(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Level1Quantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Level1Quantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Level1Quantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Level1Quantizer *)new faiss::Level1Quantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Level1Quantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Level1Quantizer *)new faiss::Level1Quantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Level1Quantizer__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Level1Quantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Level1Quantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Level1Quantizer::Level1Quantizer(faiss::Index *,size_t)\n" - " faiss::Level1Quantizer::Level1Quantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Level1Quantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Level1Quantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Level1Quantizer" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Level1Quantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Level1Quantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFSearchParameters_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_nprobe_set" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFSearchParameters_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFSearchParameters_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_nprobe_get" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFSearchParameters_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_max_codes_set" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFSearchParameters_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFSearchParameters_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_max_codes_get" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IVFSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IVFSearchParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVFSearchParameters" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IVFSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IVFSearchParameters")) SWIG_fail; - result = (faiss::IVFSearchParameters *)new faiss::IVFSearchParameters(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IVFSearchParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVF_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_invlists_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_invlists_set" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - if (arg1) (arg1)->invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_invlists_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (faiss::InvertedLists *) ((arg1)->invlists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_own_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_own_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_own_invlists_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_own_invlists_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_own_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_own_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_own_invlists_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (bool) ((arg1)->own_invlists); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_code_size_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_code_size_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_nprobe_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_nprobe_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_max_codes_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_max_codes_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_maintain_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_maintain_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_maintain_direct_map_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_maintain_direct_map_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->maintain_direct_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_maintain_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_maintain_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_maintain_direct_map_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (bool) ((arg1)->maintain_direct_map); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_direct_map_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_direct_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->direct_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_direct_map_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (std::vector< long > *)& ((arg1)->direct_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reset" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_train" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_add" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_train_residual" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVF_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVF_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVF_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVF::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVF_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_range_search" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVF const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_get_InvertedListScanner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVF const *)arg1)->get_InvertedListScanner(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_get_InvertedListScanner__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_get_InvertedListScanner__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_get_InvertedListScanner'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::get_InvertedListScanner(bool) const\n" - " faiss::IndexIVF::get_InvertedListScanner() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVF_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexIVF_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVF_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_check_compatible_for_merge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_check_compatible_for_merge",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "2"" of type '" "faiss::IndexIVF const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "2"" of type '" "faiss::IndexIVF const &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->check_compatible_for_merge((faiss::IndexIVF const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - faiss::Index::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_merge_from" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_merge_from" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_copy_subset_to(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - int arg3 ; - long arg4 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - long val4 ; - int ecode4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_copy_subset_to",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_copy_subset_to" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_copy_subset_to" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_copy_subset_to" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_copy_subset_to" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_copy_subset_to" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IndexIVF_copy_subset_to" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->copy_subset_to(*arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVF",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVF" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_get_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_list_size" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_get_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexIVF const *)arg1)->get_list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_make_direct_map",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_make_direct_map" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_make_direct_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_make_direct_map__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_make_direct_map__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_make_direct_map'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::make_direct_map(bool)\n" - " faiss::IndexIVF::make_direct_map()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_replace_invlists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_replace_invlists" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_replace_invlists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_replace_invlists__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_replace_invlists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_replace_invlists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::replace_invlists(faiss::InvertedLists *,bool)\n" - " faiss::IndexIVF::replace_invlists(faiss::InvertedLists *)\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIVF_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVF, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nq_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nq_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nlist_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nlist_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_ndis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_ndis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_ndis_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_ndis_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ndis = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_ndis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_ndis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_ndis_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->ndis); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nheap_updates_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nheap_updates_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nheap_updates_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nheap_updates_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nheap_updates = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nheap_updates_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nheap_updates_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nheap_updates_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nheap_updates); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_quantization_time_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_quantization_time_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_quantization_time_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_quantization_time_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->quantization_time = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_quantization_time_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_quantization_time_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_quantization_time_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (double) ((arg1)->quantization_time); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_search_time_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_search_time_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_search_time_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_search_time_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->search_time = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_search_time_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_search_time_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_search_time_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (double) ((arg1)->search_time); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFStats *)new faiss::IndexIVFStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_reset" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFStats" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexIVF_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexIVF_stats""' of type '""faiss::IndexIVFStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexIVF_stats""' of type '""faiss::IndexIVFStats""'"); - } else { - faiss::IndexIVFStats * temp; - temp = reinterpret_cast< faiss::IndexIVFStats * >(argp); - faiss::indexIVF_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexIVF_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexIVF_stats), SWIGTYPE_p_faiss__IndexIVFStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_check_compatible_for_merge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:check_compatible_for_merge",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "check_compatible_for_merge" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "check_compatible_for_merge" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::check_compatible_for_merge((faiss::Index const *)arg1,(faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:extract_index_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "extract_index_ivf" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)faiss::ivflib::extract_index_ivf((faiss::Index const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:extract_index_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "extract_index_ivf" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)faiss::ivflib::extract_index_ivf(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_extract_index_ivf__SWIG_0(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_extract_index_ivf__SWIG_1(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'extract_index_ivf'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ivflib::extract_index_ivf(faiss::Index const *)\n" - " faiss::ivflib::extract_index_ivf(faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_merge_into(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:merge_into",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "merge_into" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "merge_into" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "merge_into" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::merge_into(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_centroid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - float *arg2 = (float *) 0 ; - int arg3 ; - faiss::ivflib::idx_t *arg4 = (faiss::ivflib::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:search_centroid",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_centroid" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "search_centroid" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "search_centroid" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "search_centroid" "', argument " "4"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::ivflib::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_centroid(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_and_return_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - faiss::ivflib::idx_t *arg6 = (faiss::ivflib::idx_t *) 0 ; - faiss::ivflib::idx_t *arg7 = (faiss::ivflib::idx_t *) 0 ; - faiss::ivflib::idx_t *arg8 = (faiss::ivflib::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:search_and_return_centroids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_and_return_centroids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "search_and_return_centroids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "search_and_return_centroids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "search_and_return_centroids" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "search_and_return_centroids" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "search_and_return_centroids" "', argument " "6"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::ivflib::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "search_and_return_centroids" "', argument " "7"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg7 = reinterpret_cast< faiss::ivflib::idx_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "search_and_return_centroids" "', argument " "8"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::ivflib::idx_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_and_return_centroids(arg1,arg2,(float const *)arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_index_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_index_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_ils_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::ArrayInvertedLists *arg2 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_ils_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_ils_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_ils_set" "', argument " "2"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp2); - if (arg1) (arg1)->ils = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_ils_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_ils_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_ils_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (faiss::ArrayInvertedLists *) ((arg1)->ils); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_n_slice_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_n_slice_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_n_slice_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlidingIndexWindow_n_slice_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_slice = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_n_slice_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_n_slice_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_n_slice_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (int) ((arg1)->n_slice); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_nlist_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlidingIndexWindow_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_nlist_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_sizes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - std::vector< std::vector< size_t > > *arg2 = (std::vector< std::vector< size_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_sizes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_sizes_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_sizes_set" "', argument " "2"" of type '" "std::vector< std::vector< size_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< size_t > > * >(argp2); - if (arg1) (arg1)->sizes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_sizes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< size_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_sizes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_sizes_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (std::vector< std::vector< size_t > > *)& ((arg1)->sizes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SlidingIndexWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ivflib::SlidingIndexWindow *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_SlidingIndexWindow",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SlidingIndexWindow" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ivflib::SlidingIndexWindow *)new faiss::ivflib::SlidingIndexWindow(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:SlidingIndexWindow_step",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_step" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_step" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SlidingIndexWindow_step" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->step((faiss::Index const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SlidingIndexWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SlidingIndexWindow",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SlidingIndexWindow" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SlidingIndexWindow_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_get_invlist_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - long arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:get_invlist_range",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_invlist_range" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_invlist_range" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "get_invlist_range" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ArrayInvertedLists *)faiss::ivflib::get_invlist_range((faiss::Index const *)arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_set_invlist_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - long arg2 ; - long arg3 ; - faiss::ArrayInvertedLists *arg4 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:set_invlist_range",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_invlist_range" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "set_invlist_range" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "set_invlist_range" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "set_invlist_range" "', argument " "4"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg4 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::set_invlist_range(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_with_parameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::ivflib::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::ivflib::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::ivflib::idx_t *arg6 = (faiss::ivflib::idx_t *) 0 ; - faiss::IVFSearchParameters *arg7 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:search_with_parameters",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_with_parameters" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "search_with_parameters" "', argument " "2"" of type '" "faiss::ivflib::idx_t""'"); - } - arg2 = static_cast< faiss::ivflib::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "search_with_parameters" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "search_with_parameters" "', argument " "4"" of type '" "faiss::ivflib::idx_t""'"); - } - arg4 = static_cast< faiss::ivflib::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "search_with_parameters" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "search_with_parameters" "', argument " "6"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::ivflib::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "search_with_parameters" "', argument " "7"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg7 = reinterpret_cast< faiss::IVFSearchParameters * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_with_parameters((faiss::Index const *)arg1,arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_qtype_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_qtype_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_qtype_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_qtype_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - if (arg1) (arg1)->qtype = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_qtype_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer::QuantizerType result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_qtype_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_qtype_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer::QuantizerType) ((arg1)->qtype); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::ScalarQuantizer::RangeStat arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_rangestat_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_rangestat_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer::RangeStat""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::RangeStat >(val2); - if (arg1) (arg1)->rangestat = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer::RangeStat result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_rangestat_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer::RangeStat) ((arg1)->rangestat); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_arg_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_rangestat_arg_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_arg_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_rangestat_arg_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->rangestat_arg = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_arg_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_rangestat_arg_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_arg_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (float) ((arg1)->rangestat_arg); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_d_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_d_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_trained_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_trained_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->trained = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_trained_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->trained); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - size_t val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ScalarQuantizer",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ScalarQuantizer" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ScalarQuantizer *)new faiss::ScalarQuantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ScalarQuantizer *)new faiss::ScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_ScalarQuantizer__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ScalarQuantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ScalarQuantizer::ScalarQuantizer(size_t,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::ScalarQuantizer::ScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ScalarQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_train" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_train" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_compute_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ScalarQuantizer_compute_codes",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_compute_codes" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_compute_codes" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_compute_codes" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ScalarQuantizer_compute_codes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ScalarQuantizer const *)arg1)->compute_codes((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_decode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ScalarQuantizer_decode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_decode" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ScalarQuantizer_decode" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ScalarQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::SQDistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_get_distance_computer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SQDistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SQDistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::SQDistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SQDistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SQDistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ScalarQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ScalarQuantizer_get_distance_computer__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ScalarQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ScalarQuantizer_get_distance_computer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ScalarQuantizer_get_distance_computer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ScalarQuantizer::get_distance_computer(faiss::MetricType) const\n" - " faiss::ScalarQuantizer::get_distance_computer() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_ScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ScalarQuantizer" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_sq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::ScalarQuantizer *arg2 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_sq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_sq_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexScalarQuantizer_sq_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ScalarQuantizer * >(argp2); - if (arg1) (arg1)->sq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_sq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_sq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_sq_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer *)& ((arg1)->sq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_codes_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexScalarQuantizer_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_codes_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - faiss::MetricType arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexScalarQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexScalarQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexScalarQuantizer" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexScalarQuantizer",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexScalarQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexScalarQuantizer__SWIG_2(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexScalarQuantizer__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexScalarQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer(int,faiss::ScalarQuantizer::QuantizerType,faiss::MetricType)\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer(int,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_train" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_add" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexScalarQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_search" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexScalarQuantizer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexScalarQuantizer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexScalarQuantizer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reset" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexScalarQuantizer_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexScalarQuantizer const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexScalarQuantizer" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_sq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::ScalarQuantizer *arg2 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_sq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_sq_set" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFScalarQuantizer_sq_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ScalarQuantizer * >(argp2); - if (arg1) (arg1)->sq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_sq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFScalarQuantizer_sq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_sq_get" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer *)& ((arg1)->sq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_by_residual_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_by_residual_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_by_residual_set" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_by_residual_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->by_residual = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_by_residual_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFScalarQuantizer_by_residual_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_by_residual_get" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - result = (bool) ((arg1)->by_residual); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::ScalarQuantizer::QuantizerType arg4 ; - faiss::MetricType arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_IndexIVFScalarQuantizer",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "4"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg4 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "5"" of type '" "faiss::MetricType""'"); - } - arg5 = static_cast< faiss::MetricType >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::ScalarQuantizer::QuantizerType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFScalarQuantizer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "4"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg4 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_2(self, args); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer(faiss::Index *,size_t,size_t,faiss::ScalarQuantizer::QuantizerType,faiss::MetricType)\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer(faiss::Index *,size_t,size_t,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFScalarQuantizer_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFScalarQuantizer_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFScalarQuantizer const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFScalarQuantizer_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFScalarQuantizer const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFScalarQuantizer_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFScalarQuantizer const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HNSW_assign_probas_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_assign_probas_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_assign_probas_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_assign_probas_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->assign_probas = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_assign_probas_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_assign_probas_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_assign_probas_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< double > *)& ((arg1)->assign_probas); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nneighbor_per_level_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_cum_nneighbor_per_level_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nneighbor_per_level_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_cum_nneighbor_per_level_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->cum_nneighbor_per_level = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nneighbor_per_level_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_cum_nneighbor_per_level_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nneighbor_per_level_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< int > *)& ((arg1)->cum_nneighbor_per_level); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_levels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_levels_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_levels_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_levels_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->levels = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_levels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_levels_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_levels_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< int > *)& ((arg1)->levels); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_offsets_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< size_t > *arg2 = (std::vector< size_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_offsets_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_offsets_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_offsets_set" "', argument " "2"" of type '" "std::vector< size_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< size_t > * >(argp2); - if (arg1) (arg1)->offsets = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_offsets_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< size_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_offsets_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_offsets_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< size_t > *)& ((arg1)->offsets); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< faiss::HNSW::storage_idx_t > *arg2 = (std::vector< faiss::HNSW::storage_idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_neighbors_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbors_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_neighbors_set" "', argument " "2"" of type '" "std::vector< faiss::HNSW::storage_idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::HNSW::storage_idx_t > * >(argp2); - if (arg1) (arg1)->neighbors = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::HNSW::storage_idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_neighbors_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbors_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< faiss::HNSW::storage_idx_t > *)& ((arg1)->neighbors); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_entry_point_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::storage_idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_entry_point_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_entry_point_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_entry_point_set" "', argument " "2"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg2 = static_cast< faiss::HNSW::storage_idx_t >(val2); - if (arg1) (arg1)->entry_point = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_entry_point_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW::storage_idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_entry_point_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_entry_point_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (faiss::HNSW::storage_idx_t) ((arg1)->entry_point); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_rng_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::RandomGenerator *arg2 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_rng_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_rng_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_rng_set" "', argument " "2"" of type '" "faiss::RandomGenerator *""'"); - } - arg2 = reinterpret_cast< faiss::RandomGenerator * >(argp2); - if (arg1) (arg1)->rng = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_rng_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_rng_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_rng_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (faiss::RandomGenerator *)& ((arg1)->rng); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_max_level_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_max_level_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_max_level_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_max_level_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->max_level = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_max_level_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_max_level_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_max_level_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->max_level); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efConstruction_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_efConstruction_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efConstruction_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_efConstruction_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->efConstruction = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efConstruction_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_efConstruction_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efConstruction_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->efConstruction); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efSearch_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_efSearch_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efSearch_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_efSearch_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->efSearch = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efSearch_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_efSearch_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efSearch_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->efSearch); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_check_relative_distance_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_check_relative_distance_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_check_relative_distance_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_check_relative_distance_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->check_relative_distance = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_check_relative_distance_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_check_relative_distance_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_check_relative_distance_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (bool) ((arg1)->check_relative_distance); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_upper_beam_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_upper_beam_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_upper_beam_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_upper_beam_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->upper_beam = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_upper_beam_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_upper_beam_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_upper_beam_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->upper_beam); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_bounded_queue_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_search_bounded_queue_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_bounded_queue_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_search_bounded_queue_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->search_bounded_queue = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_bounded_queue_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_search_bounded_queue_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_bounded_queue_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (bool) ((arg1)->search_bounded_queue); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_set_default_probas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_set_default_probas",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_set_default_probas" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_set_default_probas" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_set_default_probas" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_default_probas(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_set_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_set_nb_neighbors",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_set_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_set_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_set_nb_neighbors" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_nb_neighbors(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_nb_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->nb_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_cum_nb_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_cum_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->cum_nb_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbor_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::idx_t arg2 ; - int arg3 ; - size_t *arg4 = (size_t *) 0 ; - size_t *arg5 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:HNSW_neighbor_range",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbor_range" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_neighbor_range" "', argument " "2"" of type '" "faiss::HNSW::idx_t""'"); - } - arg2 = static_cast< faiss::HNSW::idx_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_neighbor_range" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_neighbor_range" "', argument " "4"" of type '" "size_t *""'"); - } - arg4 = reinterpret_cast< size_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_neighbor_range" "', argument " "5"" of type '" "size_t *""'"); - } - arg5 = reinterpret_cast< size_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->neighbor_range(arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_HNSW",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSW *)new faiss::HNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HNSW")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSW *)new faiss::HNSW(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HNSW__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HNSW__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HNSW'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::HNSW(int)\n" - " faiss::HNSW::HNSW()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_random_level(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_random_level",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_random_level" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->random_level(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_fill_with_random_links(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_fill_with_random_links",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_fill_with_random_links" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_fill_with_random_links" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->fill_with_random_links(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_add_links_starting_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - faiss::HNSW::storage_idx_t arg3 ; - faiss::HNSW::storage_idx_t arg4 ; - float arg5 ; - int arg6 ; - omp_lock_t *arg7 = (omp_lock_t *) 0 ; - faiss::VisitedTable *arg8 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - float val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:HNSW_add_links_starting_from",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_add_links_starting_from" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_add_links_starting_from" "', argument " "3"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg3 = static_cast< faiss::HNSW::storage_idx_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_add_links_starting_from" "', argument " "4"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg4 = static_cast< faiss::HNSW::storage_idx_t >(val4); - ecode5 = SWIG_AsVal_float(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "HNSW_add_links_starting_from" "', argument " "5"" of type '" "float""'"); - } - arg5 = static_cast< float >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "HNSW_add_links_starting_from" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_omp_lock_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_add_links_starting_from" "', argument " "7"" of type '" "omp_lock_t *""'"); - } - arg7 = reinterpret_cast< omp_lock_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "HNSW_add_links_starting_from" "', argument " "8"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp8) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_links_starting_from" "', argument " "8"" of type '" "faiss::VisitedTable &""'"); - } - arg8 = reinterpret_cast< faiss::VisitedTable * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_links_starting_from(*arg2,arg3,arg4,arg5,arg6,arg7,*arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_add_with_locks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - int arg4 ; - std::vector< omp_lock_t > *arg5 = 0 ; - faiss::VisitedTable *arg6 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:HNSW_add_with_locks",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_add_with_locks" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_add_with_locks" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_add_with_locks" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_std__vectorT_omp_lock_t_t, 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_add_with_locks" "', argument " "5"" of type '" "std::vector< omp_lock_t > &""'"); - } - if (!argp5) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "5"" of type '" "std::vector< omp_lock_t > &""'"); - } - arg5 = reinterpret_cast< std::vector< omp_lock_t > * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_add_with_locks" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - arg6 = reinterpret_cast< faiss::VisitedTable * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_locks(*arg2,arg3,arg4,*arg5,*arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::HNSW::MinimaxHeap *arg6 = 0 ; - faiss::VisitedTable *arg7 = 0 ; - int arg8 ; - int arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - int val8 ; - int ecode8 = 0 ; - int val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:HNSW_search_from_candidates",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidates" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search_from_candidates" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search_from_candidates" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidates" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - arg6 = reinterpret_cast< faiss::HNSW::MinimaxHeap * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp7) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - arg7 = reinterpret_cast< faiss::VisitedTable * >(argp7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "HNSW_search_from_candidates" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "HNSW_search_from_candidates" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->search_from_candidates(*arg2,arg3,arg4,arg5,*arg6,*arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::HNSW::MinimaxHeap *arg6 = 0 ; - faiss::VisitedTable *arg7 = 0 ; - int arg8 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - int val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:HNSW_search_from_candidates",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidates" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search_from_candidates" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search_from_candidates" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidates" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - arg6 = reinterpret_cast< faiss::HNSW::MinimaxHeap * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp7) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - arg7 = reinterpret_cast< faiss::VisitedTable * >(argp7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "HNSW_search_from_candidates" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->search_from_candidates(*arg2,arg3,arg4,arg5,*arg6,*arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[10] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 9) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 8) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__DistanceComputer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_faiss__VisitedTable, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_search_from_candidates__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__DistanceComputer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_faiss__VisitedTable, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_search_from_candidates__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'HNSW_search_from_candidates'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::search_from_candidates(faiss::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int,int) const\n" - " faiss::HNSW::search_from_candidates(faiss::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidate_unbounded(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::Node *arg2 = 0 ; - faiss::DistanceComputer *arg3 = 0 ; - int arg4 ; - faiss::VisitedTable *arg5 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - std::priority_queue< faiss::HNSW::Node > result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:HNSW_search_from_candidate_unbounded",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__pairT_float_int_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); - } - arg2 = reinterpret_cast< faiss::HNSW::Node * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "3"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "3"" of type '" "faiss::DistanceComputer &""'"); - } - arg3 = reinterpret_cast< faiss::DistanceComputer * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "5"" of type '" "faiss::VisitedTable *""'"); - } - arg5 = reinterpret_cast< faiss::VisitedTable * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::HNSW const *)arg1)->search_from_candidate_unbounded((faiss::HNSW::Node const &)*arg2,*arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::priority_queue< faiss::HNSW::Node >(static_cast< const std::priority_queue< faiss::HNSW::Node >& >(result))), SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::VisitedTable *arg6 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:HNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - arg6 = reinterpret_cast< faiss::VisitedTable * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->search(*arg2,arg3,arg4,arg5,*arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_reset" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_clear_neighbor_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_clear_neighbor_tables",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_clear_neighbor_tables" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_clear_neighbor_tables" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->clear_neighbor_tables(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_print_neighbor_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_print_neighbor_stats",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_print_neighbor_stats" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_print_neighbor_stats" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->print_neighbor_stats(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_prepare_level_tab",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_prepare_level_tab" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_prepare_level_tab" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_prepare_level_tab" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->prepare_level_tab(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_prepare_level_tab",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_prepare_level_tab" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_prepare_level_tab" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->prepare_level_tab(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_prepare_level_tab__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_prepare_level_tab__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'HNSW_prepare_level_tab'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::prepare_level_tab(size_t,bool)\n" - " faiss::HNSW::prepare_level_tab(size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_shrink_neighbor_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = 0 ; - std::priority_queue< faiss::HNSW::NodeDistFarther > *arg2 = 0 ; - std::vector< faiss::HNSW::NodeDistFarther > *arg3 = 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:HNSW_shrink_neighbor_list",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::DistanceComputer &""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_shrink_neighbor_list" "', argument " "2"" of type '" "std::priority_queue< faiss::HNSW::NodeDistFarther > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "2"" of type '" "std::priority_queue< faiss::HNSW::NodeDistFarther > &""'"); - } - arg2 = reinterpret_cast< std::priority_queue< faiss::HNSW::NodeDistFarther > * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "HNSW_shrink_neighbor_list" "', argument " "3"" of type '" "std::vector< faiss::HNSW::NodeDistFarther > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "3"" of type '" "std::vector< faiss::HNSW::NodeDistFarther > &""'"); - } - arg3 = reinterpret_cast< std::vector< faiss::HNSW::NodeDistFarther > * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_shrink_neighbor_list" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::HNSW::shrink_neighbor_list(*arg1,*arg2,*arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HNSW" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VisitedTable_visited_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_visited_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visited_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VisitedTable_visited_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->visited = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visited_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_visited_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visited_get" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->visited); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_visno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visno_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_visno_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->visno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_visno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visno_get" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - result = (int) ((arg1)->visno); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VisitedTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VisitedTable *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_VisitedTable",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VisitedTable" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VisitedTable *)new faiss::VisitedTable(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VisitedTable, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_get",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_get" "', argument " "1"" of type '" "faiss::VisitedTable const *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_get" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)((faiss::VisitedTable const *)arg1)->get(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_advance",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_advance" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->advance(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VisitedTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VisitedTable",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VisitedTable" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VisitedTable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VisitedTable, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HNSWStats_n1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n1_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n1_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n1_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n2_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n2_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n2_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n2); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n3_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n3_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n3_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n3); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_ndis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_ndis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_ndis_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_ndis_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ndis = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_ndis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_ndis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_ndis_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->ndis); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_nreorder_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_nreorder_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_nreorder_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_nreorder_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nreorder = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_nreorder_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_nreorder_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_nreorder_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->nreorder); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_view_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_view_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_view_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_view_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->view = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_view_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_view_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_view_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (bool) ((arg1)->view); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSWStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HNSWStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSWStats *)new faiss::HNSWStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSWStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_reset" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HNSWStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HNSWStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HNSWStats" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HNSWStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HNSWStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_hnsw_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__HNSWStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::hnsw_stats""' of type '""faiss::HNSWStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::hnsw_stats""' of type '""faiss::HNSWStats""'"); - } else { - faiss::HNSWStats * temp; - temp = reinterpret_cast< faiss::HNSWStats * >(argp); - faiss::hnsw_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_hnsw_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::hnsw_stats), SWIGTYPE_p_faiss__HNSWStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_index_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (faiss::IndexHNSW *) &(faiss::IndexHNSW const &) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_M_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_M_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_M_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->M); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_nsq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_nsq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_nsq_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_nsq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nsq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_nsq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_nsq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_nsq_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->nsq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_code_size_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_code_size_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_reorder_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_k_reorder_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_reorder_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_k_reorder_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->k_reorder = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_reorder_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_k_reorder_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_reorder_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (int) ((arg1)->k_reorder); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codebook_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_codebook_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codebook_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_codebook_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->codebook = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codebook_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_codebook_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codebook_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (std::vector< float > *)& ((arg1)->codebook); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codes_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codes_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_ntotal_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_ntotal_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_ntotal_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->ntotal); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_d_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_d_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_dsub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_dsub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_dsub_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_dsub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->dsub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_dsub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_dsub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_dsub_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->dsub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_ReconstructFromNeighbors",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ReconstructFromNeighbors" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ReconstructFromNeighbors" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ReconstructFromNeighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ReconstructFromNeighbors" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_ReconstructFromNeighbors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ReconstructFromNeighbors'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &,size_t,size_t)\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &,size_t)\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_add_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReconstructFromNeighbors_add_codes",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_codes(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_compute_distances(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - faiss::ReconstructFromNeighbors::idx_t *arg3 = (faiss::ReconstructFromNeighbors::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ReconstructFromNeighbors_compute_distances",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::ReconstructFromNeighbors::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ReconstructFromNeighbors const *)arg1)->compute_distances(arg2,(faiss::ReconstructFromNeighbors::idx_t const *)arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_estimate_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - float *arg2 = (float *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_estimate_code",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg3 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->estimate_code((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_reconstruct",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->reconstruct(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg3 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_get_neighbor_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReconstructFromNeighbors_get_neighbor_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->get_neighbor_table(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ReconstructFromNeighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ReconstructFromNeighbors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ReconstructFromNeighbors_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexHNSW_hnsw_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::HNSW *arg2 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_hnsw_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_hnsw_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_hnsw_set" "', argument " "2"" of type '" "faiss::HNSW *""'"); - } - arg2 = reinterpret_cast< faiss::HNSW * >(argp2); - if (arg1) (arg1)->hnsw = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_hnsw_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_hnsw_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_hnsw_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::HNSW *)& ((arg1)->hnsw); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_own_fields_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_own_fields_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_storage_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_storage_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_storage_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->storage = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_storage_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_storage_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::Index *) ((arg1)->storage); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct_from_neighbors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::ReconstructFromNeighbors *arg2 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_reconstruct_from_neighbors_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct_from_neighbors_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_reconstruct_from_neighbors_set" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg2 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp2); - if (arg1) (arg1)->reconstruct_from_neighbors = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct_from_neighbors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reconstruct_from_neighbors_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct_from_neighbors_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::ReconstructFromNeighbors *) ((arg1)->reconstruct_from_neighbors); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSW" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSW const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_add" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_train" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexHNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reset" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_shrink_level_0_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_shrink_level_0_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_shrink_level_0_neighbors" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_shrink_level_0_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->shrink_level_0_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - int arg9 ; - int arg10 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - int val9 ; - int ecode9 = 0 ; - int val10 ; - int ecode10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexHNSW_search_level_0" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - ecode10 = SWIG_AsVal_int(obj9, &val10); - if (!SWIG_IsOK(ecode10)) { - SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "IndexHNSW_search_level_0" "', argument " "10"" of type '" "int""'"); - } - arg10 = static_cast< int >(val10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - int arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - int val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexHNSW_search_level_0" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 8) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_2(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[9], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexHNSW_search_level_0'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *,int,int) const\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *,int) const\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_init_level_0_from_knngraph(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexHNSW_init_level_0_from_knngraph",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init_level_0_from_knngraph(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_init_level_0_from_entry_points(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - faiss::IndexHNSW::storage_idx_t *arg3 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - faiss::IndexHNSW::storage_idx_t *arg4 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexHNSW_init_level_0_from_entry_points",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "3"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "4"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init_level_0_from_entry_points(arg2,(faiss::IndexHNSW::storage_idx_t const *)arg3,(faiss::IndexHNSW::storage_idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reorder_links(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reorder_links",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reorder_links" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reorder_links(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_link_singletons(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_link_singletons",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_link_singletons" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->link_singletons(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWFlat *)new faiss::IndexHNSWFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexHNSWFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexHNSWFlat",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWFlat" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWFlat *)new faiss::IndexHNSWFlat(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWFlat__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWFlat__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWFlat::IndexHNSWFlat()\n" - " faiss::IndexHNSWFlat::IndexHNSWFlat(int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWFlat_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *arg1 = (faiss::IndexHNSWFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWFlat_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWFlat_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWFlat const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *arg1 = (faiss::IndexHNSWFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWFlat" "', argument " "1"" of type '" "faiss::IndexHNSWFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWPQ *)new faiss::IndexHNSWPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexHNSWPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexHNSWPQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWPQ" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSWPQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWPQ *)new faiss::IndexHNSWPQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWPQ__SWIG_0(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWPQ__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWPQ::IndexHNSWPQ()\n" - " faiss::IndexHNSWPQ::IndexHNSWPQ(int,int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWPQ_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSWPQ_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWPQ_train" "', argument " "1"" of type '" "faiss::IndexHNSWPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSWPQ_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSWPQ_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWPQ_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWPQ_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWPQ_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWPQ const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWPQ" "', argument " "1"" of type '" "faiss::IndexHNSWPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWSQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWSQ *)new faiss::IndexHNSWSQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexHNSWSQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexHNSWSQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWSQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWSQ" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSWSQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWSQ *)new faiss::IndexHNSWSQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWSQ__SWIG_0(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWSQ__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWSQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWSQ::IndexHNSWSQ()\n" - " faiss::IndexHNSWSQ::IndexHNSWSQ(int,faiss::ScalarQuantizer::QuantizerType,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWSQ_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *arg1 = (faiss::IndexHNSWSQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWSQ_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWSQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWSQ_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWSQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWSQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWSQ const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWSQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *arg1 = (faiss::IndexHNSWSQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWSQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWSQ" "', argument " "1"" of type '" "faiss::IndexHNSWSQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWSQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWSQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSW2Level")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSW2Level *)new faiss::IndexHNSW2Level(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexHNSW2Level *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexHNSW2Level",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexHNSW2Level" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSW2Level" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSW2Level" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexHNSW2Level" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSW2Level *)new faiss::IndexHNSW2Level(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSW2Level__SWIG_0(self, args); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSW2Level__SWIG_1(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSW2Level'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSW2Level::IndexHNSW2Level()\n" - " faiss::IndexHNSW2Level::IndexHNSW2Level(faiss::Index *,size_t,int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW2Level_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSW2Level const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSW2Level const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_flip_to_ivf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW2Level_flip_to_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_flip_to_ivf" "', argument " "1"" of type '" "faiss::IndexHNSW2Level *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->flip_to_ivf(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexHNSW2Level_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_search" "', argument " "1"" of type '" "faiss::IndexHNSW2Level const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW2Level_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW2Level_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW2Level_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW2Level_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW2Level_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW2Level const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSW2Level(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSW2Level",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSW2Level" "', argument " "1"" of type '" "faiss::IndexHNSW2Level *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSW2Level_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFFlat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlat" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFFlat" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexIVFFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlat" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_add_core(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlat_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_add_core" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlat_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlat_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlat const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlat_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFFlat const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_update_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - int arg2 ; - faiss::Index::idx_t *arg3 = (faiss::Index::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_update_vectors",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_update_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_update_vectors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_update_vectors" "', argument " "3"" of type '" "faiss::Index::idx_t *""'"); - } - arg3 = reinterpret_cast< faiss::Index::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_update_vectors" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_vectors(arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlat const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFFlat__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlat__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlat__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlat::IndexIVFFlat(faiss::Index *,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexIVFFlat::IndexIVFFlat(faiss::Index *,size_t,size_t)\n" - " faiss::IndexIVFFlat::IndexIVFFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFFlat" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_instances_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlatDedup_instances_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_multimapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "2"" of type '" "std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "2"" of type '" "std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } else { - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > * temp = reinterpret_cast< std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->instances = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_instances_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFFlatDedup_instances_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_instances_get" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - result = ((arg1)->instances); - resultobj = SWIG_NewPointerObj((new std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >(static_cast< const std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >& >(result))), SWIGTYPE_p_std__unordered_multimapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFFlatDedup",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlatDedup" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlatDedup" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFFlatDedup" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexIVFFlatDedup",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlatDedup" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlatDedup" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFFlatDedup_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_train" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVFFlatDedup_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVFFlatDedup_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFFlatDedup_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFFlatDedup_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFFlatDedup_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlatDedup::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVFFlatDedup::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlatDedup_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlatDedup_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_update_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - int arg2 ; - faiss::Index::idx_t *arg3 = (faiss::Index::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_update_vectors",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "3"" of type '" "faiss::Index::idx_t *""'"); - } - arg3 = reinterpret_cast< faiss::Index::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_vectors(arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFFlatDedup")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFFlatDedup__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlatDedup__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlatDedup__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFFlatDedup'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup(faiss::Index *,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup(faiss::Index *,size_t,size_t)\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFFlatDedup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFFlatDedup",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFFlatDedup_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_lists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::vector< faiss::OnDiskInvertedLists::List > *arg2 = (std::vector< faiss::OnDiskInvertedLists::List > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_lists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_lists_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_lists_set" "', argument " "2"" of type '" "std::vector< faiss::OnDiskInvertedLists::List > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OnDiskInvertedLists::List > * >(argp2); - if (arg1) (arg1)->lists = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_lists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OnDiskInvertedLists::List > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_lists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_lists_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::vector< faiss::OnDiskInvertedLists::List > *)& ((arg1)->lists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_slots_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::list< faiss::OnDiskInvertedLists::Slot > *arg2 = (std::list< faiss::OnDiskInvertedLists::Slot > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_slots_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_slots_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_slots_set" "', argument " "2"" of type '" "std::list< faiss::OnDiskInvertedLists::Slot > *""'"); - } - arg2 = reinterpret_cast< std::list< faiss::OnDiskInvertedLists::Slot > * >(argp2); - if (arg1) (arg1)->slots = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_slots_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::list< faiss::OnDiskInvertedLists::Slot > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_slots_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_slots_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::list< faiss::OnDiskInvertedLists::Slot > *)& ((arg1)->slots); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_filename_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_filename_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_filename_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_filename_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OnDiskInvertedLists_filename_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->filename = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_filename_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_filename_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_filename_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::string *) & ((arg1)->filename); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_totsize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_totsize_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_totsize_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_totsize_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->totsize = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_totsize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_totsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_totsize_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (size_t) ((arg1)->totsize); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_ptr_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_ptr_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_ptr_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_ptr_set" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - if (arg1) (arg1)->ptr = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_ptr_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_ptr_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_ptr_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (uint8_t *) ((arg1)->ptr); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_read_only_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_read_only_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_read_only_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_read_only_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->read_only = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_read_only_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_read_only_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_read_only_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (bool) ((arg1)->read_only); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - char *arg3 = (char *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::OnDiskInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_OnDiskInvertedLists",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OnDiskInvertedLists" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OnDiskInvertedLists" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_OnDiskInvertedLists" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OnDiskInvertedLists *)new faiss::OnDiskInvertedLists(arg1,arg2,(char const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_NEW | 0 ); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_list_size" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::OnDiskInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::OnDiskInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::OnDiskInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:OnDiskInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:OnDiskInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_resize" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::InvertedLists **arg2 = (faiss::InvertedLists **) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "2"" of type '" "faiss::InvertedLists const **""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists ** >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->merge_from((faiss::InvertedLists const **)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_prefetch_lists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - long *arg2 = (long *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_prefetch_lists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OnDiskInvertedLists const *)arg1)->prefetch_lists((long const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OnDiskInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OnDiskInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OnDiskInvertedLists" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_locks_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::LockLevels *arg2 = (faiss::LockLevels *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_locks_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_locks_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__LockLevels, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_locks_set" "', argument " "2"" of type '" "faiss::LockLevels *""'"); - } - arg2 = reinterpret_cast< faiss::LockLevels * >(argp2); - if (arg1) (arg1)->locks = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_locks_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::LockLevels *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_locks_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_locks_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (faiss::LockLevels *) ((arg1)->locks); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LockLevels, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_pf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::OnDiskInvertedLists::OngoingPrefetch *arg2 = (faiss::OnDiskInvertedLists::OngoingPrefetch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_pf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_pf_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_pf_set" "', argument " "2"" of type '" "faiss::OnDiskInvertedLists::OngoingPrefetch *""'"); - } - arg2 = reinterpret_cast< faiss::OnDiskInvertedLists::OngoingPrefetch * >(argp2); - if (arg1) (arg1)->pf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_pf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OnDiskInvertedLists::OngoingPrefetch *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_pf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_pf_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (faiss::OnDiskInvertedLists::OngoingPrefetch *) ((arg1)->pf); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_do_mmap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_do_mmap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_do_mmap" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->do_mmap(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_update_totsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_update_totsize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_update_totsize" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_update_totsize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_totsize(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_resize_locked(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_resize_locked",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize_locked(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_allocate_slot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_allocate_slot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_allocate_slot" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_allocate_slot" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->allocate_slot(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_free_slot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_free_slot",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->free_slot(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OnDiskInvertedLists")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OnDiskInvertedLists *)new faiss::OnDiskInvertedLists(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_OnDiskInvertedLists__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_OnDiskInvertedLists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_OnDiskInvertedLists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OnDiskInvertedLists::OnDiskInvertedLists(size_t,size_t,char const *)\n" - " faiss::OnDiskInvertedLists::OnDiskInvertedLists()\n"); - return 0; -} - - -SWIGINTERN PyObject *OnDiskInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_scan_table_threshold_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFPQSearchParameters_scan_table_threshold_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_scan_table_threshold_set" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFPQSearchParameters_scan_table_threshold_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->scan_table_threshold = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_scan_table_threshold_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFPQSearchParameters_scan_table_threshold_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_scan_table_threshold_get" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - result = (size_t) ((arg1)->scan_table_threshold); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFPQSearchParameters_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFPQSearchParameters_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFPQSearchParameters_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IVFPQSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IVFPQSearchParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVFPQSearchParameters" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IVFPQSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IVFPQSearchParameters")) SWIG_fail; - result = (faiss::IVFPQSearchParameters *)new faiss::IVFPQSearchParameters(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IVFPQSearchParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_by_residual_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_by_residual_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_by_residual_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_by_residual_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->by_residual = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_by_residual_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_by_residual_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_by_residual_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (bool) ((arg1)->by_residual); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_pq_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_pq_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_do_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_do_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_do_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_do_polysemous_training_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->do_polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_do_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_do_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_do_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (bool) ((arg1)->do_polysemous_training); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::PolysemousTraining *arg2 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_polysemous_training_set" "', argument " "2"" of type '" "faiss::PolysemousTraining *""'"); - } - arg2 = reinterpret_cast< faiss::PolysemousTraining * >(argp2); - if (arg1) (arg1)->polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (faiss::PolysemousTraining *) ((arg1)->polysemous_training); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_scan_table_threshold_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_scan_table_threshold_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_scan_table_threshold_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_scan_table_threshold_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->scan_table_threshold = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_scan_table_threshold_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_scan_table_threshold_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_scan_table_threshold_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (size_t) ((arg1)->scan_table_threshold); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_use_precomputed_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_use_precomputed_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_use_precomputed_table_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_use_precomputed_table_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->use_precomputed_table = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_use_precomputed_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_use_precomputed_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_use_precomputed_table_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (int) ((arg1)->use_precomputed_table); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN int Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set(PyObject *_val) { - { - size_t val; - int res = SWIG_AsVal_size_t(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::IndexIVFPQ::precomputed_table_max_bytes""' of type '""size_t""'"); - } - faiss::IndexIVFPQ::precomputed_table_max_bytes = static_cast< size_t >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_size_t(static_cast< size_t >(faiss::IndexIVFPQ::precomputed_table_max_bytes)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_max_bytes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(args)) { - return Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get(); -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_max_bytes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - int res; - PyObject *value; - - if (!PyArg_ParseTuple(args,(char *)"O:set",&value)) return NULL; - res = Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set(value); - return !res ? SWIG_Py_Void() : NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_precomputed_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precomputed_table_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_precomputed_table_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->precomputed_table = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_precomputed_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precomputed_table_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (std::vector< float > *)& ((arg1)->precomputed_table); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - faiss::IndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_IndexIVFPQ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFPQ" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFPQ" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFPQ" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQ *)new faiss::IndexIVFPQ(arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_add_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_with_ids__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_with_ids__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_add_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *,long const *)\n" - " faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - float *arg5 = (float *) 0 ; - long *arg6 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 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 * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVFPQ_add_core_o",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_core_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_core_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_core_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_core_o" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_add_core_o" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQ_add_core_o" "', argument " "6"" of type '" "long const *""'"); - } - arg6 = reinterpret_cast< long * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core_o(arg2,(float const *)arg3,(long const *)arg4,arg5,(long const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_add_core_o",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_core_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_core_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_core_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_core_o" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_add_core_o" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core_o(arg2,(float const *)arg3,(long const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_core_o__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_core_o__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_add_core_o'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::add_core_o(faiss::Index::idx_t,float const *,long const *,float *,long const *)\n" - " faiss::IndexIVFPQ::add_core_o(faiss::Index::idx_t,float const *,long const *,float *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_train_residual_o(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_train_residual_o",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual_o(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_find_duplicates(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t *arg2 = (faiss::Index::idx_t *) 0 ; - size_t *arg3 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_find_duplicates",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "2"" of type '" "faiss::Index::idx_t *""'"); - } - arg2 = reinterpret_cast< faiss::Index::idx_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexIVFPQ const *)arg1)->find_duplicates(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - long arg2 ; - float *arg3 = (float *) 0 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_encode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - bool arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - bool val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVFPQ_encode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - ecode6 = SWIG_AsVal_bool(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "6"" of type '" "bool""'"); - } - arg6 = static_cast< bool >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_multiple(arg2,arg3,(float const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_encode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_multiple(arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_encode_multiple__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFPQ_encode_multiple__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_encode_multiple'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::encode_multiple(size_t,long *,float const *,uint8_t *,bool) const\n" - " faiss::IndexIVFPQ::encode_multiple(size_t,long *,float const *,uint8_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_decode_multiple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - uint8_t *arg4 = (uint8_t *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_decode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->decode_multiple(arg2,(long const *)arg3,(uint8_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFPQ const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precompute_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_precompute_table",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precompute_table" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->precompute_table(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQ *)new faiss::IndexIVFPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFPQ__SWIG_1(self, args); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFPQ__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::IndexIVFPQ(faiss::Index *,size_t,size_t,size_t,size_t)\n" - " faiss::IndexIVFPQ::IndexIVFPQ()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQ" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_nrefine_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_nrefine_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_nrefine_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_nrefine_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nrefine = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_nrefine_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_nrefine_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_nrefine_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->nrefine); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_n_hamming_pass_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_n_hamming_pass_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_n_hamming_pass_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_n_hamming_pass_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_hamming_pass = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_n_hamming_pass_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_n_hamming_pass_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_n_hamming_pass_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->n_hamming_pass); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_search_cycles_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_search_cycles_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_search_cycles_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_search_cycles_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->search_cycles = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_search_cycles_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_search_cycles_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_search_cycles_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->search_cycles); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_refine_cycles_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_refine_cycles_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_refine_cycles_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_refine_cycles_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->refine_cycles = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_refine_cycles_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_refine_cycles_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_refine_cycles_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->refine_cycles); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQStats *)new faiss::IndexIVFPQStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_reset" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQStats" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexIVFPQ_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexIVFPQ_stats""' of type '""faiss::IndexIVFPQStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexIVFPQ_stats""' of type '""faiss::IndexIVFPQStats""'"); - } else { - faiss::IndexIVFPQStats * temp; - temp = reinterpret_cast< faiss::IndexIVFPQStats * >(argp); - faiss::indexIVFPQ_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexIVFPQ_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexIVFPQ_stats), SWIGTYPE_p_faiss__IndexIVFPQStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_refine_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_pq_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_refine_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->refine_pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_refine_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_pq_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->refine_pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_refine_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_codes_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_refine_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->refine_codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_refine_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_codes_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->refine_codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_k_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_k_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_k_factor_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_k_factor_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->k_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_k_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_k_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_k_factor_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (float) ((arg1)->k_factor); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - faiss::IndexIVFPQR *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_IndexIVFPQR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFPQR" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFPQR" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFPQR" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFPQR" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFPQR" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_IndexIVFPQR" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_IndexIVFPQR" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQR *)new faiss::IndexIVFPQR(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_reset" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFPQR_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQR_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQR_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_core" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_add_core",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_core" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_add_core__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_add_core__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQR_add_core'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::add_core(faiss::Index::idx_t,float const *,long const *,long const *)\n" - " faiss::IndexIVFPQR::add_core(faiss::Index::idx_t,float const *,long const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - faiss::Index::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQR_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_merge_from" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFPQR_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQR_merge_from" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVFPQR_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVFPQR_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFPQR_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQR_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVFPQR::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQR")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQR *)new faiss::IndexIVFPQR(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFPQR__SWIG_1(self, args); - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFPQR__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFPQR'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::IndexIVFPQR(faiss::Index *,size_t,size_t,size_t,size_t,size_t,size_t)\n" - " faiss::IndexIVFPQR::IndexIVFPQR()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQR(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQR",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQR" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQR_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Index2Layer_q1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Level1Quantizer *arg2 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_q1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_q1_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_q1_set" "', argument " "2"" of type '" "faiss::Level1Quantizer *""'"); - } - arg2 = reinterpret_cast< faiss::Level1Quantizer * >(argp2); - if (arg1) (arg1)->q1 = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_q1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_q1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_q1_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (faiss::Level1Quantizer *)& ((arg1)->q1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_pq_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_pq_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_codes_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_codes_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_1_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_1_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size_1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_1_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size_1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_2_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_2_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size_2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_2_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size_2); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Index2Layer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Index2Layer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Index2Layer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Index2Layer" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Index2Layer" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_Index2Layer",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Index2Layer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Index2Layer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Index2Layer" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Index2Layer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Index2Layer__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Index2Layer__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Index2Layer__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Index2Layer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Index2Layer::Index2Layer(faiss::Index *,size_t,int,faiss::MetricType)\n" - " faiss::Index2Layer::Index2Layer(faiss::Index *,size_t,int)\n" - " faiss::Index2Layer::Index2Layer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Index2Layer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Index2Layer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Index2Layer" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_train" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_add" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Index2Layer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_search" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index2Layer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index2Layer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index2Layer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index2Layer_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reconstruct_n" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Index2Layer_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index2Layer_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reconstruct" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reset" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_transfer_to_IVFPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::IndexIVFPQ *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_transfer_to_IVFPQ",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVFPQ, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->transfer_to_IVFPQ(*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Index2Layer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Index2Layer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinary_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_d_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_d_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_d_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (int) ((arg1)->d); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_code_size_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_code_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_code_size_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (int) ((arg1)->code_size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_ntotal_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_ntotal_set" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_ntotal_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (faiss::IndexBinary::idx_t) ((arg1)->ntotal); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_verbose_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_verbose_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_is_trained_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_is_trained_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_metric_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_metric_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_metric_type_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_metric_type_set" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - if (arg1) (arg1)->metric_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_metric_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::MetricType result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_metric_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_metric_type_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (faiss::MetricType) ((arg1)->metric_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinary" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_train" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_add" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_add_with_ids" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_add_with_ids" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_add_with_ids" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(uint8_t const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinary_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_search" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinary_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - int arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinary_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_range_search" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_range_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_range_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_range_search" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->range_search(arg2,(uint8_t const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t *arg4 = (faiss::IndexBinary::idx_t *) 0 ; - faiss::IndexBinary::idx_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinary_assign",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_assign" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_assign" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_assign" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_assign" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IndexBinary_assign" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg5 = static_cast< faiss::IndexBinary::idx_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(uint8_t const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t *arg4 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_assign",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_assign" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_assign" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_assign" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_assign" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(uint8_t const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinary_assign__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinary_assign__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinary_assign'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinary::assign(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t *,faiss::IndexBinary::idx_t)\n" - " faiss::IndexBinary::assign(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reset" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinary_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinary_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - faiss::IndexBinary::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_reconstruct_n" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinary_reconstruct_n" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_reconstruct_n" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - uint8_t *arg7 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexBinary_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "7"" of type '" "uint8_t *""'"); - } - arg7 = reinterpret_cast< uint8_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->search_and_reconstruct(arg2,(uint8_t const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_display" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinary_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinary, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_xb_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_xb_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_xb_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFlat_xb_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->xb = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_xb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_xb_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_xb_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->xb); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_use_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_use_heap_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_use_heap_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_use_heap_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->use_heap = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_use_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_use_heap_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_use_heap_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (bool) ((arg1)->use_heap); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_query_batch_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_query_batch_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_query_batch_size_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_query_batch_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->query_batch_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_query_batch_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_query_batch_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_query_batch_size_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (size_t) ((arg1)->query_batch_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryFlat",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryFlat" "', argument " "1"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg1 = static_cast< faiss::IndexBinary::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFlat *)new faiss::IndexBinaryFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_add" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_reset" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_search" "', argument " "1"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryFlat_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryFlat_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryFlat_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFlat const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFlat *)new faiss::IndexBinaryFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryFlat__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryFlat__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryFlat::IndexBinaryFlat(faiss::IndexBinary::idx_t)\n" - " faiss::IndexBinaryFlat::IndexBinaryFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryFlat" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_invlists_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_invlists_set" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - if (arg1) (arg1)->invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_invlists_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::InvertedLists *) ((arg1)->invlists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_own_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_invlists_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_own_invlists_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_own_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_invlists_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->own_invlists); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nprobe_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nprobe_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_max_codes_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_max_codes_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_use_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_use_heap_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_use_heap_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_use_heap_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->use_heap = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_use_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_use_heap_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_use_heap_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->use_heap); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_maintain_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_maintain_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_maintain_direct_map_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_maintain_direct_map_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->maintain_direct_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_maintain_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_maintain_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_maintain_direct_map_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->maintain_direct_map); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_direct_map_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_direct_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->direct_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_direct_map_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (std::vector< long > *)& ((arg1)->direct_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_quantizer_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_quantizer_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_quantizer_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_quantizer_set" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - if (arg1) (arg1)->quantizer = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_quantizer_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_quantizer_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_quantizer_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::IndexBinary *) ((arg1)->quantizer); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nlist_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nlist_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_cp_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_cp_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_clustering_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_clustering_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_clustering_index_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_clustering_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->clustering_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_clustering_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_clustering_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_clustering_index_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::Index *) ((arg1)->clustering_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexBinaryIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexBinaryIVF",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryIVF" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryIVF" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexBinaryIVF" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryIVF *)new faiss::IndexBinaryIVF(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryIVF")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryIVF *)new faiss::IndexBinaryIVF(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryIVF__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryIVF__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryIVF'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::IndexBinaryIVF(faiss::IndexBinary *,size_t,size_t)\n" - " faiss::IndexBinaryIVF::IndexBinaryIVF()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryIVF",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryIVF" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reset" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_train" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(uint8_t const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add_core(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinaryIVF_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add_core" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add_core" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add_core" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(uint8_t const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - faiss::IndexBinary::idx_t *arg5 = (faiss::IndexBinary::idx_t *) 0 ; - int32_t *arg6 = (int32_t *) 0 ; - int32_t *arg7 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg8 = (faiss::IndexBinary::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexBinaryIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "6"" of type '" "int32_t const *""'"); - } - arg6 = reinterpret_cast< int32_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "8"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_preassigned(arg2,(uint8_t const *)arg3,arg4,(faiss::IndexBinary::idx_t const *)arg5,(int32_t const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - faiss::IndexBinary::idx_t *arg5 = (faiss::IndexBinary::idx_t *) 0 ; - int32_t *arg6 = (int32_t *) 0 ; - int32_t *arg7 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg8 = (faiss::IndexBinary::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexBinaryIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "6"" of type '" "int32_t const *""'"); - } - arg6 = reinterpret_cast< int32_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "8"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_preassigned(arg2,(uint8_t const *)arg3,arg4,(faiss::IndexBinary::idx_t const *)arg5,(int32_t const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::search_preassigned(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t,faiss::IndexBinary::idx_t const *,int32_t const *,int32_t *,faiss::IndexBinary::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexBinaryIVF::search_preassigned(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t,faiss::IndexBinary::idx_t const *,int32_t const *,int32_t *,faiss::IndexBinary::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::BinaryInvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::BinaryInvertedListScanner *)((faiss::IndexBinaryIVF const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BinaryInvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::BinaryInvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_get_InvertedListScanner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::BinaryInvertedListScanner *)((faiss::IndexBinaryIVF const *)arg1)->get_InvertedListScanner(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BinaryInvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_get_InvertedListScanner'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::get_InvertedListScanner(bool) const\n" - " faiss::IndexBinaryIVF::get_InvertedListScanner() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryIVF_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - faiss::IndexBinary::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - uint8_t *arg7 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexBinaryIVF_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "7"" of type '" "uint8_t *""'"); - } - arg7 = reinterpret_cast< uint8_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_and_reconstruct(arg2,(uint8_t const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - long arg2 ; - long arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinaryIVF *arg2 = 0 ; - faiss::IndexBinary::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_merge_from" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexBinaryIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexBinaryIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexBinaryIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_merge_from" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_get_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_list_size" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_get_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexBinaryIVF const *)arg1)->get_list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_make_direct_map",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_make_direct_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_make_direct_map__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_make_direct_map__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_make_direct_map'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::make_direct_map(bool)\n" - " faiss::IndexBinaryIVF::make_direct_map()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_replace_invlists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_replace_invlists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_replace_invlists__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_replace_invlists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_replace_invlists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::replace_invlists(faiss::InvertedLists *,bool)\n" - " faiss::IndexBinaryIVF::replace_invlists(faiss::InvertedLists *)\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexBinaryIVF_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFromFloat_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_index_set" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFromFloat_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_index_get" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFromFloat_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryFromFloat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFromFloat *)new faiss::IndexBinaryFromFloat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryFromFloat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryFromFloat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryFromFloat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFromFloat *)new faiss::IndexBinaryFromFloat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryFromFloat__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexBinaryFromFloat__SWIG_1(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryFromFloat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryFromFloat::IndexBinaryFromFloat()\n" - " faiss::IndexBinaryFromFloat::IndexBinaryFromFloat(faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryFromFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryFromFloat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryFromFloat" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFromFloat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_add" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_reset" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryFromFloat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_search" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryFromFloat_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryFromFloat_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryFromFloat_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFromFloat const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFromFloat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_train" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryFromFloat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_hnsw_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::HNSW *arg2 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_hnsw_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_hnsw_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryHNSW_hnsw_set" "', argument " "2"" of type '" "faiss::HNSW *""'"); - } - arg2 = reinterpret_cast< faiss::HNSW * >(argp2); - if (arg1) (arg1)->hnsw = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_hnsw_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_hnsw_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_hnsw_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (faiss::HNSW *)& ((arg1)->hnsw); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_storage_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_storage_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryHNSW_storage_set" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - if (arg1) (arg1)->storage = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_storage_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_storage_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (faiss::IndexBinary *) ((arg1)->storage); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryHNSW")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryHNSW",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryHNSW" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryHNSW",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryHNSW",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryHNSW" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryHNSW__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_4(self, args); - } - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_3(self, args); - } - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryHNSW'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW()\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(int,int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(faiss::IndexBinary *,int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(faiss::IndexBinary *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryHNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexBinaryHNSW const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_add" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_train" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryHNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_search" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryHNSW_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryHNSW_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryHNSW_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryHNSW const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryHNSW const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_reset" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryHNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexShards_shard_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_shard_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexShards_shard_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->shard_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_shard_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_shard_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->shard_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_successive_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_successive_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_successive_ids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->successive_ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_successive_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_successive_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->successive_ids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - bool arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexShards",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexShards" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexShards",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexShards",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexShards'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t,bool,bool)\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t,bool)\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add_shard(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_add_shard",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_shard" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexShards_add_shard" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_shard(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_sync_with_shard_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_sync_with_shard_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_sync_with_shard_indexes" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_shard_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_at" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexShards_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_add" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_add" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t *arg4 = (faiss::IndexShardsTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexShards_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_with_ids" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_add_with_ids" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_add_with_ids" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexShards_add_with_ids" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3,(faiss::IndexShardsTemplate< faiss::Index >::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg4 ; - faiss::IndexShardsTemplate< faiss::Index >::distance_t *arg5 = (faiss::IndexShardsTemplate< faiss::Index >::distance_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t *arg6 = (faiss::IndexShardsTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexShards_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_search" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_search" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_search" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexShards_search" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexShards_search" "', argument " "5"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexShards_search" "', argument " "6"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexShardsTemplate< faiss::Index > const *)arg1)->search(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexShards_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_train" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_train" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_train" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_reset" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexShards(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexShards",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexShards_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_shard_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - std::vector< faiss::IndexBinary * > *arg2 = (std::vector< faiss::IndexBinary * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_shard_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_shard_indexes_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryShards_shard_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::IndexBinary * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::IndexBinary * > * >(argp2); - if (arg1) (arg1)->shard_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_shard_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::IndexBinary * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_shard_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_shard_indexes_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (std::vector< faiss::IndexBinary * > *)& ((arg1)->shard_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_own_fields_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_own_fields_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_threaded_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_threaded_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_successive_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_successive_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_successive_ids_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_successive_ids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->successive_ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_successive_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_successive_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_successive_ids_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->successive_ids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - bool arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexBinaryShards",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexBinaryShards" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryShards",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryShards",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryShards'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t,bool,bool)\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t,bool)\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add_shard(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_add_shard",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add_shard" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryShards_add_shard" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_shard(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_sync_with_shard_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_sync_with_shard_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_sync_with_shard_indexes" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_shard_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_at" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryShards_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_add" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_add" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *arg4 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryShards_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3,(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg4 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *arg5 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *arg6 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryShards_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_search" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_search" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_search" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryShards_search" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryShards_search" "', argument " "5"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryShards_search" "', argument " "6"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexShardsTemplate< faiss::IndexBinary > const *)arg1)->search(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryShards_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_train" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_train" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_train" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_reset" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryShards(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryShards",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryShards_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexReplicas")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexReplicasTemplate< faiss::Index > *)new faiss::IndexReplicasTemplate< faiss::Index >(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexReplicas",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexReplicas" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_addIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_addIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_addIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_addIndex" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->addIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_removeIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_removeIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_removeIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_removeIndex" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->removeIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_runOnIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - SwigValueWrapper< std::function< void (faiss::Index *) > > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_runOnIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_runOnIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::Index *) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::Index *) >""'"); - } else { - std::function< void (faiss::Index *) > * temp = reinterpret_cast< std::function< void (faiss::Index *) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->runOnIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_reset" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_train" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_train" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_train" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_add" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_add" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_add" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg4 ; - faiss::IndexReplicasTemplate< faiss::Index >::distance_t *arg5 = (faiss::IndexReplicasTemplate< faiss::Index >::distance_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t *arg6 = (faiss::IndexReplicasTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexReplicas_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_search" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_search" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_search" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexReplicas_search" "', argument " "4"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexReplicas_search" "', argument " "5"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexReplicas_search" "', argument " "6"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->search(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_reconstruct" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_reconstruct" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_reconstruct" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_own_fields_set" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_own_fields_get" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_count",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_count" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->count(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexReplicas_at__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexReplicas_at__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexReplicas_at'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexReplicasTemplate< faiss::Index >::at(int)\n" - " faiss::IndexReplicasTemplate< faiss::Index >::at(int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexReplicas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexBinaryReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryReplicas")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *)new faiss::IndexReplicasTemplate< faiss::IndexBinary >(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryReplicas",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryReplicas" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_addIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_addIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_addIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_addIndex" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->addIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_removeIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_removeIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_removeIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_removeIndex" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->removeIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_runOnIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - SwigValueWrapper< std::function< void (faiss::IndexBinary *) > > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_runOnIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__functionT_void_ffaiss__IndexBinary_pF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::IndexBinary *) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::IndexBinary *) >""'"); - } else { - std::function< void (faiss::IndexBinary *) > * temp = reinterpret_cast< std::function< void (faiss::IndexBinary *) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->runOnIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_reset" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_train" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_train" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_train" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_add" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_add" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_add" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg4 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *arg5 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *arg6 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryReplicas_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_search" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_search" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_search" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryReplicas_search" "', argument " "4"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryReplicas_search" "', argument " "5"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryReplicas_search" "', argument " "6"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->search(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_own_fields_set" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_own_fields_get" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_count",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_count" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->count(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryReplicas_at__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryReplicas_at__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryReplicas_at'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexReplicasTemplate< faiss::IndexBinary >::at(int)\n" - " faiss::IndexReplicasTemplate< faiss::IndexBinary >::at(int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexBinaryReplicas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIDMap_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_index_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_index_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_own_fields_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_own_fields_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_id_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_id_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_id_map_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_id_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->id_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_id_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_id_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_id_map_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (std::vector< long > *)& ((arg1)->id_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIDMap *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexIDMap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIDMap" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap *)new faiss::IndexIDMap(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIDMap_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIDMap_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_add" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIDMap_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_search" "', argument " "1"" of type '" "faiss::IndexIDMap const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIDMap_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIDMap_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIDMap_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_train" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_reset" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_remove_ids" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIDMap_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_range_search" "', argument " "1"" of type '" "faiss::IndexIDMap const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIDMap_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIDMap_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIDMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIDMap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIDMap" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIDMap")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap *)new faiss::IndexIDMap(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIDMap__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexIDMap__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIDMap'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIDMap::IndexIDMap(faiss::Index *)\n" - " faiss::IndexIDMap::IndexIDMap()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIDMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIDMap, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIDMap2_rev_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap2_rev_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_rev_map_set" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_mapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap2_rev_map_set" "', argument " "2"" of type '" "std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap2_rev_map_set" "', argument " "2"" of type '" "std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } else { - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > * temp = reinterpret_cast< std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->rev_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_rev_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap2_rev_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_rev_map_get" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - result = ((arg1)->rev_map); - resultobj = SWIG_NewPointerObj((new std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >(static_cast< const std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >& >(result))), SWIGTYPE_p_std__unordered_mapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIDMap2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexIDMap2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIDMap2" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap2 *)new faiss::IndexIDMap2(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_construct_rev_map(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap2_construct_rev_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_construct_rev_map" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->construct_rev_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIDMap2_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap2_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap2_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIDMap2_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap2_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_remove_ids" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap2_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap2_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap2_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_reconstruct" "', argument " "1"" of type '" "faiss::IndexIDMap2 const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap2_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap2_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap2 const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIDMap2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIDMap2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIDMap2" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIDMap2")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap2 *)new faiss::IndexIDMap2(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIDMap2__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexIDMap2__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIDMap2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIDMap2::IndexIDMap2(faiss::Index *)\n" - " faiss::IndexIDMap2::IndexIDMap2()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIDMap2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIDMap2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_own_fields_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_own_fields_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_threaded_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_threaded_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sub_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_sub_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sub_indexes_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexSplitVectors_sub_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->sub_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sub_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sub_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sub_indexes_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->sub_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sum_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_sum_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sum_d_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_sum_d_set" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - if (arg1) (arg1)->sum_d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sum_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sum_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sum_d_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (faiss::Index::idx_t) ((arg1)->sum_d); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexSplitVectors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexSplitVectors",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexSplitVectors" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexSplitVectors" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexSplitVectors *)new faiss::IndexSplitVectors(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexSplitVectors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexSplitVectors",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexSplitVectors" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexSplitVectors *)new faiss::IndexSplitVectors(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexSplitVectors__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexSplitVectors__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexSplitVectors'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexSplitVectors::IndexSplitVectors(faiss::Index::idx_t,bool)\n" - " faiss::IndexSplitVectors::IndexSplitVectors(faiss::Index::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_add_sub_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_add_sub_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_add_sub_index" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexSplitVectors_add_sub_index" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_sub_index(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sync_with_sub_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sync_with_sub_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sync_with_sub_indexes" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_sub_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexSplitVectors_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_add" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexSplitVectors_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_search" "', argument " "1"" of type '" "faiss::IndexSplitVectors const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexSplitVectors_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexSplitVectors_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexSplitVectors_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexSplitVectors const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexSplitVectors_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_train" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_reset" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexSplitVectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexSplitVectors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexSplitVectors" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexSplitVectors_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuClonerOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuClonerOptions")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuClonerOptions *)new faiss::gpu::GpuClonerOptions(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuClonerOptions, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_indicesOptions_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - faiss::gpu::IndicesOptions arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_indicesOptions_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_indicesOptions_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_indicesOptions_set" "', argument " "2"" of type '" "faiss::gpu::IndicesOptions""'"); - } - arg2 = static_cast< faiss::gpu::IndicesOptions >(val2); - if (arg1) (arg1)->indicesOptions = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_indicesOptions_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::IndicesOptions result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_indicesOptions_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_indicesOptions_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (faiss::gpu::IndicesOptions) ((arg1)->indicesOptions); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_useFloat16CoarseQuantizer_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_useFloat16CoarseQuantizer_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_useFloat16CoarseQuantizer_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_useFloat16CoarseQuantizer_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16CoarseQuantizer = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_useFloat16CoarseQuantizer_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_useFloat16CoarseQuantizer_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_useFloat16CoarseQuantizer_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (bool) ((arg1)->useFloat16CoarseQuantizer); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_useFloat16_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_useFloat16_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_useFloat16_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_useFloat16_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_useFloat16_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_useFloat16_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_useFloat16_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (bool) ((arg1)->useFloat16); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_usePrecomputed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_usePrecomputed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_usePrecomputed_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_usePrecomputed_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->usePrecomputed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_usePrecomputed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_usePrecomputed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_usePrecomputed_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (bool) ((arg1)->usePrecomputed); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_reserveVecs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_reserveVecs_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_reserveVecs_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_reserveVecs_set" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - if (arg1) (arg1)->reserveVecs = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_reserveVecs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_reserveVecs_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_reserveVecs_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (long) ((arg1)->reserveVecs); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_storeTransposed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_storeTransposed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_storeTransposed_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_storeTransposed_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->storeTransposed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_storeTransposed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_storeTransposed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_storeTransposed_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (bool) ((arg1)->storeTransposed); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuClonerOptions_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_verbose_set" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuClonerOptions_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuClonerOptions_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuClonerOptions_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuClonerOptions_verbose_get" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuClonerOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuClonerOptions *arg1 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuClonerOptions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuClonerOptions" "', argument " "1"" of type '" "faiss::gpu::GpuClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuClonerOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuClonerOptions, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuMultipleClonerOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuMultipleClonerOptions")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuMultipleClonerOptions *)new faiss::gpu::GpuMultipleClonerOptions(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuMultipleClonerOptions_shard_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *arg1 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuMultipleClonerOptions_shard_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuMultipleClonerOptions_shard_set" "', argument " "1"" of type '" "faiss::gpu::GpuMultipleClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuMultipleClonerOptions_shard_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->shard = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuMultipleClonerOptions_shard_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *arg1 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuMultipleClonerOptions_shard_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuMultipleClonerOptions_shard_get" "', argument " "1"" of type '" "faiss::gpu::GpuMultipleClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp1); - result = (bool) ((arg1)->shard); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuMultipleClonerOptions_shard_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *arg1 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuMultipleClonerOptions_shard_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuMultipleClonerOptions_shard_type_set" "', argument " "1"" of type '" "faiss::gpu::GpuMultipleClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuMultipleClonerOptions_shard_type_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->shard_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuMultipleClonerOptions_shard_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *arg1 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuMultipleClonerOptions_shard_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuMultipleClonerOptions_shard_type_get" "', argument " "1"" of type '" "faiss::gpu::GpuMultipleClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp1); - result = (int) ((arg1)->shard_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuMultipleClonerOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuMultipleClonerOptions *arg1 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuMultipleClonerOptions",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuMultipleClonerOptions" "', argument " "1"" of type '" "faiss::gpu::GpuMultipleClonerOptions *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuMultipleClonerOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_allocMemorySpaceV(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::MemorySpace arg1 ; - void **arg2 = (void **) 0 ; - size_t arg3 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:allocMemorySpaceV",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "allocMemorySpaceV" "', argument " "1"" of type '" "faiss::gpu::MemorySpace""'"); - } - arg1 = static_cast< faiss::gpu::MemorySpace >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_void, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "allocMemorySpaceV" "', argument " "2"" of type '" "void **""'"); - } - arg2 = reinterpret_cast< void ** >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "allocMemorySpaceV" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::gpu::allocMemorySpaceV(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_freeMemorySpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::MemorySpace arg1 ; - void *arg2 = (void *) 0 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:freeMemorySpace",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "freeMemorySpace" "', argument " "1"" of type '" "faiss::gpu::MemorySpace""'"); - } - arg1 = static_cast< faiss::gpu::MemorySpace >(val1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "freeMemorySpace" "', argument " "2"" of type '" "void *""'"); - } - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::gpu::freeMemorySpace(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexConfig")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexConfig *)new faiss::gpu::GpuIndexConfig(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexConfig_device_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *arg1 = (faiss::gpu::GpuIndexConfig *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexConfig_device_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexConfig_device_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexConfig * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexConfig_device_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->device = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexConfig_device_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *arg1 = (faiss::gpu::GpuIndexConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexConfig_device_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexConfig_device_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexConfig * >(argp1); - result = (int) ((arg1)->device); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexConfig_memorySpace_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *arg1 = (faiss::gpu::GpuIndexConfig *) 0 ; - faiss::gpu::MemorySpace arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexConfig_memorySpace_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexConfig_memorySpace_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexConfig * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexConfig_memorySpace_set" "', argument " "2"" of type '" "faiss::gpu::MemorySpace""'"); - } - arg2 = static_cast< faiss::gpu::MemorySpace >(val2); - if (arg1) (arg1)->memorySpace = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexConfig_memorySpace_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *arg1 = (faiss::gpu::GpuIndexConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::MemorySpace result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexConfig_memorySpace_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexConfig_memorySpace_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexConfig * >(argp1); - result = (faiss::gpu::MemorySpace) ((arg1)->memorySpace); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexConfig *arg1 = (faiss::gpu::GpuIndexConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GpuIndex_getDevice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndex_getDevice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_getDevice" "', argument " "1"" of type '" "faiss::gpu::GpuIndex const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndex const *)arg1)->getDevice(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_getResources(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::GpuResources *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndex_getResources",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_getResources" "', argument " "1"" of type '" "faiss::gpu::GpuIndex *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuResources *)(arg1)->getResources(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_setMinPagingSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndex_setMinPagingSize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_setMinPagingSize" "', argument " "1"" of type '" "faiss::gpu::GpuIndex *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndex_setMinPagingSize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setMinPagingSize(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_getMinPagingSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndex_getMinPagingSize",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_getMinPagingSize" "', argument " "1"" of type '" "faiss::gpu::GpuIndex const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::gpu::GpuIndex const *)arg1)->getMinPagingSize(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndex_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_add" "', argument " "1"" of type '" "faiss::gpu::GpuIndex *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndex_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndex_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:GpuIndex_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_add_with_ids" "', argument " "1"" of type '" "faiss::gpu::GpuIndex *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndex_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndex_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "GpuIndex_add_with_ids" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndex_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:GpuIndex_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndex_search" "', argument " "1"" of type '" "faiss::gpu::GpuIndex const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndex_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndex_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GpuIndex_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "GpuIndex_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "GpuIndex_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndex const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndex *arg1 = (faiss::gpu::GpuIndex *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndex",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndex, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndex" "', argument " "1"" of type '" "faiss::gpu::GpuIndex *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndex * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndex_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndex, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexFlatConfig")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatConfig *)new faiss::gpu::GpuIndexFlatConfig(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_useFloat16_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatConfig_useFloat16_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_useFloat16_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlatConfig_useFloat16_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_useFloat16_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlatConfig_useFloat16_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_useFloat16_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - result = (bool) ((arg1)->useFloat16); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_useFloat16Accumulator_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatConfig_useFloat16Accumulator_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_useFloat16Accumulator_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlatConfig_useFloat16Accumulator_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16Accumulator = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_useFloat16Accumulator_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlatConfig_useFloat16Accumulator_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_useFloat16Accumulator_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - result = (bool) ((arg1)->useFloat16Accumulator); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_storeTransposed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatConfig_storeTransposed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_storeTransposed_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlatConfig_storeTransposed_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->storeTransposed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatConfig_storeTransposed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlatConfig_storeTransposed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatConfig_storeTransposed_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - result = (bool) ((arg1)->storeTransposed); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatConfig *arg1 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexFlatConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexFlatConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexFlatConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - faiss::gpu::GpuIndexFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlat" "', argument " "2"" of type '" "faiss::IndexFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlat *)new faiss::gpu::GpuIndexFlat(arg1,(faiss::IndexFlat const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexFlat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlat" "', argument " "2"" of type '" "faiss::IndexFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlat *)new faiss::gpu::GpuIndexFlat(arg1,(faiss::IndexFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::MetricType arg3 ; - faiss::gpu::GpuIndexFlatConfig arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::gpu::GpuIndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_GpuIndexFlat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexFlat" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_GpuIndexFlat" "', argument " "4"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp4) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlat" "', argument " "4"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp4); - arg4 = *temp; - if (SWIG_IsNewObj(res4)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlat *)new faiss::gpu::GpuIndexFlat(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlat__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::MetricType arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexFlat" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlat *)new faiss::gpu::GpuIndexFlat(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlat__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlat__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexFlat__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[3], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlat__SWIG_2(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexFlat::GpuIndexFlat(faiss::gpu::GpuResources *,faiss::IndexFlat const *,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlat::GpuIndexFlat(faiss::gpu::GpuResources *,faiss::IndexFlat const *)\n" - " faiss::gpu::GpuIndexFlat::GpuIndexFlat(faiss::gpu::GpuResources *,int,faiss::MetricType,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlat::GpuIndexFlat(faiss::gpu::GpuResources *,int,faiss::MetricType)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexFlat" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlat_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlat_copyFrom" "', argument " "2"" of type '" "faiss::IndexFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom((faiss::IndexFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlat_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlat_copyTo" "', argument " "2"" of type '" "faiss::IndexFlat *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexFlat const *)arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_getNumVecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlat_getNumVecs",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_getNumVecs" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::gpu::GpuIndexFlat const *)arg1)->getNumVecs(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_reset" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexFlat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_train" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlat_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexFlat_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_add" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexFlat_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_reconstruct" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlat_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexFlat_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:GpuIndexFlat_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_reconstruct_n" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlat_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GpuIndexFlat_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "GpuIndexFlat_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexFlat const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlat_getGpuData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::FlatIndex *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexFlat_getGpuData",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlat_getGpuData" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::FlatIndex *)(arg1)->getGpuData(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__FlatIndex, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatL2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlatL2 *arg2 = (faiss::IndexFlatL2 *) 0 ; - faiss::gpu::GpuIndexFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlatL2",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatL2" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlatL2" "', argument " "2"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatL2 * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexFlatL2" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlatL2" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatL2 *)new faiss::gpu::GpuIndexFlatL2(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatL2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlatL2 *arg2 = (faiss::IndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexFlatL2",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatL2" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlatL2" "', argument " "2"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatL2 * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatL2 *)new faiss::gpu::GpuIndexFlatL2(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatL2__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::gpu::GpuIndexFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlatL2",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatL2" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlatL2" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexFlatL2" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlatL2" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatL2 *)new faiss::gpu::GpuIndexFlatL2(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatL2__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexFlatL2",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatL2" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlatL2" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatL2 *)new faiss::gpu::GpuIndexFlatL2(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatL2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlatL2, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatL2__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexFlatL2__SWIG_3(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlatL2, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatL2__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatL2__SWIG_2(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexFlatL2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2(faiss::gpu::GpuResources *,faiss::IndexFlatL2 *,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2(faiss::gpu::GpuResources *,faiss::IndexFlatL2 *)\n" - " faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2(faiss::gpu::GpuResources *,int,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2(faiss::gpu::GpuResources *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatL2_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatL2 *arg1 = (faiss::gpu::GpuIndexFlatL2 *) 0 ; - faiss::IndexFlatL2 *arg2 = (faiss::IndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatL2_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatL2_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatL2 *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatL2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlatL2_copyFrom" "', argument " "2"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatL2 * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatL2_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatL2 *arg1 = (faiss::gpu::GpuIndexFlatL2 *) 0 ; - faiss::IndexFlatL2 *arg2 = (faiss::IndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatL2_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatL2_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatL2 *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatL2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatL2, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlatL2_copyTo" "', argument " "2"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatL2 * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexFlatL2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatL2 *arg1 = (faiss::gpu::GpuIndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexFlatL2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexFlatL2" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatL2 *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatL2 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexFlatL2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatIP__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlatIP *arg2 = (faiss::IndexFlatIP *) 0 ; - faiss::gpu::GpuIndexFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlatIP",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatIP" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlatIP" "', argument " "2"" of type '" "faiss::IndexFlatIP *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatIP * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexFlatIP" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlatIP" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatIP *)new faiss::gpu::GpuIndexFlatIP(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatIP__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexFlatIP *arg2 = (faiss::IndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexFlatIP",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatIP" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexFlatIP" "', argument " "2"" of type '" "faiss::IndexFlatIP *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatIP * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatIP *)new faiss::gpu::GpuIndexFlatIP(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatIP__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::gpu::GpuIndexFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexFlatIP",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatIP" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlatIP" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexFlatIP" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexFlatIP" "', argument " "3"" of type '" "faiss::gpu::GpuIndexFlatConfig""'"); - } else { - faiss::gpu::GpuIndexFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatIP *)new faiss::gpu::GpuIndexFlatIP(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatIP__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexFlatIP",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexFlatIP" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexFlatIP" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlatIP *)new faiss::gpu::GpuIndexFlatIP(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexFlatIP(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlatIP, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatIP__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexFlatIP__SWIG_3(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexFlatIP, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatIP__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexFlatIP__SWIG_2(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexFlatIP'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexFlatIP::GpuIndexFlatIP(faiss::gpu::GpuResources *,faiss::IndexFlatIP *,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlatIP::GpuIndexFlatIP(faiss::gpu::GpuResources *,faiss::IndexFlatIP *)\n" - " faiss::gpu::GpuIndexFlatIP::GpuIndexFlatIP(faiss::gpu::GpuResources *,int,faiss::gpu::GpuIndexFlatConfig)\n" - " faiss::gpu::GpuIndexFlatIP::GpuIndexFlatIP(faiss::gpu::GpuResources *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatIP_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatIP *arg1 = (faiss::gpu::GpuIndexFlatIP *) 0 ; - faiss::IndexFlatIP *arg2 = (faiss::IndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatIP_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatIP_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatIP *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatIP * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlatIP_copyFrom" "', argument " "2"" of type '" "faiss::IndexFlatIP *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatIP * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexFlatIP_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatIP *arg1 = (faiss::gpu::GpuIndexFlatIP *) 0 ; - faiss::IndexFlatIP *arg2 = (faiss::IndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexFlatIP_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexFlatIP_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatIP *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatIP * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlatIP, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexFlatIP_copyTo" "', argument " "2"" of type '" "faiss::IndexFlatIP *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlatIP * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexFlatIP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexFlatIP *arg1 = (faiss::gpu::GpuIndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexFlatIP",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexFlatIP" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlatIP *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlatIP * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexFlatIP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexIVFConfig")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFConfig *)new faiss::gpu::GpuIndexIVFConfig(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFConfig_indicesOptions_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *arg1 = (faiss::gpu::GpuIndexIVFConfig *) 0 ; - faiss::gpu::IndicesOptions arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFConfig_indicesOptions_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFConfig_indicesOptions_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFConfig * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFConfig_indicesOptions_set" "', argument " "2"" of type '" "faiss::gpu::IndicesOptions""'"); - } - arg2 = static_cast< faiss::gpu::IndicesOptions >(val2); - if (arg1) (arg1)->indicesOptions = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFConfig_indicesOptions_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *arg1 = (faiss::gpu::GpuIndexIVFConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::IndicesOptions result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFConfig_indicesOptions_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFConfig_indicesOptions_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFConfig * >(argp1); - result = (faiss::gpu::IndicesOptions) ((arg1)->indicesOptions); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFConfig_flatConfig_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *arg1 = (faiss::gpu::GpuIndexIVFConfig *) 0 ; - faiss::gpu::GpuIndexFlatConfig *arg2 = (faiss::gpu::GpuIndexFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFConfig_flatConfig_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFConfig_flatConfig_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFConfig * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVFConfig_flatConfig_set" "', argument " "2"" of type '" "faiss::gpu::GpuIndexFlatConfig *""'"); - } - arg2 = reinterpret_cast< faiss::gpu::GpuIndexFlatConfig * >(argp2); - if (arg1) (arg1)->flatConfig = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFConfig_flatConfig_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *arg1 = (faiss::gpu::GpuIndexIVFConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::GpuIndexFlatConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFConfig_flatConfig_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFConfig_flatConfig_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFConfig * >(argp1); - result = (faiss::gpu::GpuIndexFlatConfig *)& ((arg1)->flatConfig); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVFConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFConfig *arg1 = (faiss::gpu::GpuIndexIVFConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVFConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVFConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVFConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVF",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVF" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - faiss::IndexIVF *arg2 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVF_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVF_copyFrom" "', argument " "2"" of type '" "faiss::IndexIVF const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom((faiss::IndexIVF const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - faiss::IndexIVF *arg2 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVF_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVF_copyTo" "', argument " "2"" of type '" "faiss::IndexIVF *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexIVF const *)arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_getNumLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVF_getNumLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_getNumLists" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVF const *)arg1)->getNumLists(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_getQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::gpu::GpuIndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVF_getQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_getQuantizer" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexFlat *)(arg1)->getQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexFlat, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_setNumProbes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVF_setNumProbes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_setNumProbes" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVF_setNumProbes" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setNumProbes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_getNumProbes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVF_getNumProbes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_getNumProbes" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVF const *)arg1)->getNumProbes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVF_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_cp_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVF_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVF_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVF_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVF_cp_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVF_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVF, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexIVFPQConfig")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFPQConfig *)new faiss::gpu::GpuIndexIVFPQConfig(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQConfig_useFloat16LookupTables_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *arg1 = (faiss::gpu::GpuIndexIVFPQConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQConfig_useFloat16LookupTables_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQConfig_useFloat16LookupTables_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQConfig_useFloat16LookupTables_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16LookupTables = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQConfig_useFloat16LookupTables_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *arg1 = (faiss::gpu::GpuIndexIVFPQConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQConfig_useFloat16LookupTables_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQConfig_useFloat16LookupTables_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp1); - result = (bool) ((arg1)->useFloat16LookupTables); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQConfig_usePrecomputedTables_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *arg1 = (faiss::gpu::GpuIndexIVFPQConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQConfig_usePrecomputedTables_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQConfig_usePrecomputedTables_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQConfig_usePrecomputedTables_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->usePrecomputedTables = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQConfig_usePrecomputedTables_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *arg1 = (faiss::gpu::GpuIndexIVFPQConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQConfig_usePrecomputedTables_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQConfig_usePrecomputedTables_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp1); - result = (bool) ((arg1)->usePrecomputedTables); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVFPQConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQConfig *arg1 = (faiss::gpu::GpuIndexIVFPQConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVFPQConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVFPQConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVFPQConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexIVFPQ *arg2 = (faiss::IndexIVFPQ *) 0 ; - faiss::gpu::GpuIndexIVFPQConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexIVFPQ",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFPQ" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexIVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexIVFPQ" "', argument " "3"" of type '" "faiss::gpu::GpuIndexIVFPQConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexIVFPQ" "', argument " "3"" of type '" "faiss::gpu::GpuIndexIVFPQConfig""'"); - } else { - faiss::gpu::GpuIndexIVFPQConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFPQ *)new faiss::gpu::GpuIndexIVFPQ(arg1,(faiss::IndexIVFPQ const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexIVFPQ *arg2 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexIVFPQ",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFPQ" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexIVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFPQ *)new faiss::gpu::GpuIndexIVFPQ(arg1,(faiss::IndexIVFPQ const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQ__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - int arg3 ; - int arg4 ; - int arg5 ; - faiss::MetricType arg6 ; - faiss::gpu::GpuIndexIVFPQConfig arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - void *argp7 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - faiss::gpu::GpuIndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_GpuIndexIVFPQ",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFPQ" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexIVFPQ" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexIVFPQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GpuIndexIVFPQ" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_GpuIndexIVFPQ" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_GpuIndexIVFPQ" "', argument " "6"" of type '" "faiss::MetricType""'"); - } - arg6 = static_cast< faiss::MetricType >(val6); - { - res7 = SWIG_ConvertPtr(obj6, &argp7, SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0 | 0); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_GpuIndexIVFPQ" "', argument " "7"" of type '" "faiss::gpu::GpuIndexIVFPQConfig""'"); - } - if (!argp7) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexIVFPQ" "', argument " "7"" of type '" "faiss::gpu::GpuIndexIVFPQConfig""'"); - } else { - faiss::gpu::GpuIndexIVFPQConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexIVFPQConfig * >(argp7); - arg7 = *temp; - if (SWIG_IsNewObj(res7)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFPQ *)new faiss::gpu::GpuIndexIVFPQ(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQ__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - int arg3 ; - int arg4 ; - int arg5 ; - faiss::MetricType arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - faiss::gpu::GpuIndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_GpuIndexIVFPQ",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFPQ" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexIVFPQ" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexIVFPQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GpuIndexIVFPQ" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_GpuIndexIVFPQ" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_GpuIndexIVFPQ" "', argument " "6"" of type '" "faiss::MetricType""'"); - } - arg6 = static_cast< faiss::MetricType >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFPQ *)new faiss::gpu::GpuIndexIVFPQ(arg1,arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFPQ__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFPQ__SWIG_0(self, args); - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexIVFPQ__SWIG_3(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFPQ__SWIG_2(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexIVFPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexIVFPQ::GpuIndexIVFPQ(faiss::gpu::GpuResources *,faiss::IndexIVFPQ const *,faiss::gpu::GpuIndexIVFPQConfig)\n" - " faiss::gpu::GpuIndexIVFPQ::GpuIndexIVFPQ(faiss::gpu::GpuResources *,faiss::IndexIVFPQ const *)\n" - " faiss::gpu::GpuIndexIVFPQ::GpuIndexIVFPQ(faiss::gpu::GpuResources *,int,int,int,int,faiss::MetricType,faiss::gpu::GpuIndexIVFPQConfig)\n" - " faiss::gpu::GpuIndexIVFPQ::GpuIndexIVFPQ(faiss::gpu::GpuResources *,int,int,int,int,faiss::MetricType)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVFPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVFPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVFPQ" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - faiss::IndexIVFPQ *arg2 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVFPQ_copyFrom" "', argument " "2"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom((faiss::IndexIVFPQ const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - faiss::IndexIVFPQ *arg2 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVFPQ_copyTo" "', argument " "2"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexIVFPQ const *)arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_reserveMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_reserveMemory",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_reserveMemory" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_reserveMemory" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reserveMemory(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_setPrecomputedCodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_setPrecomputedCodes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_setPrecomputedCodes" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_setPrecomputedCodes" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->setPrecomputedCodes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getPrecomputedCodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_getPrecomputedCodes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getPrecomputedCodes" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getPrecomputedCodes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getNumSubQuantizers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_getNumSubQuantizers",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getNumSubQuantizers" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getNumSubQuantizers(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getBitsPerCode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_getBitsPerCode",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getBitsPerCode" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getBitsPerCode(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getCentroidsPerSubQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_getCentroidsPerSubQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getCentroidsPerSubQuantizer" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getCentroidsPerSubQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_reclaimMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_reclaimMemory",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_reclaimMemory" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->reclaimMemory(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFPQ_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_reset" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexIVFPQ_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_train" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexIVFPQ_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getListLength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_getListLength",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getListLength" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_getListLength" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getListLength(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getListCodes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< unsigned char > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_getListCodes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getListCodes" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_getListCodes" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getListCodes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::vector< unsigned char >(static_cast< const std::vector< unsigned char >& >(result))), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFPQ_getListIndices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFPQ *arg1 = (faiss::gpu::GpuIndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< long > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFPQ_getListIndices",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFPQ_getListIndices" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFPQ_getListIndices" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::gpu::GpuIndexIVFPQ const *)arg1)->getListIndices(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::vector< long >(static_cast< const std::vector< long >& >(result))), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVFPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlatConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexIVFFlatConfig")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFFlatConfig *)new faiss::gpu::GpuIndexIVFFlatConfig(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlatConfig_useFloat16IVFStorage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlatConfig *arg1 = (faiss::gpu::GpuIndexIVFFlatConfig *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFFlatConfig_useFloat16IVFStorage_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlatConfig_useFloat16IVFStorage_set" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlatConfig * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFFlatConfig_useFloat16IVFStorage_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->useFloat16IVFStorage = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlatConfig_useFloat16IVFStorage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlatConfig *arg1 = (faiss::gpu::GpuIndexIVFFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFFlatConfig_useFloat16IVFStorage_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlatConfig_useFloat16IVFStorage_get" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlatConfig * >(argp1); - result = (bool) ((arg1)->useFloat16IVFStorage); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVFFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlatConfig *arg1 = (faiss::gpu::GpuIndexIVFFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVFFlatConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVFFlatConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlatConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVFFlatConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexIVFFlat *arg2 = (faiss::IndexIVFFlat *) 0 ; - faiss::gpu::GpuIndexIVFFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexIVFFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexIVFFlat" "', argument " "2"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFFlat * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexIVFFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexIVFFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig""'"); - } else { - faiss::gpu::GpuIndexIVFFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexIVFFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFFlat *)new faiss::gpu::GpuIndexIVFFlat(arg1,(faiss::IndexIVFFlat const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexIVFFlat *arg2 = (faiss::IndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexIVFFlat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexIVFFlat" "', argument " "2"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFFlat *)new faiss::gpu::GpuIndexIVFFlat(arg1,(faiss::IndexIVFFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - int arg3 ; - faiss::MetricType arg4 ; - faiss::gpu::GpuIndexIVFFlatConfig arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - faiss::gpu::GpuIndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_GpuIndexIVFFlat",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexIVFFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexIVFFlat" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GpuIndexIVFFlat" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0 | 0); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_GpuIndexIVFFlat" "', argument " "5"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig""'"); - } - if (!argp5) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexIVFFlat" "', argument " "5"" of type '" "faiss::gpu::GpuIndexIVFFlatConfig""'"); - } else { - faiss::gpu::GpuIndexIVFFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexIVFFlatConfig * >(argp5); - arg5 = *temp; - if (SWIG_IsNewObj(res5)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFFlat *)new faiss::gpu::GpuIndexIVFFlat(arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlat__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - int arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::gpu::GpuIndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_GpuIndexIVFFlat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexIVFFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexIVFFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GpuIndexIVFFlat" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GpuIndexIVFFlat" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexIVFFlat *)new faiss::gpu::GpuIndexIVFFlat(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexIVFFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexIVFFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFFlat__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexIVFFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFFlat__SWIG_0(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexIVFFlat__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexIVFFlat__SWIG_2(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexIVFFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexIVFFlat::GpuIndexIVFFlat(faiss::gpu::GpuResources *,faiss::IndexIVFFlat const *,faiss::gpu::GpuIndexIVFFlatConfig)\n" - " faiss::gpu::GpuIndexIVFFlat::GpuIndexIVFFlat(faiss::gpu::GpuResources *,faiss::IndexIVFFlat const *)\n" - " faiss::gpu::GpuIndexIVFFlat::GpuIndexIVFFlat(faiss::gpu::GpuResources *,int,int,faiss::MetricType,faiss::gpu::GpuIndexIVFFlatConfig)\n" - " faiss::gpu::GpuIndexIVFFlat::GpuIndexIVFFlat(faiss::gpu::GpuResources *,int,int,faiss::MetricType)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexIVFFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexIVFFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexIVFFlat" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_reserveMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFFlat_reserveMemory",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_reserveMemory" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFFlat_reserveMemory" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reserveMemory(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - faiss::IndexIVFFlat *arg2 = (faiss::IndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFFlat_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVFFlat_copyFrom" "', argument " "2"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom((faiss::IndexIVFFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - faiss::IndexIVFFlat *arg2 = (faiss::IndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexIVFFlat_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexIVFFlat_copyTo" "', argument " "2"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexIVFFlat const *)arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_reclaimMemory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFFlat_reclaimMemory",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_reclaimMemory" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->reclaimMemory(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexIVFFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_reset" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexIVFFlat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexIVFFlat *arg1 = (faiss::gpu::GpuIndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexIVFFlat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexIVFFlat_train" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVFFlat_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexIVFFlat_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexIVFFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlatConfig *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuIndexBinaryFlatConfig")) SWIG_fail; - result = (faiss::gpu::GpuIndexBinaryFlatConfig *)new faiss::gpu::GpuIndexBinaryFlatConfig(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexBinaryFlatConfig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlatConfig *arg1 = (faiss::gpu::GpuIndexBinaryFlatConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexBinaryFlatConfig",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexBinaryFlatConfig" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlatConfig *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlatConfig * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexBinaryFlatConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexBinaryFlat *arg2 = (faiss::IndexBinaryFlat *) 0 ; - faiss::gpu::GpuIndexBinaryFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexBinaryFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexBinaryFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexBinaryFlat" "', argument " "2"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexBinaryFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexBinaryFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexBinaryFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexBinaryFlatConfig""'"); - } else { - faiss::gpu::GpuIndexBinaryFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexBinaryFlat *)new faiss::gpu::GpuIndexBinaryFlat(arg1,(faiss::IndexBinaryFlat const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::IndexBinaryFlat *arg2 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexBinaryFlat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexBinaryFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_GpuIndexBinaryFlat" "', argument " "2"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexBinaryFlat *)new faiss::gpu::GpuIndexBinaryFlat(arg1,(faiss::IndexBinaryFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::gpu::GpuIndexBinaryFlatConfig arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::gpu::GpuIndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_GpuIndexBinaryFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexBinaryFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexBinaryFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_GpuIndexBinaryFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexBinaryFlatConfig""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GpuIndexBinaryFlat" "', argument " "3"" of type '" "faiss::gpu::GpuIndexBinaryFlatConfig""'"); - } else { - faiss::gpu::GpuIndexBinaryFlatConfig * temp = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlatConfig * >(argp3); - arg3 = *temp; - if (SWIG_IsNewObj(res3)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexBinaryFlat *)new faiss::gpu::GpuIndexBinaryFlat(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlat__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::gpu::GpuIndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GpuIndexBinaryFlat",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GpuIndexBinaryFlat" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GpuIndexBinaryFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::gpu::GpuIndexBinaryFlat *)new faiss::gpu::GpuIndexBinaryFlat(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuIndexBinaryFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexBinaryFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexBinaryFlat__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GpuIndexBinaryFlat__SWIG_3(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IndexBinaryFlat, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexBinaryFlat__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_GpuIndexBinaryFlat__SWIG_2(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GpuIndexBinaryFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::GpuIndexBinaryFlat::GpuIndexBinaryFlat(faiss::gpu::GpuResources *,faiss::IndexBinaryFlat const *,faiss::gpu::GpuIndexBinaryFlatConfig)\n" - " faiss::gpu::GpuIndexBinaryFlat::GpuIndexBinaryFlat(faiss::gpu::GpuResources *,faiss::IndexBinaryFlat const *)\n" - " faiss::gpu::GpuIndexBinaryFlat::GpuIndexBinaryFlat(faiss::gpu::GpuResources *,int,faiss::gpu::GpuIndexBinaryFlatConfig)\n" - " faiss::gpu::GpuIndexBinaryFlat::GpuIndexBinaryFlat(faiss::gpu::GpuResources *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuIndexBinaryFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuIndexBinaryFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuIndexBinaryFlat" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_copyFrom(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - faiss::IndexBinaryFlat *arg2 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexBinaryFlat_copyFrom",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_copyFrom" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexBinaryFlat_copyFrom" "', argument " "2"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copyFrom((faiss::IndexBinaryFlat const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_copyTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - faiss::IndexBinaryFlat *arg2 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuIndexBinaryFlat_copyTo",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_copyTo" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuIndexBinaryFlat_copyTo" "', argument " "2"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexBinaryFlat const *)arg1)->copyTo(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexBinaryFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_add" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexBinaryFlat_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexBinaryFlat_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GpuIndexBinaryFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_reset" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:GpuIndexBinaryFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_search" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexBinaryFlat_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexBinaryFlat_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GpuIndexBinaryFlat_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "GpuIndexBinaryFlat_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "GpuIndexBinaryFlat_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexBinaryFlat const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuIndexBinaryFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuIndexBinaryFlat *arg1 = (faiss::gpu::GpuIndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:GpuIndexBinaryFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuIndexBinaryFlat_reconstruct" "', argument " "1"" of type '" "faiss::gpu::GpuIndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuIndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexBinaryFlat_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuIndexBinaryFlat_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuIndexBinaryFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuIndexBinaryFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_bruteForceKnn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - faiss::MetricType arg2 ; - float *arg3 = (float *) 0 ; - int arg4 ; - float *arg5 = (float *) 0 ; - int arg6 ; - int arg7 ; - int arg8 ; - float *arg9 = (float *) 0 ; - faiss::Index::idx_t *arg10 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - int val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; - int val8 ; - int ecode8 = 0 ; - void *argp9 = 0 ; - int res9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bruteForceKnn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bruteForceKnn" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bruteForceKnn" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "bruteForceKnn" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bruteForceKnn" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "bruteForceKnn" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "bruteForceKnn" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "bruteForceKnn" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "bruteForceKnn" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - res9 = SWIG_ConvertPtr(obj8, &argp9,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res9)) { - SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "bruteForceKnn" "', argument " "9"" of type '" "float *""'"); - } - arg9 = reinterpret_cast< float * >(argp9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "bruteForceKnn" "', argument " "10"" of type '" "faiss::Index::idx_t *""'"); - } - arg10 = reinterpret_cast< faiss::Index::idx_t * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::gpu::bruteForceKnn(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8,arg9,arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_downcast_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_index" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)downcast_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,0); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_downcast_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)downcast_VectorTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,0); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_downcast_IndexBinary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_IndexBinary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_IndexBinary" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)downcast_IndexBinary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,0); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,0); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_index'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_index(faiss::Index const *,char const *)\n" - " faiss::write_index(faiss::Index const *,FILE *)\n" - " faiss::write_index(faiss::Index const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_index_binary'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_index_binary(faiss::IndexBinary const *,char const *)\n" - " faiss::write_index_binary(faiss::IndexBinary const *,FILE *)\n" - " faiss::write_index_binary(faiss::IndexBinary const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN int Swig_var_IO_FLAG_MMAP_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_MMAP is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_MMAP_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_MMAP)); - return pyobj; -} - - -SWIGINTERN int Swig_var_IO_FLAG_READ_ONLY_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_READ_ONLY is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_READ_ONLY_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_READ_ONLY)); - return pyobj; -} - - -SWIGINTERN int Swig_var_IO_FLAG_ONDISK_SAME_DIR_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_ONDISK_SAME_DIR is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_ONDISK_SAME_DIR_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_ONDISK_SAME_DIR)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index((char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_3(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_5(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_4(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_index'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_index(char const *,int)\n" - " faiss::read_index(char const *)\n" - " faiss::read_index(FILE *,int)\n" - " faiss::read_index(FILE *)\n" - " faiss::read_index(faiss::IOReader *,int)\n" - " faiss::read_index(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary((char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_3(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_5(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_4(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_index_binary'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_index_binary(char const *,int)\n" - " faiss::read_index_binary(char const *)\n" - " faiss::read_index_binary(FILE *,int)\n" - " faiss::read_index_binary(FILE *)\n" - " faiss::read_index_binary(faiss::IOReader *,int)\n" - " faiss::read_index_binary(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_VectorTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_VectorTransform" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_VectorTransform((faiss::VectorTransform const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_VectorTransform" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)faiss::read_VectorTransform((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_ProductQuantizer" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)faiss::read_ProductQuantizer((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_OWN | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_ProductQuantizer" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)faiss::read_ProductQuantizer(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_ProductQuantizer__SWIG_1(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_ProductQuantizer__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_ProductQuantizer(char const *)\n" - " faiss::read_ProductQuantizer(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_ProductQuantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_ProductQuantizer" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_ProductQuantizer((faiss::ProductQuantizer const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_ProductQuantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_ProductQuantizer" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_ProductQuantizer((faiss::ProductQuantizer const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_ProductQuantizer__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_ProductQuantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_ProductQuantizer(faiss::ProductQuantizer const *,char const *)\n" - " faiss::write_ProductQuantizer(faiss::ProductQuantizer const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_InvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_InvertedLists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_InvertedLists" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_InvertedLists" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_InvertedLists((faiss::InvertedLists const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_InvertedLists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_InvertedLists" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_InvertedLists" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists *)faiss::read_InvertedLists(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_InvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_InvertedLists" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists *)faiss::read_InvertedLists(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_InvertedLists__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_InvertedLists__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_InvertedLists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_InvertedLists(faiss::IOReader *,int)\n" - " faiss::read_InvertedLists(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_clone_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:clone_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "clone_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::clone_index((faiss::Index const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_VectorTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_VectorTransform" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_VectorTransform" "', argument " "2"" of type '" "faiss::VectorTransform const *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)(arg1)->clone_VectorTransform((faiss::VectorTransform const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_Index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_Index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_Index" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_Index" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->clone_Index((faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,0); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_IndexIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::IndexIVF *arg2 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_IndexIVF",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_IndexIVF" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_IndexIVF" "', argument " "2"" of type '" "faiss::IndexIVF const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)(arg1)->clone_IndexIVF((faiss::IndexIVF const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Cloner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Cloner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Cloner" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Cloner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Cloner")) SWIG_fail; - result = (faiss::Cloner *)new faiss::Cloner(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Cloner, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Cloner_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Cloner, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nq_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_nq_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nq_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->nq); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nnn_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_nnn_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nnn_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_nnn_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->nnn = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nnn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_nnn_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nnn_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->nnn); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_nnn_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_nnn_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_nnn_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_gt_nnn_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->gt_nnn = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_nnn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_nnn_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_nnn_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->gt_nnn); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_D_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_D_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_D_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_gt_D_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->gt_D = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_D_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_D_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_D_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (std::vector< float > *)& ((arg1)->gt_D); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_I_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - std::vector< faiss::AutoTuneCriterion::idx_t > *arg2 = (std::vector< faiss::AutoTuneCriterion::idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_I_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_I_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_gt_I_set" "', argument " "2"" of type '" "std::vector< faiss::AutoTuneCriterion::idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::AutoTuneCriterion::idx_t > * >(argp2); - if (arg1) (arg1)->gt_I = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_I_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::AutoTuneCriterion::idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_I_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_I_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (std::vector< faiss::AutoTuneCriterion::idx_t > *)& ((arg1)->gt_I); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_set_groundtruth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg4 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:AutoTuneCriterion_set_groundtruth",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "4"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_groundtruth(arg2,(float const *)arg3,(faiss::AutoTuneCriterion::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:AutoTuneCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_evaluate" "', argument " "1"" of type '" "faiss::AutoTuneCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "AutoTuneCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::AutoTuneCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_AutoTuneCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_AutoTuneCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_AutoTuneCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *AutoTuneCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__AutoTuneCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_R_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OneRecallAtRCriterion_R_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_R_set" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OneRecallAtRCriterion_R_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->R = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_R_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OneRecallAtRCriterion_R_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_R_get" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->R); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OneRecallAtRCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion::idx_t arg1 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OneRecallAtRCriterion *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_OneRecallAtRCriterion",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OneRecallAtRCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg1 = static_cast< faiss::AutoTuneCriterion::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OneRecallAtRCriterion" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OneRecallAtRCriterion *)new faiss::OneRecallAtRCriterion(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OneRecallAtRCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::OneRecallAtRCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OneRecallAtRCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OneRecallAtRCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OneRecallAtRCriterion" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OneRecallAtRCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_R_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntersectionCriterion_R_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_R_set" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntersectionCriterion_R_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->R = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_R_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IntersectionCriterion_R_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_R_get" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->R); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IntersectionCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion::idx_t arg1 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IntersectionCriterion *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IntersectionCriterion",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IntersectionCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg1 = static_cast< faiss::AutoTuneCriterion::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IntersectionCriterion" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IntersectionCriterion *)new faiss::IntersectionCriterion(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IntersectionCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_evaluate" "', argument " "1"" of type '" "faiss::IntersectionCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntersectionCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IntersectionCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::IntersectionCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IntersectionCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IntersectionCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntersectionCriterion" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IntersectionCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OperatingPoint_perf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_perf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_perf_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_perf_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->perf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_perf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_perf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_perf_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (double) ((arg1)->perf); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_t_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_t_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_t_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_t_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->t = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_t_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_t_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_t_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (double) ((arg1)->t); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_key_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_key_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_key_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoint_key_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoint_key_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->key = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_key_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_key_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_key_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (std::string *) & ((arg1)->key); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_cno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_cno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_cno_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_cno_set" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - if (arg1) (arg1)->cno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_cno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_cno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_cno_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (long) ((arg1)->cno); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OperatingPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPoint")) SWIG_fail; - result = (faiss::OperatingPoint *)new faiss::OperatingPoint(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPoint",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPoint" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OperatingPoint, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_pts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_all_pts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_pts_set" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_all_pts_set" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - if (arg1) (arg1)->all_pts = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_pts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_all_pts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_pts_get" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - result = (std::vector< faiss::OperatingPoint > *)& ((arg1)->all_pts); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_pts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_optimal_pts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_pts_set" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_optimal_pts_set" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - if (arg1) (arg1)->optimal_pts = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_pts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_optimal_pts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_pts_get" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - result = (std::vector< faiss::OperatingPoint > *)& ((arg1)->optimal_pts); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OperatingPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPoints")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OperatingPoints *)new faiss::OperatingPoints(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoints, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - faiss::OperatingPoints *arg2 = 0 ; - std::string *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OperatingPoints_merge_with",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_merge_with" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoints, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - arg2 = reinterpret_cast< faiss::OperatingPoints * >(argp2); - { - std::string *ptr = (std::string *)0; - res3 = SWIG_AsPtr_std_string(obj2, &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OperatingPoints_merge_with" "', argument " "3"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "3"" of type '" "std::string const &""'"); - } - arg3 = ptr; - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->merge_with((faiss::OperatingPoints const &)*arg2,(std::string const &)*arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsNewObj(res3)) delete arg3; - return resultobj; -fail: - if (SWIG_IsNewObj(res3)) delete arg3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - faiss::OperatingPoints *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_merge_with",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_merge_with" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoints, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - arg2 = reinterpret_cast< faiss::OperatingPoints * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->merge_with((faiss::OperatingPoints const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_merge_with__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_merge_with__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_merge_with'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::merge_with(faiss::OperatingPoints const &,std::string const &)\n" - " faiss::OperatingPoints::merge_with(faiss::OperatingPoints const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_clear" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->clear(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - double arg3 ; - std::string *arg4 = 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - int res4 = SWIG_OLDOBJ ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:OperatingPoints_add",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_add" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_add" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OperatingPoints_add" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - { - std::string *ptr = (std::string *)0; - res4 = SWIG_AsPtr_std_string(obj3, &ptr); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - arg4 = ptr; - } - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "OperatingPoints_add" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)(arg1)->add(arg2,arg3,(std::string const &)*arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (SWIG_IsNewObj(res4)) delete arg4; - return resultobj; -fail: - if (SWIG_IsNewObj(res4)) delete arg4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - double arg3 ; - std::string *arg4 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - int res4 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:OperatingPoints_add",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_add" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_add" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OperatingPoints_add" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - { - std::string *ptr = (std::string *)0; - res4 = SWIG_AsPtr_std_string(obj3, &ptr); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - arg4 = ptr; - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)(arg1)->add(arg2,arg3,(std::string const &)*arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (SWIG_IsNewObj(res4)) delete arg4; - return resultobj; -fail: - if (SWIG_IsNewObj(res4)) delete arg4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(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_AsPtr_std_string(argv[3], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_add__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(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_AsPtr_std_string(argv[3], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_OperatingPoints_add__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_add'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::add(double,double,std::string const &,size_t)\n" - " faiss::OperatingPoints::add(double,double,std::string const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_t_for_perf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_t_for_perf",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_t_for_perf" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_t_for_perf" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::OperatingPoints const *)arg1)->t_for_perf(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_display",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_display" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_display" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->display(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_display" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_display__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_OperatingPoints_display__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_display'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::display(bool) const\n" - " faiss::OperatingPoints::display() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_to_gnuplot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_all_to_gnuplot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_to_gnuplot" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_all_to_gnuplot" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->all_to_gnuplot((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_to_gnuplot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_optimal_to_gnuplot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_to_gnuplot" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_optimal_to_gnuplot" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->optimal_to_gnuplot((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPoints",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPoints" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPoints_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OperatingPoints, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ParameterRange_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterRange_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_name_set" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterRange_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterRange_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterRange_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_name_get" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_values_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterRange_values_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_values_set" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterRange_values_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->values = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_values_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterRange_values_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_values_get" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - result = (std::vector< double > *)& ((arg1)->values); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ParameterRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ParameterRange")) SWIG_fail; - result = (faiss::ParameterRange *)new faiss::ParameterRange(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterRange, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ParameterRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ParameterRange",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ParameterRange" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ParameterRange_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ParameterRange, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ParameterSpace_parameter_ranges_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - std::vector< faiss::ParameterRange > *arg2 = (std::vector< faiss::ParameterRange > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_parameter_ranges_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_parameter_ranges_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_parameter_ranges_set" "', argument " "2"" of type '" "std::vector< faiss::ParameterRange > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::ParameterRange > * >(argp2); - if (arg1) (arg1)->parameter_ranges = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_parameter_ranges_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::ParameterRange > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_parameter_ranges_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_parameter_ranges_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (std::vector< faiss::ParameterRange > *)& ((arg1)->parameter_ranges); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_verbose_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_verbose_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_verbose_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (int) ((arg1)->verbose); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_experiments_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_n_experiments_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_experiments_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_n_experiments_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_experiments = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_experiments_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_n_experiments_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_experiments_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (int) ((arg1)->n_experiments); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_batchsize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_batchsize_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_batchsize_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_batchsize_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->batchsize = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_batchsize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_batchsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_batchsize_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (size_t) ((arg1)->batchsize); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_thread_over_batches_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_thread_over_batches_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_thread_over_batches_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_thread_over_batches_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->thread_over_batches = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_thread_over_batches_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_thread_over_batches_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_thread_over_batches_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (bool) ((arg1)->thread_over_batches); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_min_test_duration_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_min_test_duration_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_min_test_duration_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_min_test_duration_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->min_test_duration = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_min_test_duration_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_min_test_duration_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_min_test_duration_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (double) ((arg1)->min_test_duration); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ParameterSpace")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ParameterSpace *)new faiss::ParameterSpace(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterSpace, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_combinations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_n_combinations",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_combinations" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ParameterSpace const *)arg1)->n_combinations(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_combination_ge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_combination_ge",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_combination_ge" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_combination_ge" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_combination_ge" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)((faiss::ParameterSpace const *)arg1)->combination_ge(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_combination_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_combination_name",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_combination_name" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_combination_name" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::ParameterSpace const *)arg1)->combination_name(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_display" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_add_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ParameterRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_add_range",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_add_range" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_add_range" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ParameterRange *) &(arg1)->add_range((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_initialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_initialize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_initialize" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_initialize" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->initialize((faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_set_index_parameters",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameters" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameters" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_set_index_parameters" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameters(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_set_index_parameters",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameters" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameters" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_set_index_parameters" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameters(arg2,(char const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ParameterSpace, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ParameterSpace_set_index_parameters__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ParameterSpace, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ParameterSpace_set_index_parameters__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ParameterSpace_set_index_parameters'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ParameterSpace::set_index_parameters(faiss::Index *,size_t) const\n" - " faiss::ParameterSpace::set_index_parameters(faiss::Index *,char const *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - std::string *arg3 = 0 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ParameterSpace_set_index_parameter",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameter" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameter" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - std::string *ptr = (std::string *)0; - res3 = SWIG_AsPtr_std_string(obj2, &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - arg3 = ptr; - } - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ParameterSpace_set_index_parameter" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameter(arg2,(std::string const &)*arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res3)) delete arg3; - return resultobj; -fail: - if (SWIG_IsNewObj(res3)) delete arg3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_update_bounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - faiss::OperatingPoint *arg3 = 0 ; - double *arg4 = (double *) 0 ; - double *arg5 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ParameterSpace_update_bounds",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_update_bounds" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_update_bounds" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__OperatingPoint, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_update_bounds" "', argument " "3"" of type '" "faiss::OperatingPoint const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_update_bounds" "', argument " "3"" of type '" "faiss::OperatingPoint const &""'"); - } - arg3 = reinterpret_cast< faiss::OperatingPoint * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ParameterSpace_update_bounds" "', argument " "4"" of type '" "double *""'"); - } - arg4 = reinterpret_cast< double * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ParameterSpace_update_bounds" "', argument " "5"" of type '" "double *""'"); - } - arg5 = reinterpret_cast< double * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->update_bounds(arg2,(faiss::OperatingPoint const &)*arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_explore(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - faiss::AutoTuneCriterion *arg5 = 0 ; - faiss::OperatingPoints *arg6 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ParameterSpace_explore",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_explore" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_explore" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_explore" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ParameterSpace_explore" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ParameterSpace_explore" "', argument " "5"" of type '" "faiss::AutoTuneCriterion const &""'"); - } - if (!argp5) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_explore" "', argument " "5"" of type '" "faiss::AutoTuneCriterion const &""'"); - } - arg5 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ParameterSpace_explore" "', argument " "6"" of type '" "faiss::OperatingPoints *""'"); - } - arg6 = reinterpret_cast< faiss::OperatingPoints * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->explore(arg2,arg3,(float const *)arg4,(faiss::AutoTuneCriterion const &)*arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ParameterSpace",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ParameterSpace" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ParameterSpace_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ParameterSpace, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_index_factory__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - faiss::MetricType arg3 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:index_factory",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "index_factory" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::index_factory(arg1,(char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_factory__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:index_factory",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::index_factory(arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_factory(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_factory__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_index_factory__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'index_factory'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::index_factory(int,char const *,faiss::MetricType)\n" - " faiss::index_factory(int,char const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_index_binary_factory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:index_binary_factory",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_binary_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_binary_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::index_binary_factory(arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MatrixStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::MatrixStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_MatrixStats",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MatrixStats" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MatrixStats" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_MatrixStats" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MatrixStats *)new faiss::MatrixStats(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MatrixStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_comments_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_comments_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_comments_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_comments_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatrixStats_comments_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->comments = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_comments_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_comments_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_comments_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::string *) & ((arg1)->comments); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_d_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_d_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_collision_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_collision_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_collision_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_collision_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_collision = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_collision_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_collision_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_collision_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n_collision); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_valid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_valid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_valid_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_valid_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_valid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_valid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_valid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_valid_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n_valid); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n0_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n0_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n0_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n0); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_min_norm2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_min_norm2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_min_norm2_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_min_norm2_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->min_norm2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_min_norm2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_min_norm2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_min_norm2_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (double) ((arg1)->min_norm2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_max_norm2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_max_norm2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_max_norm2_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_max_norm2_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->max_norm2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_max_norm2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_max_norm2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_max_norm2_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (double) ((arg1)->max_norm2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_per_dim_stats_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::vector< faiss::MatrixStats::PerDimStats > *arg2 = (std::vector< faiss::MatrixStats::PerDimStats > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_per_dim_stats_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_per_dim_stats_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_per_dim_stats_set" "', argument " "2"" of type '" "std::vector< faiss::MatrixStats::PerDimStats > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::MatrixStats::PerDimStats > * >(argp2); - if (arg1) (arg1)->per_dim_stats = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_per_dim_stats_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::MatrixStats::PerDimStats > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_per_dim_stats_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_per_dim_stats_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::vector< faiss::MatrixStats::PerDimStats > *)& ((arg1)->per_dim_stats); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_occurrences_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *arg2 = (std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_occurrences_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_occurrences_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_occurrences_set" "', argument " "2"" of type '" "std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *""'"); - } - arg2 = reinterpret_cast< std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > * >(argp2); - if (arg1) (arg1)->occurrences = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_occurrences_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_occurrences_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_occurrences_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *)& ((arg1)->occurrences); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_buf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_buf_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_buf_set" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - if (arg1->buf) delete[] arg1->buf; - if (arg2) { - size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1; - arg1->buf = (char *)reinterpret_cast< char* >(memcpy(new char[size], reinterpret_cast< const char * >(arg2), sizeof(char)*(size))); - } else { - arg1->buf = 0; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_buf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_buf_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (char *) ((arg1)->buf); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_nbuf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_nbuf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_nbuf_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_nbuf_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nbuf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_nbuf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_nbuf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_nbuf_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->nbuf); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_do_comment__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - char *arg2 = (char *) 0 ; - void *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_do_comment",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_do_comment" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_do_comment" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->do_comment((char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_do_comment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj; - PyObject *varargs; - PyObject *newargs; - - newargs = PyTuple_GetSlice(args,0,2); - varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)); - resultobj = _wrap_MatrixStats_do_comment__varargs__(NULL,newargs,varargs); - Py_XDECREF(newargs); - Py_XDECREF(varargs); - return resultobj; -} - - -SWIGINTERN PyObject *_wrap_delete_MatrixStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MatrixStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MatrixStats" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MatrixStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MatrixStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_index_gpu_to_cpu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:index_gpu_to_cpu",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "index_gpu_to_cpu" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::gpu::index_gpu_to_cpu((faiss::Index const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - faiss::gpu::GpuClonerOptions *arg4 = (faiss::gpu::GpuClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:index_cpu_to_gpu",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "index_cpu_to_gpu" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "index_cpu_to_gpu" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "index_cpu_to_gpu" "', argument " "3"" of type '" "faiss::Index const *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "index_cpu_to_gpu" "', argument " "4"" of type '" "faiss::gpu::GpuClonerOptions const *""'"); - } - arg4 = reinterpret_cast< faiss::gpu::GpuClonerOptions * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::gpu::index_cpu_to_gpu(arg1,arg2,(faiss::Index const *)arg3,(faiss::gpu::GpuClonerOptions const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuResources *arg1 = (faiss::gpu::GpuResources *) 0 ; - int arg2 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:index_cpu_to_gpu",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuResources, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "index_cpu_to_gpu" "', argument " "1"" of type '" "faiss::gpu::GpuResources *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuResources * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "index_cpu_to_gpu" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "index_cpu_to_gpu" "', argument " "3"" of type '" "faiss::Index const *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::gpu::index_cpu_to_gpu(arg1,arg2,(faiss::Index const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_cpu_to_gpu__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__gpu__GpuResources, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_faiss__gpu__GpuClonerOptions, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_cpu_to_gpu__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'index_cpu_to_gpu'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::index_cpu_to_gpu(faiss::gpu::GpuResources *,int,faiss::Index const *,faiss::gpu::GpuClonerOptions const *)\n" - " faiss::gpu::index_cpu_to_gpu(faiss::gpu::GpuResources *,int,faiss::Index const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu_multiple__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = 0 ; - std::vector< int > *arg2 = 0 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - faiss::gpu::GpuMultipleClonerOptions *arg4 = (faiss::gpu::GpuMultipleClonerOptions *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:index_cpu_to_gpu_multiple",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "index_cpu_to_gpu_multiple" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "index_cpu_to_gpu_multiple" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_cpu_to_gpu_multiple" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "index_cpu_to_gpu_multiple" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "index_cpu_to_gpu_multiple" "', argument " "3"" of type '" "faiss::Index const *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "index_cpu_to_gpu_multiple" "', argument " "4"" of type '" "faiss::gpu::GpuMultipleClonerOptions const *""'"); - } - arg4 = reinterpret_cast< faiss::gpu::GpuMultipleClonerOptions * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::gpu::index_cpu_to_gpu_multiple(*arg1,*arg2,(faiss::Index const *)arg3,(faiss::gpu::GpuMultipleClonerOptions const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu_multiple__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::gpu::GpuResources * > *arg1 = 0 ; - std::vector< int > *arg2 = 0 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:index_cpu_to_gpu_multiple",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "index_cpu_to_gpu_multiple" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "index_cpu_to_gpu_multiple" "', argument " "1"" of type '" "std::vector< faiss::gpu::GpuResources * > &""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::gpu::GpuResources * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_cpu_to_gpu_multiple" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "index_cpu_to_gpu_multiple" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "index_cpu_to_gpu_multiple" "', argument " "3"" of type '" "faiss::Index const *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::gpu::index_cpu_to_gpu_multiple(*arg1,*arg2,(faiss::Index const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,471,DOWNCAST_GPU@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_cpu_to_gpu_multiple(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_int_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_cpu_to_gpu_multiple__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_int_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_cpu_to_gpu_multiple__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'index_cpu_to_gpu_multiple'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::gpu::index_cpu_to_gpu_multiple(std::vector< faiss::gpu::GpuResources * > &,std::vector< int > &,faiss::Index const *,faiss::gpu::GpuMultipleClonerOptions const *)\n" - " faiss::gpu::index_cpu_to_gpu_multiple(std::vector< faiss::gpu::GpuResources * > &,std::vector< int > &,faiss::Index const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_GpuParameterSpace_initialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuParameterSpace *arg1 = (faiss::gpu::GpuParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GpuParameterSpace_initialize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuParameterSpace_initialize" "', argument " "1"" of type '" "faiss::gpu::GpuParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuParameterSpace_initialize" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->initialize((faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GpuParameterSpace_set_index_parameter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuParameterSpace *arg1 = (faiss::gpu::GpuParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - std::string *arg3 = 0 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:GpuParameterSpace_set_index_parameter",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GpuParameterSpace_set_index_parameter" "', argument " "1"" of type '" "faiss::gpu::GpuParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GpuParameterSpace_set_index_parameter" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - std::string *ptr = (std::string *)0; - res3 = SWIG_AsPtr_std_string(obj2, &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GpuParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GpuParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - arg3 = ptr; - } - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GpuParameterSpace_set_index_parameter" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::gpu::GpuParameterSpace const *)arg1)->set_index_parameter(arg2,(std::string const &)*arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res3)) delete arg3; - return resultobj; -fail: - if (SWIG_IsNewObj(res3)) delete arg3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GpuParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuParameterSpace *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_GpuParameterSpace")) SWIG_fail; - result = (faiss::gpu::GpuParameterSpace *)new faiss::gpu::GpuParameterSpace(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__GpuParameterSpace, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GpuParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::gpu::GpuParameterSpace *arg1 = (faiss::gpu::GpuParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GpuParameterSpace",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__GpuParameterSpace, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GpuParameterSpace" "', argument " "1"" of type '" "faiss::gpu::GpuParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::gpu::GpuParameterSpace * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GpuParameterSpace_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__GpuParameterSpace, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_swig_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:swig_ptr",&obj0)) SWIG_fail; - arg1 = obj0; - result = (PyObject *)swig_ptr(arg1); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned char *arg1 = (unsigned char *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "unsigned char *""'"); - } - arg1 = reinterpret_cast< unsigned char * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned long *arg1 = (unsigned long *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "unsigned long *""'"); - } - arg1 = reinterpret_cast< unsigned long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long *arg1 = (long *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "long *""'"); - } - arg1 = reinterpret_cast< long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_3(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_4(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'rev_swig_ptr'.\n" - " Possible C/C++ prototypes are:\n" - " rev_swig_ptr(float *,size_t)\n" - " rev_swig_ptr(int *,size_t)\n" - " rev_swig_ptr(unsigned char *,size_t)\n" - " rev_swig_ptr(unsigned long *,size_t)\n" - " rev_swig_ptr(long *,size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< float,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< float,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< float,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_minheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_minheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMin< float,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_float_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_float_minheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMin< float,long > > *)new faiss::HeapArray< faiss::CMin< float,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_float_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_float_minheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_float_minheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *float_minheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< int,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< int,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< int,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_minheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_minheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMin< int,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_int_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_int_minheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMin< int,long > > *)new faiss::HeapArray< faiss::CMin< int,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_int_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_int_minheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_int_minheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *int_minheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< float,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< float,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< float,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_maxheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_maxheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMax< float,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_float_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_float_maxheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMax< float,long > > *)new faiss::HeapArray< faiss::CMax< float,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_float_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_float_maxheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_float_maxheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *float_maxheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< int,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< int,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< int,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_maxheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_maxheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMax< int,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_int_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_int_maxheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMax< int,long > > *)new faiss::HeapArray< faiss::CMax< int,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_int_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_int_maxheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_int_maxheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *int_maxheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_omp_set_num_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:omp_set_num_threads",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "omp_set_num_threads" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - omp_set_num_threads(arg1); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_omp_get_max_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int result; - - if (!PyArg_ParseTuple(args,(char *)":omp_get_max_threads")) SWIG_fail; - result = (int)omp_get_max_threads(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_memcpy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - int res1 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - void *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:memcpy",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "memcpy" "', argument " "1"" of type '" "void *""'"); - } - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "memcpy" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "memcpy" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (void *)memcpy(arg1,(void const *)arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_float_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_float_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_float_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (float *)cast_integer_to_float_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_long_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_long_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_long_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (long *)cast_integer_to_long_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_int_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_int_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_int_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (int *)cast_integer_to_int_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_nq_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchResult_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_nq_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_lims_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t *arg2 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_lims_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_lims_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_lims_set" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - if (arg1) (arg1)->lims = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_lims_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_lims_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_lims_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t *) ((arg1)->lims); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_labels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - faiss::RangeSearchResult::idx_t *arg2 = (faiss::RangeSearchResult::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_labels_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_labels_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_labels_set" "', argument " "2"" of type '" "faiss::RangeSearchResult::idx_t *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchResult::idx_t * >(argp2); - if (arg1) (arg1)->labels = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_labels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_labels_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_labels_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (faiss::RangeSearchResult::idx_t *) ((arg1)->labels); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_distances_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - float *arg2 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_distances_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_distances_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_distances_set" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - if (arg1) (arg1)->distances = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_distances_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_distances_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_distances_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (float *) ((arg1)->distances); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_buffer_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_buffer_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_buffer_size_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchResult_buffer_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->buffer_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_buffer_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_buffer_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_buffer_size_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t) ((arg1)->buffer_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RangeSearchResult",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult::idx_t""'"); - } - arg1 = static_cast< faiss::RangeSearchResult::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangeSearchResult" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - result = (faiss::RangeSearchResult *)new faiss::RangeSearchResult(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RangeSearchResult",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult::idx_t""'"); - } - arg1 = static_cast< faiss::RangeSearchResult::idx_t >(val1); - result = (faiss::RangeSearchResult *)new faiss::RangeSearchResult(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangeSearchResult__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangeSearchResult__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RangeSearchResult'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RangeSearchResult::RangeSearchResult(faiss::RangeSearchResult::idx_t,bool)\n" - " faiss::RangeSearchResult::RangeSearchResult(faiss::RangeSearchResult::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_do_allocation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_do_allocation",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_do_allocation" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - (arg1)->do_allocation(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeSearchResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeSearchResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeSearchResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeSearchResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelector_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector *arg1 = (faiss::IDSelector *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelector_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelector, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelector_is_member" "', argument " "1"" of type '" "faiss::IDSelector const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelector * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelector_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelector const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector *arg1 = (faiss::IDSelector *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelector, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelector" "', argument " "1"" of type '" "faiss::IDSelector *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelector * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelector, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imin_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_imin_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imin_set" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_imin_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->imin = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imin_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorRange_imin_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imin_get" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->imin); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imax_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_imax_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imax_set" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_imax_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->imax = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imax_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorRange_imax_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imax_get" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->imax); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IDSelectorRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector::idx_t arg1 ; - faiss::IDSelector::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IDSelectorRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IDSelectorRange",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IDSelectorRange" "', argument " "1"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg1 = static_cast< faiss::IDSelector::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IDSelectorRange" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (faiss::IDSelectorRange *)new faiss::IDSelectorRange(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IDSelectorRange, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_is_member" "', argument " "1"" of type '" "faiss::IDSelectorRange const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelectorRange const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelectorRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelectorRange",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelectorRange" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelectorRange_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelectorRange, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_nbits_set" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_nbits_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorBatch_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_nbits_get" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - result = (int) ((arg1)->nbits); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_mask_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_mask_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_mask_set" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_mask_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->mask = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_mask_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorBatch_mask_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_mask_get" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->mask); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IDSelectorBatch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - faiss::IDSelector::idx_t *arg2 = (faiss::IDSelector::idx_t *) 0 ; - long val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IDSelectorBatch *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IDSelectorBatch",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IDSelectorBatch" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IDSelectorBatch" "', argument " "2"" of type '" "faiss::IDSelector::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector::idx_t * >(argp2); - result = (faiss::IDSelectorBatch *)new faiss::IDSelectorBatch(arg1,(faiss::IDSelector::idx_t const *)arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_is_member" "', argument " "1"" of type '" "faiss::IDSelectorBatch const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelectorBatch const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelectorBatch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelectorBatch",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelectorBatch" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelectorBatch_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_BufferList_buffer_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_buffer_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffer_size_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_buffer_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->buffer_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffer_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_buffer_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffer_size_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (size_t) ((arg1)->buffer_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffers_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - std::vector< faiss::BufferList::Buffer > *arg2 = (std::vector< faiss::BufferList::Buffer > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_buffers_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffers_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BufferList_buffers_set" "', argument " "2"" of type '" "std::vector< faiss::BufferList::Buffer > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::BufferList::Buffer > * >(argp2); - if (arg1) (arg1)->buffers = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffers_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::BufferList::Buffer > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_buffers_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffers_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (std::vector< faiss::BufferList::Buffer > *)& ((arg1)->buffers); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_wp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_wp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_wp_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_wp_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->wp = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_wp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_wp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_wp_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (size_t) ((arg1)->wp); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_BufferList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::BufferList *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_BufferList",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_BufferList" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - result = (faiss::BufferList *)new faiss::BufferList(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BufferList, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_BufferList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_BufferList",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BufferList" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_append_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_append_buffer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_append_buffer" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - (arg1)->append_buffer(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - faiss::BufferList::idx_t arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:BufferList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_add" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_add" "', argument " "2"" of type '" "faiss::BufferList::idx_t""'"); - } - arg2 = static_cast< faiss::BufferList::idx_t >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BufferList_add" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - (arg1)->add(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_copy_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::BufferList::idx_t *arg4 = (faiss::BufferList::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:BufferList_copy_range",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_copy_range" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_copy_range" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BufferList_copy_range" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "BufferList_copy_range" "', argument " "4"" of type '" "faiss::BufferList::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::BufferList::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "BufferList_copy_range" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - (arg1)->copy_range(arg2,arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *BufferList_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__BufferList, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RangeQueryResult_qno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - faiss::RangeQueryResult::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_qno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_qno_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_qno_set" "', argument " "2"" of type '" "faiss::RangeQueryResult::idx_t""'"); - } - arg2 = static_cast< faiss::RangeQueryResult::idx_t >(val2); - if (arg1) (arg1)->qno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_qno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeQueryResult::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_qno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_qno_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (faiss::RangeQueryResult::idx_t) ((arg1)->qno); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_nres_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_nres_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_nres_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_nres_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nres = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_nres_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_nres_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_nres_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (size_t) ((arg1)->nres); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_pres_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - faiss::RangeSearchPartialResult *arg2 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_pres_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_pres_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeQueryResult_pres_set" "', argument " "2"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp2); - if (arg1) (arg1)->pres = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_pres_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchPartialResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_pres_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_pres_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (faiss::RangeSearchPartialResult *) ((arg1)->pres); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - float arg2 ; - faiss::RangeQueryResult::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:RangeQueryResult_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_add" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_add" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RangeQueryResult_add" "', argument " "3"" of type '" "faiss::RangeQueryResult::idx_t""'"); - } - arg3 = static_cast< faiss::RangeQueryResult::idx_t >(val3); - (arg1)->add(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeQueryResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RangeQueryResult")) SWIG_fail; - result = (faiss::RangeQueryResult *)new faiss::RangeQueryResult(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeQueryResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeQueryResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeQueryResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeQueryResult" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeQueryResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeQueryResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_res_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - faiss::RangeSearchResult *arg2 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_res_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_res_set" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchPartialResult_res_set" "', argument " "2"" of type '" "faiss::RangeSearchResult *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchResult * >(argp2); - if (arg1) (arg1)->res = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_res_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_res_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_res_get" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - result = (faiss::RangeSearchResult *) ((arg1)->res); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchPartialResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchPartialResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RangeSearchPartialResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_RangeSearchPartialResult" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (faiss::RangeSearchPartialResult *)new faiss::RangeSearchPartialResult(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_queries_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - std::vector< faiss::RangeQueryResult > *arg2 = (std::vector< faiss::RangeQueryResult > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_queries_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_queries_set" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchPartialResult_queries_set" "', argument " "2"" of type '" "std::vector< faiss::RangeQueryResult > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::RangeQueryResult > * >(argp2); - if (arg1) (arg1)->queries = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_queries_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::RangeQueryResult > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_queries_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_queries_get" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - result = (std::vector< faiss::RangeQueryResult > *)& ((arg1)->queries); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_new_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - faiss::BufferList::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RangeQueryResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_new_result",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_new_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchPartialResult_new_result" "', argument " "2"" of type '" "faiss::BufferList::idx_t""'"); - } - arg2 = static_cast< faiss::BufferList::idx_t >(val2); - result = (faiss::RangeQueryResult *) &(arg1)->new_result(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_finalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_finalize",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_finalize" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->finalize(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_lims(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_set_lims",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_lims" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->set_lims(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_set_result",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchPartialResult_set_result" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - (arg1)->set_result(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_set_result",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->set_result(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RangeSearchPartialResult, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_RangeSearchPartialResult_set_result__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RangeSearchPartialResult, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_RangeSearchPartialResult_set_result__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'RangeSearchPartialResult_set_result'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RangeSearchPartialResult::set_result(bool)\n" - " faiss::RangeSearchPartialResult::set_result()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeSearchPartialResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeSearchPartialResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeSearchPartialResult" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeSearchPartialResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IOReader_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IOReader_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_name_set" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOReader_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IOReader_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IOReader_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_name_get" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IOReader___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader___call__" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOReader___call__" "', argument " "2"" of type '" "void *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOReader___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOReader___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()(arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader_fileno(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IOReader_fileno",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_fileno" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - result = (int)(arg1)->fileno(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IOReader",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOReader" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IOReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IOReader, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IOWriter_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IOWriter_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_name_set" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOWriter_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IOWriter_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IOWriter_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_name_get" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IOWriter___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter___call__" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOWriter___call__" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOWriter___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOWriter___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()((void const *)arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter_fileno(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IOWriter_fileno",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_fileno" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - result = (int)(arg1)->fileno(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IOWriter",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOWriter" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IOWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IOWriter, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorIOReader_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOReader_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_data_set" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOReader_data_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->data = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOReader_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_data_get" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->data); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_rp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOReader_rp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_rp_set" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorIOReader_rp_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->rp = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_rp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOReader_rp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_rp_get" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - result = (size_t) ((arg1)->rp); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorIOReader___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader___call__" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOReader___call__" "', argument " "2"" of type '" "void *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorIOReader___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorIOReader___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()(arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VectorIOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorIOReader")) SWIG_fail; - result = (faiss::VectorIOReader *)new faiss::VectorIOReader(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorIOReader, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorIOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorIOReader",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorIOReader" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorIOReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorIOReader, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorIOWriter_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOWriter_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter_data_set" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOWriter_data_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->data = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOWriter_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOWriter_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter_data_get" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->data); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOWriter___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorIOWriter___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter___call__" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOWriter___call__" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorIOWriter___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorIOWriter___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()((void const *)arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VectorIOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorIOWriter")) SWIG_fail; - result = (faiss::VectorIOWriter *)new faiss::VectorIOWriter(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorIOWriter, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorIOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorIOWriter",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorIOWriter" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorIOWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorIOWriter, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_DistanceComputer_set_query(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - float *arg2 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DistanceComputer_set_query",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer_set_query" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DistanceComputer_set_query" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - (arg1)->set_query((float const *)arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DistanceComputer___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - faiss::DistanceComputer::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:DistanceComputer___call__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer___call__" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DistanceComputer___call__" "', argument " "2"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg2 = static_cast< faiss::DistanceComputer::idx_t >(val2); - result = (float)(arg1)->operator ()(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DistanceComputer_symmetric_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - faiss::DistanceComputer::idx_t arg2 ; - faiss::DistanceComputer::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:DistanceComputer_symmetric_dis",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer_symmetric_dis" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DistanceComputer_symmetric_dis" "', argument " "2"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg2 = static_cast< faiss::DistanceComputer::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DistanceComputer_symmetric_dis" "', argument " "3"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg3 = static_cast< faiss::DistanceComputer::idx_t >(val3); - result = (float)(arg1)->symmetric_dis(arg2,arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DistanceComputer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DistanceComputer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DistanceComputer" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *DistanceComputer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__DistanceComputer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_InterruptCallback_want_interrupt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InterruptCallback *arg1 = (faiss::InterruptCallback *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:InterruptCallback_want_interrupt",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InterruptCallback, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InterruptCallback_want_interrupt" "', argument " "1"" of type '" "faiss::InterruptCallback *""'"); - } - arg1 = reinterpret_cast< faiss::InterruptCallback * >(argp1); - result = (bool)(arg1)->want_interrupt(); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InterruptCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InterruptCallback *arg1 = (faiss::InterruptCallback *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InterruptCallback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InterruptCallback, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InterruptCallback" "', argument " "1"" of type '" "faiss::InterruptCallback *""'"); - } - arg1 = reinterpret_cast< faiss::InterruptCallback * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_check(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - - if (!PyArg_ParseTuple(args,(char *)":InterruptCallback_check")) SWIG_fail; - faiss::InterruptCallback::check(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_is_interrupted(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool result; - - if (!PyArg_ParseTuple(args,(char *)":InterruptCallback_is_interrupted")) SWIG_fail; - result = (bool)faiss::InterruptCallback::is_interrupted(); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_get_period_hint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InterruptCallback_get_period_hint",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "InterruptCallback_get_period_hint" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - result = (size_t)faiss::InterruptCallback::get_period_hint(arg1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InterruptCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__InterruptCallback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ignore_SIGTTIN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - - if (!PyArg_ParseTuple(args,(char *)":ignore_SIGTTIN")) SWIG_fail; - ignore_SIGTTIN(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - std::unordered_map< long,long > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MapLong2Long_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_map_set" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_mapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MapLong2Long_map_set" "', argument " "2"" of type '" "std::unordered_map< long,long >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MapLong2Long_map_set" "', argument " "2"" of type '" "std::unordered_map< long,long >""'"); - } else { - std::unordered_map< long,long > * temp = reinterpret_cast< std::unordered_map< long,long > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< long,long > result; - - if (!PyArg_ParseTuple(args,(char *)"O:MapLong2Long_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_map_get" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - result = ((arg1)->map); - resultobj = SWIG_NewPointerObj((new std::unordered_map< long,long >(static_cast< const std::unordered_map< long,long >& >(result))), SWIGTYPE_p_std__unordered_mapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:MapLong2Long_add",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_add" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_add" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MapLong2Long_add" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MapLong2Long_add" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - (arg1)->add(arg2,(long const *)arg3,(long const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:MapLong2Long_search",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_search" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_search" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - result = (long)(arg1)->search(arg2); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_search_multiple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:MapLong2Long_search_multiple",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_search_multiple" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_search_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MapLong2Long_search_multiple" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MapLong2Long_search_multiple" "', argument " "4"" of type '" "long *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - (arg1)->search_multiple(arg2,(long const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MapLong2Long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_MapLong2Long")) SWIG_fail; - result = (MapLong2Long *)new MapLong2Long(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MapLong2Long, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MapLong2Long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MapLong2Long",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MapLong2Long" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MapLong2Long_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_MapLong2Long, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"new_FloatVector", _wrap_new_FloatVector, METH_VARARGS, NULL}, - { (char *)"FloatVector_push_back", _wrap_FloatVector_push_back, METH_VARARGS, NULL}, - { (char *)"FloatVector_clear", _wrap_FloatVector_clear, METH_VARARGS, NULL}, - { (char *)"FloatVector_data", _wrap_FloatVector_data, METH_VARARGS, NULL}, - { (char *)"FloatVector_size", _wrap_FloatVector_size, METH_VARARGS, NULL}, - { (char *)"FloatVector_at", _wrap_FloatVector_at, METH_VARARGS, NULL}, - { (char *)"FloatVector_resize", _wrap_FloatVector_resize, METH_VARARGS, NULL}, - { (char *)"FloatVector_swap", _wrap_FloatVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_FloatVector", _wrap_delete_FloatVector, METH_VARARGS, NULL}, - { (char *)"FloatVector_swigregister", FloatVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_DoubleVector", _wrap_new_DoubleVector, METH_VARARGS, NULL}, - { (char *)"DoubleVector_push_back", _wrap_DoubleVector_push_back, METH_VARARGS, NULL}, - { (char *)"DoubleVector_clear", _wrap_DoubleVector_clear, METH_VARARGS, NULL}, - { (char *)"DoubleVector_data", _wrap_DoubleVector_data, METH_VARARGS, NULL}, - { (char *)"DoubleVector_size", _wrap_DoubleVector_size, METH_VARARGS, NULL}, - { (char *)"DoubleVector_at", _wrap_DoubleVector_at, METH_VARARGS, NULL}, - { (char *)"DoubleVector_resize", _wrap_DoubleVector_resize, METH_VARARGS, NULL}, - { (char *)"DoubleVector_swap", _wrap_DoubleVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_DoubleVector", _wrap_delete_DoubleVector, METH_VARARGS, NULL}, - { (char *)"DoubleVector_swigregister", DoubleVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_ByteVector", _wrap_new_ByteVector, METH_VARARGS, NULL}, - { (char *)"ByteVector_push_back", _wrap_ByteVector_push_back, METH_VARARGS, NULL}, - { (char *)"ByteVector_clear", _wrap_ByteVector_clear, METH_VARARGS, NULL}, - { (char *)"ByteVector_data", _wrap_ByteVector_data, METH_VARARGS, NULL}, - { (char *)"ByteVector_size", _wrap_ByteVector_size, METH_VARARGS, NULL}, - { (char *)"ByteVector_at", _wrap_ByteVector_at, METH_VARARGS, NULL}, - { (char *)"ByteVector_resize", _wrap_ByteVector_resize, METH_VARARGS, NULL}, - { (char *)"ByteVector_swap", _wrap_ByteVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_ByteVector", _wrap_delete_ByteVector, METH_VARARGS, NULL}, - { (char *)"ByteVector_swigregister", ByteVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_CharVector", _wrap_new_CharVector, METH_VARARGS, NULL}, - { (char *)"CharVector_push_back", _wrap_CharVector_push_back, METH_VARARGS, NULL}, - { (char *)"CharVector_clear", _wrap_CharVector_clear, METH_VARARGS, NULL}, - { (char *)"CharVector_data", _wrap_CharVector_data, METH_VARARGS, NULL}, - { (char *)"CharVector_size", _wrap_CharVector_size, METH_VARARGS, NULL}, - { (char *)"CharVector_at", _wrap_CharVector_at, METH_VARARGS, NULL}, - { (char *)"CharVector_resize", _wrap_CharVector_resize, METH_VARARGS, NULL}, - { (char *)"CharVector_swap", _wrap_CharVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_CharVector", _wrap_delete_CharVector, METH_VARARGS, NULL}, - { (char *)"CharVector_swigregister", CharVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_Uint64Vector", _wrap_new_Uint64Vector, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_push_back", _wrap_Uint64Vector_push_back, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_clear", _wrap_Uint64Vector_clear, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_data", _wrap_Uint64Vector_data, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_size", _wrap_Uint64Vector_size, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_at", _wrap_Uint64Vector_at, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_resize", _wrap_Uint64Vector_resize, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_swap", _wrap_Uint64Vector_swap, METH_VARARGS, NULL}, - { (char *)"delete_Uint64Vector", _wrap_delete_Uint64Vector, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_swigregister", Uint64Vector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_LongVector", _wrap_new_LongVector, METH_VARARGS, NULL}, - { (char *)"LongVector_push_back", _wrap_LongVector_push_back, METH_VARARGS, NULL}, - { (char *)"LongVector_clear", _wrap_LongVector_clear, METH_VARARGS, NULL}, - { (char *)"LongVector_data", _wrap_LongVector_data, METH_VARARGS, NULL}, - { (char *)"LongVector_size", _wrap_LongVector_size, METH_VARARGS, NULL}, - { (char *)"LongVector_at", _wrap_LongVector_at, METH_VARARGS, NULL}, - { (char *)"LongVector_resize", _wrap_LongVector_resize, METH_VARARGS, NULL}, - { (char *)"LongVector_swap", _wrap_LongVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_LongVector", _wrap_delete_LongVector, METH_VARARGS, NULL}, - { (char *)"LongVector_swigregister", LongVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IntVector", _wrap_new_IntVector, METH_VARARGS, NULL}, - { (char *)"IntVector_push_back", _wrap_IntVector_push_back, METH_VARARGS, NULL}, - { (char *)"IntVector_clear", _wrap_IntVector_clear, METH_VARARGS, NULL}, - { (char *)"IntVector_data", _wrap_IntVector_data, METH_VARARGS, NULL}, - { (char *)"IntVector_size", _wrap_IntVector_size, METH_VARARGS, NULL}, - { (char *)"IntVector_at", _wrap_IntVector_at, METH_VARARGS, NULL}, - { (char *)"IntVector_resize", _wrap_IntVector_resize, METH_VARARGS, NULL}, - { (char *)"IntVector_swap", _wrap_IntVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_IntVector", _wrap_delete_IntVector, METH_VARARGS, NULL}, - { (char *)"IntVector_swigregister", IntVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_VectorTransformVector", _wrap_new_VectorTransformVector, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_push_back", _wrap_VectorTransformVector_push_back, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_clear", _wrap_VectorTransformVector_clear, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_data", _wrap_VectorTransformVector_data, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_size", _wrap_VectorTransformVector_size, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_at", _wrap_VectorTransformVector_at, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_resize", _wrap_VectorTransformVector_resize, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_swap", _wrap_VectorTransformVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_VectorTransformVector", _wrap_delete_VectorTransformVector, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_swigregister", VectorTransformVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_OperatingPointVector", _wrap_new_OperatingPointVector, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_push_back", _wrap_OperatingPointVector_push_back, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_clear", _wrap_OperatingPointVector_clear, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_data", _wrap_OperatingPointVector_data, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_size", _wrap_OperatingPointVector_size, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_at", _wrap_OperatingPointVector_at, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_resize", _wrap_OperatingPointVector_resize, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_swap", _wrap_OperatingPointVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPointVector", _wrap_delete_OperatingPointVector, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_swigregister", OperatingPointVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_InvertedListsPtrVector", _wrap_new_InvertedListsPtrVector, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_push_back", _wrap_InvertedListsPtrVector_push_back, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_clear", _wrap_InvertedListsPtrVector_clear, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_data", _wrap_InvertedListsPtrVector_data, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_size", _wrap_InvertedListsPtrVector_size, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_at", _wrap_InvertedListsPtrVector_at, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_resize", _wrap_InvertedListsPtrVector_resize, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_swap", _wrap_InvertedListsPtrVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_InvertedListsPtrVector", _wrap_delete_InvertedListsPtrVector, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_swigregister", InvertedListsPtrVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_FloatVectorVector", _wrap_new_FloatVectorVector, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_push_back", _wrap_FloatVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_clear", _wrap_FloatVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_data", _wrap_FloatVectorVector_data, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_size", _wrap_FloatVectorVector_size, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_at", _wrap_FloatVectorVector_at, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_resize", _wrap_FloatVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_swap", _wrap_FloatVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_FloatVectorVector", _wrap_delete_FloatVectorVector, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_swigregister", FloatVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_ByteVectorVector", _wrap_new_ByteVectorVector, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_push_back", _wrap_ByteVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_clear", _wrap_ByteVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_data", _wrap_ByteVectorVector_data, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_size", _wrap_ByteVectorVector_size, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_at", _wrap_ByteVectorVector_at, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_resize", _wrap_ByteVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_swap", _wrap_ByteVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_ByteVectorVector", _wrap_delete_ByteVectorVector, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_swigregister", ByteVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_LongVectorVector", _wrap_new_LongVectorVector, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_push_back", _wrap_LongVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_clear", _wrap_LongVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_data", _wrap_LongVectorVector_data, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_size", _wrap_LongVectorVector_size, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_at", _wrap_LongVectorVector_at, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_resize", _wrap_LongVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_swap", _wrap_LongVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_LongVectorVector", _wrap_delete_LongVectorVector, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_swigregister", LongVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuResourcesVector", _wrap_new_GpuResourcesVector, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_push_back", _wrap_GpuResourcesVector_push_back, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_clear", _wrap_GpuResourcesVector_clear, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_data", _wrap_GpuResourcesVector_data, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_size", _wrap_GpuResourcesVector_size, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_at", _wrap_GpuResourcesVector_at, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_resize", _wrap_GpuResourcesVector_resize, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_swap", _wrap_GpuResourcesVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_GpuResourcesVector", _wrap_delete_GpuResourcesVector, METH_VARARGS, NULL}, - { (char *)"GpuResourcesVector_swigregister", GpuResourcesVector_swigregister, METH_VARARGS, NULL}, - { (char *)"popcount64", _wrap_popcount64, METH_VARARGS, NULL}, - { (char *)"hammings", _wrap_hammings, METH_VARARGS, NULL}, - { (char *)"bitvec_print", _wrap_bitvec_print, METH_VARARGS, NULL}, - { (char *)"fvecs2bitvecs", _wrap_fvecs2bitvecs, METH_VARARGS, NULL}, - { (char *)"fvec2bitvec", _wrap_fvec2bitvec, METH_VARARGS, NULL}, - { (char *)"hammings_knn_hc", _wrap_hammings_knn_hc, METH_VARARGS, NULL}, - { (char *)"hammings_knn", _wrap_hammings_knn, METH_VARARGS, NULL}, - { (char *)"hammings_knn_mc", _wrap_hammings_knn_mc, METH_VARARGS, NULL}, - { (char *)"hamming_count_thres", _wrap_hamming_count_thres, METH_VARARGS, NULL}, - { (char *)"match_hamming_thres", _wrap_match_hamming_thres, METH_VARARGS, NULL}, - { (char *)"crosshamming_count_thres", _wrap_crosshamming_count_thres, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_a0_set", _wrap_HammingComputer4_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_a0_get", _wrap_HammingComputer4_a0_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer4", _wrap_new_HammingComputer4, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_set", _wrap_HammingComputer4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_hamming", _wrap_HammingComputer4_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer4", _wrap_delete_HammingComputer4, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_swigregister", HammingComputer4_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_a0_set", _wrap_HammingComputer8_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_a0_get", _wrap_HammingComputer8_a0_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer8", _wrap_new_HammingComputer8, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_set", _wrap_HammingComputer8_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_hamming", _wrap_HammingComputer8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer8", _wrap_delete_HammingComputer8, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_swigregister", HammingComputer8_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a0_set", _wrap_HammingComputer16_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a0_get", _wrap_HammingComputer16_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a1_set", _wrap_HammingComputer16_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a1_get", _wrap_HammingComputer16_a1_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer16", _wrap_new_HammingComputer16, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_set", _wrap_HammingComputer16_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_hamming", _wrap_HammingComputer16_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer16", _wrap_delete_HammingComputer16, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_swigregister", HammingComputer16_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a0_set", _wrap_HammingComputer20_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a0_get", _wrap_HammingComputer20_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a1_set", _wrap_HammingComputer20_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a1_get", _wrap_HammingComputer20_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a2_set", _wrap_HammingComputer20_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a2_get", _wrap_HammingComputer20_a2_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer20", _wrap_new_HammingComputer20, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_set", _wrap_HammingComputer20_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_hamming", _wrap_HammingComputer20_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer20", _wrap_delete_HammingComputer20, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_swigregister", HammingComputer20_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a0_set", _wrap_HammingComputer32_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a0_get", _wrap_HammingComputer32_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a1_set", _wrap_HammingComputer32_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a1_get", _wrap_HammingComputer32_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a2_set", _wrap_HammingComputer32_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a2_get", _wrap_HammingComputer32_a2_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a3_set", _wrap_HammingComputer32_a3_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a3_get", _wrap_HammingComputer32_a3_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer32", _wrap_new_HammingComputer32, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_set", _wrap_HammingComputer32_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_hamming", _wrap_HammingComputer32_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer32", _wrap_delete_HammingComputer32, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_swigregister", HammingComputer32_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a0_set", _wrap_HammingComputer64_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a0_get", _wrap_HammingComputer64_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a1_set", _wrap_HammingComputer64_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a1_get", _wrap_HammingComputer64_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a2_set", _wrap_HammingComputer64_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a2_get", _wrap_HammingComputer64_a2_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a3_set", _wrap_HammingComputer64_a3_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a3_get", _wrap_HammingComputer64_a3_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a4_set", _wrap_HammingComputer64_a4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a4_get", _wrap_HammingComputer64_a4_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a5_set", _wrap_HammingComputer64_a5_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a5_get", _wrap_HammingComputer64_a5_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a6_set", _wrap_HammingComputer64_a6_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a6_get", _wrap_HammingComputer64_a6_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a7_set", _wrap_HammingComputer64_a7_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a7_get", _wrap_HammingComputer64_a7_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer64", _wrap_new_HammingComputer64, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_set", _wrap_HammingComputer64_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_hamming", _wrap_HammingComputer64_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer64", _wrap_delete_HammingComputer64, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_swigregister", HammingComputer64_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_a_set", _wrap_HammingComputerDefault_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_a_get", _wrap_HammingComputerDefault_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_n_set", _wrap_HammingComputerDefault_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_n_get", _wrap_HammingComputerDefault_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerDefault", _wrap_new_HammingComputerDefault, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_set", _wrap_HammingComputerDefault_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_hamming", _wrap_HammingComputerDefault_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerDefault", _wrap_delete_HammingComputerDefault, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_swigregister", HammingComputerDefault_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_a_set", _wrap_HammingComputerM8_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_a_get", _wrap_HammingComputerM8_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_n_set", _wrap_HammingComputerM8_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_n_get", _wrap_HammingComputerM8_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerM8", _wrap_new_HammingComputerM8, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_set", _wrap_HammingComputerM8_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_hamming", _wrap_HammingComputerM8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerM8", _wrap_delete_HammingComputerM8, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_swigregister", HammingComputerM8_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_a_set", _wrap_HammingComputerM4_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_a_get", _wrap_HammingComputerM4_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_n_set", _wrap_HammingComputerM4_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_n_get", _wrap_HammingComputerM4_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerM4", _wrap_new_HammingComputerM4, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_set", _wrap_HammingComputerM4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_hamming", _wrap_HammingComputerM4_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerM4", _wrap_delete_HammingComputerM4, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_swigregister", HammingComputerM4_swigregister, METH_VARARGS, NULL}, - { (char *)"generalized_hamming_64", _wrap_generalized_hamming_64, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_a0_set", _wrap_GenHammingComputer8_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_a0_get", _wrap_GenHammingComputer8_a0_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer8", _wrap_new_GenHammingComputer8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_hamming", _wrap_GenHammingComputer8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer8", _wrap_delete_GenHammingComputer8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_swigregister", GenHammingComputer8_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a0_set", _wrap_GenHammingComputer16_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a0_get", _wrap_GenHammingComputer16_a0_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a1_set", _wrap_GenHammingComputer16_a1_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a1_get", _wrap_GenHammingComputer16_a1_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer16", _wrap_new_GenHammingComputer16, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_hamming", _wrap_GenHammingComputer16_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer16", _wrap_delete_GenHammingComputer16, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_swigregister", GenHammingComputer16_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a0_set", _wrap_GenHammingComputer32_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a0_get", _wrap_GenHammingComputer32_a0_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a1_set", _wrap_GenHammingComputer32_a1_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a1_get", _wrap_GenHammingComputer32_a1_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a2_set", _wrap_GenHammingComputer32_a2_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a2_get", _wrap_GenHammingComputer32_a2_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a3_set", _wrap_GenHammingComputer32_a3_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a3_get", _wrap_GenHammingComputer32_a3_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer32", _wrap_new_GenHammingComputer32, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_hamming", _wrap_GenHammingComputer32_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer32", _wrap_delete_GenHammingComputer32, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_swigregister", GenHammingComputer32_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_a_set", _wrap_GenHammingComputerM8_a_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_a_get", _wrap_GenHammingComputerM8_a_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_n_set", _wrap_GenHammingComputerM8_n_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_n_get", _wrap_GenHammingComputerM8_n_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputerM8", _wrap_new_GenHammingComputerM8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_hamming", _wrap_GenHammingComputerM8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputerM8", _wrap_delete_GenHammingComputerM8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_swigregister", GenHammingComputerM8_swigregister, METH_VARARGS, NULL}, - { (char *)"generalized_hammings_knn_hc", _wrap_generalized_hammings_knn_hc, METH_VARARGS, NULL}, - { (char *)"get_num_gpus", _wrap_get_num_gpus, METH_VARARGS, NULL}, - { (char *)"delete_GpuResources", _wrap_delete_GpuResources, METH_VARARGS, NULL}, - { (char *)"GpuResources_initializeForDevice", _wrap_GpuResources_initializeForDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_getBlasHandle", _wrap_GpuResources_getBlasHandle, METH_VARARGS, NULL}, - { (char *)"GpuResources_getDefaultStream", _wrap_GpuResources_getDefaultStream, METH_VARARGS, NULL}, - { (char *)"GpuResources_getAlternateStreams", _wrap_GpuResources_getAlternateStreams, METH_VARARGS, NULL}, - { (char *)"GpuResources_getPinnedMemory", _wrap_GpuResources_getPinnedMemory, METH_VARARGS, NULL}, - { (char *)"GpuResources_getAsyncCopyStream", _wrap_GpuResources_getAsyncCopyStream, METH_VARARGS, NULL}, - { (char *)"GpuResources_getBlasHandleCurrentDevice", _wrap_GpuResources_getBlasHandleCurrentDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_getDefaultStreamCurrentDevice", _wrap_GpuResources_getDefaultStreamCurrentDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_syncDefaultStream", _wrap_GpuResources_syncDefaultStream, METH_VARARGS, NULL}, - { (char *)"GpuResources_syncDefaultStreamCurrentDevice", _wrap_GpuResources_syncDefaultStreamCurrentDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_getAlternateStreamsCurrentDevice", _wrap_GpuResources_getAlternateStreamsCurrentDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_getAsyncCopyStreamCurrentDevice", _wrap_GpuResources_getAsyncCopyStreamCurrentDevice, METH_VARARGS, NULL}, - { (char *)"GpuResources_swigregister", GpuResources_swigregister, METH_VARARGS, NULL}, - { (char *)"new_StandardGpuResources", _wrap_new_StandardGpuResources, METH_VARARGS, NULL}, - { (char *)"delete_StandardGpuResources", _wrap_delete_StandardGpuResources, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_noTempMemory", _wrap_StandardGpuResources_noTempMemory, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_setTempMemory", _wrap_StandardGpuResources_setTempMemory, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_setPinnedMemory", _wrap_StandardGpuResources_setPinnedMemory, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_setDefaultStream", _wrap_StandardGpuResources_setDefaultStream, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_setDefaultNullStreamAllDevices", _wrap_StandardGpuResources_setDefaultNullStreamAllDevices, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_setCudaMallocWarning", _wrap_StandardGpuResources_setCudaMallocWarning, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_initializeForDevice", _wrap_StandardGpuResources_initializeForDevice, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_getBlasHandle", _wrap_StandardGpuResources_getBlasHandle, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_getDefaultStream", _wrap_StandardGpuResources_getDefaultStream, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_getAlternateStreams", _wrap_StandardGpuResources_getAlternateStreams, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_getPinnedMemory", _wrap_StandardGpuResources_getPinnedMemory, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_getAsyncCopyStream", _wrap_StandardGpuResources_getAsyncCopyStream, METH_VARARGS, NULL}, - { (char *)"StandardGpuResources_swigregister", StandardGpuResources_swigregister, METH_VARARGS, NULL}, - { (char *)"getmillisecs", _wrap_getmillisecs, METH_VARARGS, NULL}, - { (char *)"get_mem_usage_kb", _wrap_get_mem_usage_kb, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_mt_set", _wrap_RandomGenerator_mt_set, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_mt_get", _wrap_RandomGenerator_mt_get, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_long", _wrap_RandomGenerator_rand_long, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_int", _wrap_RandomGenerator_rand_int, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_float", _wrap_RandomGenerator_rand_float, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_double", _wrap_RandomGenerator_rand_double, METH_VARARGS, NULL}, - { (char *)"new_RandomGenerator", _wrap_new_RandomGenerator, METH_VARARGS, NULL}, - { (char *)"delete_RandomGenerator", _wrap_delete_RandomGenerator, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_swigregister", RandomGenerator_swigregister, METH_VARARGS, NULL}, - { (char *)"float_rand", _wrap_float_rand, METH_VARARGS, NULL}, - { (char *)"float_randn", _wrap_float_randn, METH_VARARGS, NULL}, - { (char *)"long_rand", _wrap_long_rand, METH_VARARGS, NULL}, - { (char *)"byte_rand", _wrap_byte_rand, METH_VARARGS, NULL}, - { (char *)"rand_perm", _wrap_rand_perm, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr", _wrap_fvec_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_product", _wrap_fvec_inner_product, METH_VARARGS, NULL}, - { (char *)"imbalance_factor", _wrap_imbalance_factor, METH_VARARGS, NULL}, - { (char *)"pairwise_L2sqr", _wrap_pairwise_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_products_ny", _wrap_fvec_inner_products_ny, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr_ny", _wrap_fvec_L2sqr_ny, METH_VARARGS, NULL}, - { (char *)"fvec_norm_L2sqr", _wrap_fvec_norm_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_norms_L2", _wrap_fvec_norms_L2, METH_VARARGS, NULL}, - { (char *)"fvec_norms_L2sqr", _wrap_fvec_norms_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_renorm_L2", _wrap_fvec_renorm_L2, METH_VARARGS, NULL}, - { (char *)"inner_product_to_L2sqr", _wrap_inner_product_to_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_products_by_idx", _wrap_fvec_inner_products_by_idx, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr_by_idx", _wrap_fvec_L2sqr_by_idx, METH_VARARGS, NULL}, - { (char *)"knn_inner_product", _wrap_knn_inner_product, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr", _wrap_knn_L2sqr, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr_base_shift", _wrap_knn_L2sqr_base_shift, METH_VARARGS, NULL}, - { (char *)"knn_inner_products_by_idx", _wrap_knn_inner_products_by_idx, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr_by_idx", _wrap_knn_L2sqr_by_idx, METH_VARARGS, NULL}, - { (char *)"range_search_L2sqr", _wrap_range_search_L2sqr, METH_VARARGS, NULL}, - { (char *)"range_search_inner_product", _wrap_range_search_inner_product, METH_VARARGS, NULL}, - { (char *)"fvec_madd", _wrap_fvec_madd, METH_VARARGS, NULL}, - { (char *)"fvec_madd_and_argmin", _wrap_fvec_madd_and_argmin, METH_VARARGS, NULL}, - { (char *)"reflection", _wrap_reflection, METH_VARARGS, NULL}, - { (char *)"km_update_centroids", _wrap_km_update_centroids, METH_VARARGS, NULL}, - { (char *)"matrix_qr", _wrap_matrix_qr, METH_VARARGS, NULL}, - { (char *)"ranklist_handle_ties", _wrap_ranklist_handle_ties, METH_VARARGS, NULL}, - { (char *)"ranklist_intersection_size", _wrap_ranklist_intersection_size, METH_VARARGS, NULL}, - { (char *)"merge_result_table_with", _wrap_merge_result_table_with, METH_VARARGS, NULL}, - { (char *)"fvec_argsort", _wrap_fvec_argsort, METH_VARARGS, NULL}, - { (char *)"fvec_argsort_parallel", _wrap_fvec_argsort_parallel, METH_VARARGS, NULL}, - { (char *)"ivec_hist", _wrap_ivec_hist, METH_VARARGS, NULL}, - { (char *)"bincode_hist", _wrap_bincode_hist, METH_VARARGS, NULL}, - { (char *)"ivec_checksum", _wrap_ivec_checksum, METH_VARARGS, NULL}, - { (char *)"fvecs_maybe_subsample", _wrap_fvecs_maybe_subsample, METH_VARARGS, NULL}, - { (char *)"binary_to_real", _wrap_binary_to_real, METH_VARARGS, NULL}, - { (char *)"real_to_binary", _wrap_real_to_binary, METH_VARARGS, NULL}, - { (char *)"hash_bytes", _wrap_hash_bytes, METH_VARARGS, NULL}, - { (char *)"check_openmp", _wrap_check_openmp, METH_VARARGS, NULL}, - { (char *)"Index_d_set", _wrap_Index_d_set, METH_VARARGS, NULL}, - { (char *)"Index_d_get", _wrap_Index_d_get, METH_VARARGS, NULL}, - { (char *)"Index_ntotal_set", _wrap_Index_ntotal_set, METH_VARARGS, NULL}, - { (char *)"Index_ntotal_get", _wrap_Index_ntotal_get, METH_VARARGS, NULL}, - { (char *)"Index_verbose_set", _wrap_Index_verbose_set, METH_VARARGS, NULL}, - { (char *)"Index_verbose_get", _wrap_Index_verbose_get, METH_VARARGS, NULL}, - { (char *)"Index_is_trained_set", _wrap_Index_is_trained_set, METH_VARARGS, NULL}, - { (char *)"Index_is_trained_get", _wrap_Index_is_trained_get, METH_VARARGS, NULL}, - { (char *)"Index_metric_type_set", _wrap_Index_metric_type_set, METH_VARARGS, NULL}, - { (char *)"Index_metric_type_get", _wrap_Index_metric_type_get, METH_VARARGS, NULL}, - { (char *)"delete_Index", _wrap_delete_Index, METH_VARARGS, NULL}, - { (char *)"Index_train", _wrap_Index_train, METH_VARARGS, NULL}, - { (char *)"Index_add", _wrap_Index_add, METH_VARARGS, NULL}, - { (char *)"Index_add_with_ids", _wrap_Index_add_with_ids, METH_VARARGS, NULL}, - { (char *)"Index_search", _wrap_Index_search, METH_VARARGS, NULL}, - { (char *)"Index_range_search", _wrap_Index_range_search, METH_VARARGS, NULL}, - { (char *)"Index_assign", _wrap_Index_assign, METH_VARARGS, NULL}, - { (char *)"Index_reset", _wrap_Index_reset, METH_VARARGS, NULL}, - { (char *)"Index_remove_ids", _wrap_Index_remove_ids, METH_VARARGS, NULL}, - { (char *)"Index_reconstruct", _wrap_Index_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index_reconstruct_n", _wrap_Index_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"Index_search_and_reconstruct", _wrap_Index_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index_compute_residual", _wrap_Index_compute_residual, METH_VARARGS, NULL}, - { (char *)"Index_display", _wrap_Index_display, METH_VARARGS, NULL}, - { (char *)"Index_swigregister", Index_swigregister, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_niter_set", _wrap_ClusteringParameters_niter_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_niter_get", _wrap_ClusteringParameters_niter_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_nredo_set", _wrap_ClusteringParameters_nredo_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_nredo_get", _wrap_ClusteringParameters_nredo_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_verbose_set", _wrap_ClusteringParameters_verbose_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_verbose_get", _wrap_ClusteringParameters_verbose_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_spherical_set", _wrap_ClusteringParameters_spherical_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_spherical_get", _wrap_ClusteringParameters_spherical_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_int_centroids_set", _wrap_ClusteringParameters_int_centroids_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_int_centroids_get", _wrap_ClusteringParameters_int_centroids_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_update_index_set", _wrap_ClusteringParameters_update_index_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_update_index_get", _wrap_ClusteringParameters_update_index_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_frozen_centroids_set", _wrap_ClusteringParameters_frozen_centroids_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_frozen_centroids_get", _wrap_ClusteringParameters_frozen_centroids_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_min_points_per_centroid_set", _wrap_ClusteringParameters_min_points_per_centroid_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_min_points_per_centroid_get", _wrap_ClusteringParameters_min_points_per_centroid_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_max_points_per_centroid_set", _wrap_ClusteringParameters_max_points_per_centroid_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_max_points_per_centroid_get", _wrap_ClusteringParameters_max_points_per_centroid_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_seed_set", _wrap_ClusteringParameters_seed_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_seed_get", _wrap_ClusteringParameters_seed_get, METH_VARARGS, NULL}, - { (char *)"new_ClusteringParameters", _wrap_new_ClusteringParameters, METH_VARARGS, NULL}, - { (char *)"delete_ClusteringParameters", _wrap_delete_ClusteringParameters, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_swigregister", ClusteringParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"Clustering_d_set", _wrap_Clustering_d_set, METH_VARARGS, NULL}, - { (char *)"Clustering_d_get", _wrap_Clustering_d_get, METH_VARARGS, NULL}, - { (char *)"Clustering_k_set", _wrap_Clustering_k_set, METH_VARARGS, NULL}, - { (char *)"Clustering_k_get", _wrap_Clustering_k_get, METH_VARARGS, NULL}, - { (char *)"Clustering_centroids_set", _wrap_Clustering_centroids_set, METH_VARARGS, NULL}, - { (char *)"Clustering_centroids_get", _wrap_Clustering_centroids_get, METH_VARARGS, NULL}, - { (char *)"Clustering_obj_set", _wrap_Clustering_obj_set, METH_VARARGS, NULL}, - { (char *)"Clustering_obj_get", _wrap_Clustering_obj_get, METH_VARARGS, NULL}, - { (char *)"new_Clustering", _wrap_new_Clustering, METH_VARARGS, NULL}, - { (char *)"Clustering_train", _wrap_Clustering_train, METH_VARARGS, NULL}, - { (char *)"Clustering_post_process_centroids", _wrap_Clustering_post_process_centroids, METH_VARARGS, NULL}, - { (char *)"delete_Clustering", _wrap_delete_Clustering, METH_VARARGS, NULL}, - { (char *)"Clustering_swigregister", Clustering_swigregister, METH_VARARGS, NULL}, - { (char *)"kmeans_clustering", _wrap_kmeans_clustering, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_d_set", _wrap_ProductQuantizer_d_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_d_get", _wrap_ProductQuantizer_d_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_M_set", _wrap_ProductQuantizer_M_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_M_get", _wrap_ProductQuantizer_M_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_nbits_set", _wrap_ProductQuantizer_nbits_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_nbits_get", _wrap_ProductQuantizer_nbits_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_dsub_set", _wrap_ProductQuantizer_dsub_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_dsub_get", _wrap_ProductQuantizer_dsub_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_byte_per_idx_set", _wrap_ProductQuantizer_byte_per_idx_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_byte_per_idx_get", _wrap_ProductQuantizer_byte_per_idx_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_code_size_set", _wrap_ProductQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_code_size_get", _wrap_ProductQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_ksub_set", _wrap_ProductQuantizer_ksub_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_ksub_get", _wrap_ProductQuantizer_ksub_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_verbose_set", _wrap_ProductQuantizer_verbose_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_verbose_get", _wrap_ProductQuantizer_verbose_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train_type_set", _wrap_ProductQuantizer_train_type_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train_type_get", _wrap_ProductQuantizer_train_type_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_cp_set", _wrap_ProductQuantizer_cp_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_cp_get", _wrap_ProductQuantizer_cp_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_assign_index_set", _wrap_ProductQuantizer_assign_index_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_assign_index_get", _wrap_ProductQuantizer_assign_index_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_centroids_set", _wrap_ProductQuantizer_centroids_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_centroids_get", _wrap_ProductQuantizer_centroids_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_get_centroids", _wrap_ProductQuantizer_get_centroids, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train", _wrap_ProductQuantizer_train, METH_VARARGS, NULL}, - { (char *)"new_ProductQuantizer", _wrap_new_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_set_derived_values", _wrap_ProductQuantizer_set_derived_values, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_set_params", _wrap_ProductQuantizer_set_params, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_code", _wrap_ProductQuantizer_compute_code, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_codes", _wrap_ProductQuantizer_compute_codes, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_codes_with_assign_index", _wrap_ProductQuantizer_compute_codes_with_assign_index, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_decode", _wrap_ProductQuantizer_decode, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_code_from_distance_table", _wrap_ProductQuantizer_compute_code_from_distance_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_distance_table", _wrap_ProductQuantizer_compute_distance_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_inner_prod_table", _wrap_ProductQuantizer_compute_inner_prod_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_distance_tables", _wrap_ProductQuantizer_compute_distance_tables, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_inner_prod_tables", _wrap_ProductQuantizer_compute_inner_prod_tables, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search", _wrap_ProductQuantizer_search, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search_ip", _wrap_ProductQuantizer_search_ip, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_sdc_table_set", _wrap_ProductQuantizer_sdc_table_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_sdc_table_get", _wrap_ProductQuantizer_sdc_table_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_sdc_table", _wrap_ProductQuantizer_compute_sdc_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search_sdc", _wrap_ProductQuantizer_search_sdc, METH_VARARGS, NULL}, - { (char *)"delete_ProductQuantizer", _wrap_delete_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_swigregister", ProductQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_in_set", _wrap_VectorTransform_d_in_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_in_get", _wrap_VectorTransform_d_in_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_out_set", _wrap_VectorTransform_d_out_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_out_get", _wrap_VectorTransform_d_out_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_is_trained_set", _wrap_VectorTransform_is_trained_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_is_trained_get", _wrap_VectorTransform_is_trained_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_train", _wrap_VectorTransform_train, METH_VARARGS, NULL}, - { (char *)"VectorTransform_apply", _wrap_VectorTransform_apply, METH_VARARGS, NULL}, - { (char *)"VectorTransform_apply_noalloc", _wrap_VectorTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"VectorTransform_reverse_transform", _wrap_VectorTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_VectorTransform", _wrap_delete_VectorTransform, METH_VARARGS, NULL}, - { (char *)"VectorTransform_swigregister", VectorTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"LinearTransform_have_bias_set", _wrap_LinearTransform_have_bias_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_have_bias_get", _wrap_LinearTransform_have_bias_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_is_orthonormal_set", _wrap_LinearTransform_is_orthonormal_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_is_orthonormal_get", _wrap_LinearTransform_is_orthonormal_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_A_set", _wrap_LinearTransform_A_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_A_get", _wrap_LinearTransform_A_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_b_set", _wrap_LinearTransform_b_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_b_get", _wrap_LinearTransform_b_get, METH_VARARGS, NULL}, - { (char *)"new_LinearTransform", _wrap_new_LinearTransform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_apply_noalloc", _wrap_LinearTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"LinearTransform_transform_transpose", _wrap_LinearTransform_transform_transpose, METH_VARARGS, NULL}, - { (char *)"LinearTransform_reverse_transform", _wrap_LinearTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_set_is_orthonormal", _wrap_LinearTransform_set_is_orthonormal, METH_VARARGS, NULL}, - { (char *)"LinearTransform_verbose_set", _wrap_LinearTransform_verbose_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_verbose_get", _wrap_LinearTransform_verbose_get, METH_VARARGS, NULL}, - { (char *)"delete_LinearTransform", _wrap_delete_LinearTransform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_swigregister", LinearTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_init", _wrap_RandomRotationMatrix_init, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_train", _wrap_RandomRotationMatrix_train, METH_VARARGS, NULL}, - { (char *)"new_RandomRotationMatrix", _wrap_new_RandomRotationMatrix, METH_VARARGS, NULL}, - { (char *)"delete_RandomRotationMatrix", _wrap_delete_RandomRotationMatrix, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_swigregister", RandomRotationMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigen_power_set", _wrap_PCAMatrix_eigen_power_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigen_power_get", _wrap_PCAMatrix_eigen_power_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_random_rotation_set", _wrap_PCAMatrix_random_rotation_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_random_rotation_get", _wrap_PCAMatrix_random_rotation_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_max_points_per_d_set", _wrap_PCAMatrix_max_points_per_d_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_max_points_per_d_get", _wrap_PCAMatrix_max_points_per_d_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_balanced_bins_set", _wrap_PCAMatrix_balanced_bins_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_balanced_bins_get", _wrap_PCAMatrix_balanced_bins_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_mean_set", _wrap_PCAMatrix_mean_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_mean_get", _wrap_PCAMatrix_mean_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigenvalues_set", _wrap_PCAMatrix_eigenvalues_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigenvalues_get", _wrap_PCAMatrix_eigenvalues_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_PCAMat_set", _wrap_PCAMatrix_PCAMat_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_PCAMat_get", _wrap_PCAMatrix_PCAMat_get, METH_VARARGS, NULL}, - { (char *)"new_PCAMatrix", _wrap_new_PCAMatrix, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_train", _wrap_PCAMatrix_train, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_copy_from", _wrap_PCAMatrix_copy_from, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_prepare_Ab", _wrap_PCAMatrix_prepare_Ab, METH_VARARGS, NULL}, - { (char *)"delete_PCAMatrix", _wrap_delete_PCAMatrix, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_swigregister", PCAMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_M_set", _wrap_OPQMatrix_M_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_M_get", _wrap_OPQMatrix_M_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_set", _wrap_OPQMatrix_niter_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_get", _wrap_OPQMatrix_niter_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_set", _wrap_OPQMatrix_niter_pq_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_get", _wrap_OPQMatrix_niter_pq_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_0_set", _wrap_OPQMatrix_niter_pq_0_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_0_get", _wrap_OPQMatrix_niter_pq_0_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_max_train_points_set", _wrap_OPQMatrix_max_train_points_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_max_train_points_get", _wrap_OPQMatrix_max_train_points_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_verbose_set", _wrap_OPQMatrix_verbose_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_verbose_get", _wrap_OPQMatrix_verbose_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_pq_set", _wrap_OPQMatrix_pq_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_pq_get", _wrap_OPQMatrix_pq_get, METH_VARARGS, NULL}, - { (char *)"new_OPQMatrix", _wrap_new_OPQMatrix, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_train", _wrap_OPQMatrix_train, METH_VARARGS, NULL}, - { (char *)"delete_OPQMatrix", _wrap_delete_OPQMatrix, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_swigregister", OPQMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_map_set", _wrap_RemapDimensionsTransform_map_set, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_map_get", _wrap_RemapDimensionsTransform_map_get, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_apply_noalloc", _wrap_RemapDimensionsTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_reverse_transform", _wrap_RemapDimensionsTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"new_RemapDimensionsTransform", _wrap_new_RemapDimensionsTransform, METH_VARARGS, NULL}, - { (char *)"delete_RemapDimensionsTransform", _wrap_delete_RemapDimensionsTransform, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_swigregister", RemapDimensionsTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_norm_set", _wrap_NormalizationTransform_norm_set, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_norm_get", _wrap_NormalizationTransform_norm_get, METH_VARARGS, NULL}, - { (char *)"new_NormalizationTransform", _wrap_new_NormalizationTransform, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_apply_noalloc", _wrap_NormalizationTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_reverse_transform", _wrap_NormalizationTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_NormalizationTransform", _wrap_delete_NormalizationTransform, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_swigregister", NormalizationTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_mean_set", _wrap_CenteringTransform_mean_set, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_mean_get", _wrap_CenteringTransform_mean_get, METH_VARARGS, NULL}, - { (char *)"new_CenteringTransform", _wrap_new_CenteringTransform, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_train", _wrap_CenteringTransform_train, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_apply_noalloc", _wrap_CenteringTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_reverse_transform", _wrap_CenteringTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_CenteringTransform", _wrap_delete_CenteringTransform, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_swigregister", CenteringTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_chain_set", _wrap_IndexPreTransform_chain_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_chain_get", _wrap_IndexPreTransform_chain_get, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_index_set", _wrap_IndexPreTransform_index_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_index_get", _wrap_IndexPreTransform_index_get, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_own_fields_set", _wrap_IndexPreTransform_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_own_fields_get", _wrap_IndexPreTransform_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPreTransform", _wrap_new_IndexPreTransform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_prepend_transform", _wrap_IndexPreTransform_prepend_transform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_train", _wrap_IndexPreTransform_train, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_add", _wrap_IndexPreTransform_add, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_add_with_ids", _wrap_IndexPreTransform_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reset", _wrap_IndexPreTransform_reset, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_remove_ids", _wrap_IndexPreTransform_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_search", _wrap_IndexPreTransform_search, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_range_search", _wrap_IndexPreTransform_range_search, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reconstruct", _wrap_IndexPreTransform_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reconstruct_n", _wrap_IndexPreTransform_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_search_and_reconstruct", _wrap_IndexPreTransform_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_apply_chain", _wrap_IndexPreTransform_apply_chain, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reverse_chain", _wrap_IndexPreTransform_reverse_chain, METH_VARARGS, NULL}, - { (char *)"delete_IndexPreTransform", _wrap_delete_IndexPreTransform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_swigregister", IndexPreTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlat_xb_set", _wrap_IndexFlat_xb_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat_xb_get", _wrap_IndexFlat_xb_get, METH_VARARGS, NULL}, - { (char *)"IndexFlat_add", _wrap_IndexFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexFlat_reset", _wrap_IndexFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexFlat_search", _wrap_IndexFlat_search, METH_VARARGS, NULL}, - { (char *)"IndexFlat_range_search", _wrap_IndexFlat_range_search, METH_VARARGS, NULL}, - { (char *)"IndexFlat_reconstruct", _wrap_IndexFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexFlat_compute_distance_subset", _wrap_IndexFlat_compute_distance_subset, METH_VARARGS, NULL}, - { (char *)"IndexFlat_remove_ids", _wrap_IndexFlat_remove_ids, METH_VARARGS, NULL}, - { (char *)"new_IndexFlat", _wrap_new_IndexFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlat", _wrap_delete_IndexFlat, METH_VARARGS, NULL}, - { (char *)"IndexFlat_swigregister", IndexFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatIP", _wrap_new_IndexFlatIP, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatIP", _wrap_delete_IndexFlatIP, METH_VARARGS, NULL}, - { (char *)"IndexFlatIP_swigregister", IndexFlatIP_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatL2", _wrap_new_IndexFlatL2, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatL2", _wrap_delete_IndexFlatL2, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2_swigregister", IndexFlatL2_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_shift_set", _wrap_IndexFlatL2BaseShift_shift_set, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_shift_get", _wrap_IndexFlatL2BaseShift_shift_get, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatL2BaseShift", _wrap_new_IndexFlatL2BaseShift, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_search", _wrap_IndexFlatL2BaseShift_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatL2BaseShift", _wrap_delete_IndexFlatL2BaseShift, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_swigregister", IndexFlatL2BaseShift_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_refine_index_set", _wrap_IndexRefineFlat_refine_index_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_refine_index_get", _wrap_IndexRefineFlat_refine_index_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_base_index_set", _wrap_IndexRefineFlat_base_index_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_base_index_get", _wrap_IndexRefineFlat_base_index_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_own_fields_set", _wrap_IndexRefineFlat_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_own_fields_get", _wrap_IndexRefineFlat_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_k_factor_set", _wrap_IndexRefineFlat_k_factor_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_k_factor_get", _wrap_IndexRefineFlat_k_factor_get, METH_VARARGS, NULL}, - { (char *)"new_IndexRefineFlat", _wrap_new_IndexRefineFlat, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_train", _wrap_IndexRefineFlat_train, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_add", _wrap_IndexRefineFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_reset", _wrap_IndexRefineFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_search", _wrap_IndexRefineFlat_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexRefineFlat", _wrap_delete_IndexRefineFlat, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_swigregister", IndexRefineFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_continuous_update_set", _wrap_IndexFlat1D_continuous_update_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_continuous_update_get", _wrap_IndexFlat1D_continuous_update_get, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_perm_set", _wrap_IndexFlat1D_perm_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_perm_get", _wrap_IndexFlat1D_perm_get, METH_VARARGS, NULL}, - { (char *)"new_IndexFlat1D", _wrap_new_IndexFlat1D, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_update_permutation", _wrap_IndexFlat1D_update_permutation, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_add", _wrap_IndexFlat1D_add, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_reset", _wrap_IndexFlat1D_reset, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_search", _wrap_IndexFlat1D_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlat1D", _wrap_delete_IndexFlat1D, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_swigregister", IndexFlat1D_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexLSH_nbits_set", _wrap_IndexLSH_nbits_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_nbits_get", _wrap_IndexLSH_nbits_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_bytes_per_vec_set", _wrap_IndexLSH_bytes_per_vec_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_bytes_per_vec_get", _wrap_IndexLSH_bytes_per_vec_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rotate_data_set", _wrap_IndexLSH_rotate_data_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rotate_data_get", _wrap_IndexLSH_rotate_data_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train_thresholds_set", _wrap_IndexLSH_train_thresholds_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train_thresholds_get", _wrap_IndexLSH_train_thresholds_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rrot_set", _wrap_IndexLSH_rrot_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rrot_get", _wrap_IndexLSH_rrot_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_thresholds_set", _wrap_IndexLSH_thresholds_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_thresholds_get", _wrap_IndexLSH_thresholds_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_codes_set", _wrap_IndexLSH_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_codes_get", _wrap_IndexLSH_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_apply_preprocess", _wrap_IndexLSH_apply_preprocess, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train", _wrap_IndexLSH_train, METH_VARARGS, NULL}, - { (char *)"IndexLSH_add", _wrap_IndexLSH_add, METH_VARARGS, NULL}, - { (char *)"IndexLSH_search", _wrap_IndexLSH_search, METH_VARARGS, NULL}, - { (char *)"IndexLSH_reset", _wrap_IndexLSH_reset, METH_VARARGS, NULL}, - { (char *)"IndexLSH_transfer_thresholds", _wrap_IndexLSH_transfer_thresholds, METH_VARARGS, NULL}, - { (char *)"delete_IndexLSH", _wrap_delete_IndexLSH, METH_VARARGS, NULL}, - { (char *)"new_IndexLSH", _wrap_new_IndexLSH, METH_VARARGS, NULL}, - { (char *)"IndexLSH_swigregister", IndexLSH_swigregister, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_temperature_set", _wrap_SimulatedAnnealingParameters_init_temperature_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_temperature_get", _wrap_SimulatedAnnealingParameters_init_temperature_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_temperature_decay_set", _wrap_SimulatedAnnealingParameters_temperature_decay_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_temperature_decay_get", _wrap_SimulatedAnnealingParameters_temperature_decay_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_iter_set", _wrap_SimulatedAnnealingParameters_n_iter_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_iter_get", _wrap_SimulatedAnnealingParameters_n_iter_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_redo_set", _wrap_SimulatedAnnealingParameters_n_redo_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_redo_get", _wrap_SimulatedAnnealingParameters_n_redo_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_seed_set", _wrap_SimulatedAnnealingParameters_seed_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_seed_get", _wrap_SimulatedAnnealingParameters_seed_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_verbose_set", _wrap_SimulatedAnnealingParameters_verbose_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_verbose_get", _wrap_SimulatedAnnealingParameters_verbose_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_only_bit_flips_set", _wrap_SimulatedAnnealingParameters_only_bit_flips_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_only_bit_flips_get", _wrap_SimulatedAnnealingParameters_only_bit_flips_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_random_set", _wrap_SimulatedAnnealingParameters_init_random_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_random_get", _wrap_SimulatedAnnealingParameters_init_random_get, METH_VARARGS, NULL}, - { (char *)"new_SimulatedAnnealingParameters", _wrap_new_SimulatedAnnealingParameters, METH_VARARGS, NULL}, - { (char *)"delete_SimulatedAnnealingParameters", _wrap_delete_SimulatedAnnealingParameters, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_swigregister", SimulatedAnnealingParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_n_set", _wrap_PermutationObjective_n_set, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_n_get", _wrap_PermutationObjective_n_get, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_compute_cost", _wrap_PermutationObjective_compute_cost, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_cost_update", _wrap_PermutationObjective_cost_update, METH_VARARGS, NULL}, - { (char *)"delete_PermutationObjective", _wrap_delete_PermutationObjective, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_swigregister", PermutationObjective_swigregister, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight_factor_set", _wrap_ReproduceDistancesObjective_dis_weight_factor_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight_factor_get", _wrap_ReproduceDistancesObjective_dis_weight_factor_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_sqr", _wrap_ReproduceDistancesObjective_sqr, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight", _wrap_ReproduceDistancesObjective_dis_weight, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_source_dis_set", _wrap_ReproduceDistancesObjective_source_dis_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_source_dis_get", _wrap_ReproduceDistancesObjective_source_dis_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_target_dis_set", _wrap_ReproduceDistancesObjective_target_dis_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_target_dis_get", _wrap_ReproduceDistancesObjective_target_dis_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_weights_set", _wrap_ReproduceDistancesObjective_weights_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_weights_get", _wrap_ReproduceDistancesObjective_weights_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_get_source_dis", _wrap_ReproduceDistancesObjective_get_source_dis, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_compute_cost", _wrap_ReproduceDistancesObjective_compute_cost, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_cost_update", _wrap_ReproduceDistancesObjective_cost_update, METH_VARARGS, NULL}, - { (char *)"new_ReproduceDistancesObjective", _wrap_new_ReproduceDistancesObjective, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_compute_mean_stdev", _wrap_ReproduceDistancesObjective_compute_mean_stdev, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_set_affine_target_dis", _wrap_ReproduceDistancesObjective_set_affine_target_dis, METH_VARARGS, NULL}, - { (char *)"delete_ReproduceDistancesObjective", _wrap_delete_ReproduceDistancesObjective, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_swigregister", ReproduceDistancesObjective_swigregister, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_obj_set", _wrap_SimulatedAnnealingOptimizer_obj_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_obj_get", _wrap_SimulatedAnnealingOptimizer_obj_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_n_set", _wrap_SimulatedAnnealingOptimizer_n_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_n_get", _wrap_SimulatedAnnealingOptimizer_n_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_logfile_set", _wrap_SimulatedAnnealingOptimizer_logfile_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_logfile_get", _wrap_SimulatedAnnealingOptimizer_logfile_get, METH_VARARGS, NULL}, - { (char *)"new_SimulatedAnnealingOptimizer", _wrap_new_SimulatedAnnealingOptimizer, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_rnd_set", _wrap_SimulatedAnnealingOptimizer_rnd_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_rnd_get", _wrap_SimulatedAnnealingOptimizer_rnd_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_init_cost_set", _wrap_SimulatedAnnealingOptimizer_init_cost_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_init_cost_get", _wrap_SimulatedAnnealingOptimizer_init_cost_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_optimize", _wrap_SimulatedAnnealingOptimizer_optimize, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_run_optimization", _wrap_SimulatedAnnealingOptimizer_run_optimization, METH_VARARGS, NULL}, - { (char *)"delete_SimulatedAnnealingOptimizer", _wrap_delete_SimulatedAnnealingOptimizer, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_swigregister", SimulatedAnnealingOptimizer_swigregister, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimization_type_set", _wrap_PolysemousTraining_optimization_type_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimization_type_get", _wrap_PolysemousTraining_optimization_type_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_ntrain_permutation_set", _wrap_PolysemousTraining_ntrain_permutation_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_ntrain_permutation_get", _wrap_PolysemousTraining_ntrain_permutation_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_dis_weight_factor_set", _wrap_PolysemousTraining_dis_weight_factor_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_dis_weight_factor_get", _wrap_PolysemousTraining_dis_weight_factor_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_log_pattern_set", _wrap_PolysemousTraining_log_pattern_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_log_pattern_get", _wrap_PolysemousTraining_log_pattern_get, METH_VARARGS, NULL}, - { (char *)"new_PolysemousTraining", _wrap_new_PolysemousTraining, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_pq_for_hamming", _wrap_PolysemousTraining_optimize_pq_for_hamming, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_ranking", _wrap_PolysemousTraining_optimize_ranking, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_reproduce_distances", _wrap_PolysemousTraining_optimize_reproduce_distances, METH_VARARGS, NULL}, - { (char *)"delete_PolysemousTraining", _wrap_delete_PolysemousTraining, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_swigregister", PolysemousTraining_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPQ_pq_set", _wrap_IndexPQ_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_pq_get", _wrap_IndexPQ_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_codes_set", _wrap_IndexPQ_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_codes_get", _wrap_IndexPQ_codes_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPQ", _wrap_new_IndexPQ, METH_VARARGS, NULL}, - { (char *)"IndexPQ_train", _wrap_IndexPQ_train, METH_VARARGS, NULL}, - { (char *)"IndexPQ_add", _wrap_IndexPQ_add, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search", _wrap_IndexPQ_search, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reset", _wrap_IndexPQ_reset, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reconstruct_n", _wrap_IndexPQ_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reconstruct", _wrap_IndexPQ_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPQ_remove_ids", _wrap_IndexPQ_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexPQ_do_polysemous_training_set", _wrap_IndexPQ_do_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_do_polysemous_training_get", _wrap_IndexPQ_do_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_training_set", _wrap_IndexPQ_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_training_get", _wrap_IndexPQ_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_type_set", _wrap_IndexPQ_search_type_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_type_get", _wrap_IndexPQ_search_type_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_encode_signs_set", _wrap_IndexPQ_encode_signs_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_encode_signs_get", _wrap_IndexPQ_encode_signs_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_ht_set", _wrap_IndexPQ_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_ht_get", _wrap_IndexPQ_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_core_polysemous", _wrap_IndexPQ_search_core_polysemous, METH_VARARGS, NULL}, - { (char *)"IndexPQ_hamming_distance_histogram", _wrap_IndexPQ_hamming_distance_histogram, METH_VARARGS, NULL}, - { (char *)"IndexPQ_hamming_distance_table", _wrap_IndexPQ_hamming_distance_table, METH_VARARGS, NULL}, - { (char *)"delete_IndexPQ", _wrap_delete_IndexPQ, METH_VARARGS, NULL}, - { (char *)"IndexPQ_swigregister", IndexPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_nq_set", _wrap_IndexPQStats_nq_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_nq_get", _wrap_IndexPQStats_nq_get, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_ncode_set", _wrap_IndexPQStats_ncode_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_ncode_get", _wrap_IndexPQStats_ncode_get, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_n_hamming_pass_set", _wrap_IndexPQStats_n_hamming_pass_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_n_hamming_pass_get", _wrap_IndexPQStats_n_hamming_pass_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPQStats", _wrap_new_IndexPQStats, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_reset", _wrap_IndexPQStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexPQStats", _wrap_delete_IndexPQStats, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_swigregister", IndexPQStats_swigregister, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_pq_set", _wrap_MultiIndexQuantizer_pq_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_pq_get", _wrap_MultiIndexQuantizer_pq_get, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_train", _wrap_MultiIndexQuantizer_train, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_search", _wrap_MultiIndexQuantizer_search, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_add", _wrap_MultiIndexQuantizer_add, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_reset", _wrap_MultiIndexQuantizer_reset, METH_VARARGS, NULL}, - { (char *)"new_MultiIndexQuantizer", _wrap_new_MultiIndexQuantizer, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_reconstruct", _wrap_MultiIndexQuantizer_reconstruct, METH_VARARGS, NULL}, - { (char *)"delete_MultiIndexQuantizer", _wrap_delete_MultiIndexQuantizer, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_swigregister", MultiIndexQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_assign_indexes_set", _wrap_MultiIndexQuantizer2_assign_indexes_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_assign_indexes_get", _wrap_MultiIndexQuantizer2_assign_indexes_get, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_own_fields_set", _wrap_MultiIndexQuantizer2_own_fields_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_own_fields_get", _wrap_MultiIndexQuantizer2_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_MultiIndexQuantizer2", _wrap_new_MultiIndexQuantizer2, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_train", _wrap_MultiIndexQuantizer2_train, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_search", _wrap_MultiIndexQuantizer2_search, METH_VARARGS, NULL}, - { (char *)"delete_MultiIndexQuantizer2", _wrap_delete_MultiIndexQuantizer2, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_swigregister", MultiIndexQuantizer2_swigregister, METH_VARARGS, NULL}, - { (char *)"InvertedLists_nlist_set", _wrap_InvertedLists_nlist_set, METH_VARARGS, NULL}, - { (char *)"InvertedLists_nlist_get", _wrap_InvertedLists_nlist_get, METH_VARARGS, NULL}, - { (char *)"InvertedLists_code_size_set", _wrap_InvertedLists_code_size_set, METH_VARARGS, NULL}, - { (char *)"InvertedLists_code_size_get", _wrap_InvertedLists_code_size_get, METH_VARARGS, NULL}, - { (char *)"InvertedLists_list_size", _wrap_InvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_codes", _wrap_InvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_ids", _wrap_InvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"InvertedLists_release_codes", _wrap_InvertedLists_release_codes, METH_VARARGS, NULL}, - { (char *)"InvertedLists_release_ids", _wrap_InvertedLists_release_ids, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_single_id", _wrap_InvertedLists_get_single_id, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_single_code", _wrap_InvertedLists_get_single_code, METH_VARARGS, NULL}, - { (char *)"InvertedLists_prefetch_lists", _wrap_InvertedLists_prefetch_lists, METH_VARARGS, NULL}, - { (char *)"InvertedLists_add_entry", _wrap_InvertedLists_add_entry, METH_VARARGS, NULL}, - { (char *)"InvertedLists_add_entries", _wrap_InvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"InvertedLists_update_entry", _wrap_InvertedLists_update_entry, METH_VARARGS, NULL}, - { (char *)"InvertedLists_update_entries", _wrap_InvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"InvertedLists_resize", _wrap_InvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"InvertedLists_reset", _wrap_InvertedLists_reset, METH_VARARGS, NULL}, - { (char *)"InvertedLists_merge_from", _wrap_InvertedLists_merge_from, METH_VARARGS, NULL}, - { (char *)"delete_InvertedLists", _wrap_delete_InvertedLists, METH_VARARGS, NULL}, - { (char *)"InvertedLists_imbalance_factor", _wrap_InvertedLists_imbalance_factor, METH_VARARGS, NULL}, - { (char *)"InvertedLists_print_stats", _wrap_InvertedLists_print_stats, METH_VARARGS, NULL}, - { (char *)"InvertedLists_swigregister", InvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_codes_set", _wrap_ArrayInvertedLists_codes_set, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_codes_get", _wrap_ArrayInvertedLists_codes_get, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_ids_set", _wrap_ArrayInvertedLists_ids_set, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_ids_get", _wrap_ArrayInvertedLists_ids_get, METH_VARARGS, NULL}, - { (char *)"new_ArrayInvertedLists", _wrap_new_ArrayInvertedLists, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_list_size", _wrap_ArrayInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_get_codes", _wrap_ArrayInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_get_ids", _wrap_ArrayInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_add_entries", _wrap_ArrayInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_update_entries", _wrap_ArrayInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_resize", _wrap_ArrayInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"delete_ArrayInvertedLists", _wrap_delete_ArrayInvertedLists, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_swigregister", ArrayInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_ils_set", _wrap_ConcatenatedInvertedLists_ils_set, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_ils_get", _wrap_ConcatenatedInvertedLists_ils_get, METH_VARARGS, NULL}, - { (char *)"new_ConcatenatedInvertedLists", _wrap_new_ConcatenatedInvertedLists, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_list_size", _wrap_ConcatenatedInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_codes", _wrap_ConcatenatedInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_ids", _wrap_ConcatenatedInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_release_codes", _wrap_ConcatenatedInvertedLists_release_codes, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_release_ids", _wrap_ConcatenatedInvertedLists_release_ids, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_single_id", _wrap_ConcatenatedInvertedLists_get_single_id, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_single_code", _wrap_ConcatenatedInvertedLists_get_single_code, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_add_entries", _wrap_ConcatenatedInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_update_entries", _wrap_ConcatenatedInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_resize", _wrap_ConcatenatedInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"delete_ConcatenatedInvertedLists", _wrap_delete_ConcatenatedInvertedLists, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_swigregister", ConcatenatedInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_set", _wrap_Level1Quantizer_quantizer_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_get", _wrap_Level1Quantizer_quantizer_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_nlist_set", _wrap_Level1Quantizer_nlist_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_nlist_get", _wrap_Level1Quantizer_nlist_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_trains_alone_set", _wrap_Level1Quantizer_quantizer_trains_alone_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_trains_alone_get", _wrap_Level1Quantizer_quantizer_trains_alone_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_own_fields_set", _wrap_Level1Quantizer_own_fields_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_own_fields_get", _wrap_Level1Quantizer_own_fields_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_cp_set", _wrap_Level1Quantizer_cp_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_cp_get", _wrap_Level1Quantizer_cp_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_clustering_index_set", _wrap_Level1Quantizer_clustering_index_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_clustering_index_get", _wrap_Level1Quantizer_clustering_index_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_train_q1", _wrap_Level1Quantizer_train_q1, METH_VARARGS, NULL}, - { (char *)"new_Level1Quantizer", _wrap_new_Level1Quantizer, METH_VARARGS, NULL}, - { (char *)"delete_Level1Quantizer", _wrap_delete_Level1Quantizer, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_swigregister", Level1Quantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_nprobe_set", _wrap_IVFSearchParameters_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_nprobe_get", _wrap_IVFSearchParameters_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_max_codes_set", _wrap_IVFSearchParameters_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_max_codes_get", _wrap_IVFSearchParameters_max_codes_get, METH_VARARGS, NULL}, - { (char *)"delete_IVFSearchParameters", _wrap_delete_IVFSearchParameters, METH_VARARGS, NULL}, - { (char *)"new_IVFSearchParameters", _wrap_new_IVFSearchParameters, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_swigregister", IVFSearchParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVF_invlists_set", _wrap_IndexIVF_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_invlists_get", _wrap_IndexIVF_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_own_invlists_set", _wrap_IndexIVF_own_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_own_invlists_get", _wrap_IndexIVF_own_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_code_size_set", _wrap_IndexIVF_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_code_size_get", _wrap_IndexIVF_code_size_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_nprobe_set", _wrap_IndexIVF_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_nprobe_get", _wrap_IndexIVF_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_max_codes_set", _wrap_IndexIVF_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_max_codes_get", _wrap_IndexIVF_max_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_maintain_direct_map_set", _wrap_IndexIVF_maintain_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_maintain_direct_map_get", _wrap_IndexIVF_maintain_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_direct_map_set", _wrap_IndexIVF_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_direct_map_get", _wrap_IndexIVF_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reset", _wrap_IndexIVF_reset, METH_VARARGS, NULL}, - { (char *)"IndexIVF_train", _wrap_IndexIVF_train, METH_VARARGS, NULL}, - { (char *)"IndexIVF_add", _wrap_IndexIVF_add, METH_VARARGS, NULL}, - { (char *)"IndexIVF_encode_vectors", _wrap_IndexIVF_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVF_train_residual", _wrap_IndexIVF_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search_preassigned", _wrap_IndexIVF_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search", _wrap_IndexIVF_search, METH_VARARGS, NULL}, - { (char *)"IndexIVF_range_search", _wrap_IndexIVF_range_search, METH_VARARGS, NULL}, - { (char *)"IndexIVF_get_InvertedListScanner", _wrap_IndexIVF_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct", _wrap_IndexIVF_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct_n", _wrap_IndexIVF_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search_and_reconstruct", _wrap_IndexIVF_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct_from_offset", _wrap_IndexIVF_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVF_remove_ids", _wrap_IndexIVF_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVF_check_compatible_for_merge", _wrap_IndexIVF_check_compatible_for_merge, METH_VARARGS, NULL}, - { (char *)"IndexIVF_merge_from", _wrap_IndexIVF_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexIVF_copy_subset_to", _wrap_IndexIVF_copy_subset_to, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVF", _wrap_delete_IndexIVF, METH_VARARGS, NULL}, - { (char *)"IndexIVF_get_list_size", _wrap_IndexIVF_get_list_size, METH_VARARGS, NULL}, - { (char *)"IndexIVF_make_direct_map", _wrap_IndexIVF_make_direct_map, METH_VARARGS, NULL}, - { (char *)"IndexIVF_replace_invlists", _wrap_IndexIVF_replace_invlists, METH_VARARGS, NULL}, - { (char *)"IndexIVF_swigregister", IndexIVF_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nq_set", _wrap_IndexIVFStats_nq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nq_get", _wrap_IndexIVFStats_nq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nlist_set", _wrap_IndexIVFStats_nlist_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nlist_get", _wrap_IndexIVFStats_nlist_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_ndis_set", _wrap_IndexIVFStats_ndis_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_ndis_get", _wrap_IndexIVFStats_ndis_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nheap_updates_set", _wrap_IndexIVFStats_nheap_updates_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nheap_updates_get", _wrap_IndexIVFStats_nheap_updates_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_quantization_time_set", _wrap_IndexIVFStats_quantization_time_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_quantization_time_get", _wrap_IndexIVFStats_quantization_time_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_search_time_set", _wrap_IndexIVFStats_search_time_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_search_time_get", _wrap_IndexIVFStats_search_time_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFStats", _wrap_new_IndexIVFStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_reset", _wrap_IndexIVFStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFStats", _wrap_delete_IndexIVFStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_swigregister", IndexIVFStats_swigregister, METH_VARARGS, NULL}, - { (char *)"check_compatible_for_merge", _wrap_check_compatible_for_merge, METH_VARARGS, NULL}, - { (char *)"extract_index_ivf", _wrap_extract_index_ivf, METH_VARARGS, NULL}, - { (char *)"merge_into", _wrap_merge_into, METH_VARARGS, NULL}, - { (char *)"search_centroid", _wrap_search_centroid, METH_VARARGS, NULL}, - { (char *)"search_and_return_centroids", _wrap_search_and_return_centroids, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_index_set", _wrap_SlidingIndexWindow_index_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_index_get", _wrap_SlidingIndexWindow_index_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_ils_set", _wrap_SlidingIndexWindow_ils_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_ils_get", _wrap_SlidingIndexWindow_ils_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_n_slice_set", _wrap_SlidingIndexWindow_n_slice_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_n_slice_get", _wrap_SlidingIndexWindow_n_slice_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_nlist_set", _wrap_SlidingIndexWindow_nlist_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_nlist_get", _wrap_SlidingIndexWindow_nlist_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_sizes_set", _wrap_SlidingIndexWindow_sizes_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_sizes_get", _wrap_SlidingIndexWindow_sizes_get, METH_VARARGS, NULL}, - { (char *)"new_SlidingIndexWindow", _wrap_new_SlidingIndexWindow, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_step", _wrap_SlidingIndexWindow_step, METH_VARARGS, NULL}, - { (char *)"delete_SlidingIndexWindow", _wrap_delete_SlidingIndexWindow, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_swigregister", SlidingIndexWindow_swigregister, METH_VARARGS, NULL}, - { (char *)"get_invlist_range", _wrap_get_invlist_range, METH_VARARGS, NULL}, - { (char *)"set_invlist_range", _wrap_set_invlist_range, METH_VARARGS, NULL}, - { (char *)"search_with_parameters", _wrap_search_with_parameters, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_qtype_set", _wrap_ScalarQuantizer_qtype_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_qtype_get", _wrap_ScalarQuantizer_qtype_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_set", _wrap_ScalarQuantizer_rangestat_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_get", _wrap_ScalarQuantizer_rangestat_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_arg_set", _wrap_ScalarQuantizer_rangestat_arg_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_arg_get", _wrap_ScalarQuantizer_rangestat_arg_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_d_set", _wrap_ScalarQuantizer_d_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_d_get", _wrap_ScalarQuantizer_d_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_code_size_set", _wrap_ScalarQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_code_size_get", _wrap_ScalarQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_trained_set", _wrap_ScalarQuantizer_trained_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_trained_get", _wrap_ScalarQuantizer_trained_get, METH_VARARGS, NULL}, - { (char *)"new_ScalarQuantizer", _wrap_new_ScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_train", _wrap_ScalarQuantizer_train, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_compute_codes", _wrap_ScalarQuantizer_compute_codes, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_decode", _wrap_ScalarQuantizer_decode, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_get_distance_computer", _wrap_ScalarQuantizer_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_ScalarQuantizer", _wrap_delete_ScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_swigregister", ScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_sq_set", _wrap_IndexScalarQuantizer_sq_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_sq_get", _wrap_IndexScalarQuantizer_sq_get, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_codes_set", _wrap_IndexScalarQuantizer_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_codes_get", _wrap_IndexScalarQuantizer_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_code_size_set", _wrap_IndexScalarQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_code_size_get", _wrap_IndexScalarQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"new_IndexScalarQuantizer", _wrap_new_IndexScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_train", _wrap_IndexScalarQuantizer_train, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_add", _wrap_IndexScalarQuantizer_add, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_search", _wrap_IndexScalarQuantizer_search, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reset", _wrap_IndexScalarQuantizer_reset, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reconstruct_n", _wrap_IndexScalarQuantizer_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reconstruct", _wrap_IndexScalarQuantizer_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_get_distance_computer", _wrap_IndexScalarQuantizer_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexScalarQuantizer", _wrap_delete_IndexScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_swigregister", IndexScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_sq_set", _wrap_IndexIVFScalarQuantizer_sq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_sq_get", _wrap_IndexIVFScalarQuantizer_sq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_by_residual_set", _wrap_IndexIVFScalarQuantizer_by_residual_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_by_residual_get", _wrap_IndexIVFScalarQuantizer_by_residual_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFScalarQuantizer", _wrap_new_IndexIVFScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_train_residual", _wrap_IndexIVFScalarQuantizer_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_encode_vectors", _wrap_IndexIVFScalarQuantizer_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_add_with_ids", _wrap_IndexIVFScalarQuantizer_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_get_InvertedListScanner", _wrap_IndexIVFScalarQuantizer_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_reconstruct_from_offset", _wrap_IndexIVFScalarQuantizer_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFScalarQuantizer", _wrap_delete_IndexIVFScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_swigregister", IndexIVFScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"HNSW_assign_probas_set", _wrap_HNSW_assign_probas_set, METH_VARARGS, NULL}, - { (char *)"HNSW_assign_probas_get", _wrap_HNSW_assign_probas_get, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nneighbor_per_level_set", _wrap_HNSW_cum_nneighbor_per_level_set, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nneighbor_per_level_get", _wrap_HNSW_cum_nneighbor_per_level_get, METH_VARARGS, NULL}, - { (char *)"HNSW_levels_set", _wrap_HNSW_levels_set, METH_VARARGS, NULL}, - { (char *)"HNSW_levels_get", _wrap_HNSW_levels_get, METH_VARARGS, NULL}, - { (char *)"HNSW_offsets_set", _wrap_HNSW_offsets_set, METH_VARARGS, NULL}, - { (char *)"HNSW_offsets_get", _wrap_HNSW_offsets_get, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbors_set", _wrap_HNSW_neighbors_set, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbors_get", _wrap_HNSW_neighbors_get, METH_VARARGS, NULL}, - { (char *)"HNSW_entry_point_set", _wrap_HNSW_entry_point_set, METH_VARARGS, NULL}, - { (char *)"HNSW_entry_point_get", _wrap_HNSW_entry_point_get, METH_VARARGS, NULL}, - { (char *)"HNSW_rng_set", _wrap_HNSW_rng_set, METH_VARARGS, NULL}, - { (char *)"HNSW_rng_get", _wrap_HNSW_rng_get, METH_VARARGS, NULL}, - { (char *)"HNSW_max_level_set", _wrap_HNSW_max_level_set, METH_VARARGS, NULL}, - { (char *)"HNSW_max_level_get", _wrap_HNSW_max_level_get, METH_VARARGS, NULL}, - { (char *)"HNSW_efConstruction_set", _wrap_HNSW_efConstruction_set, METH_VARARGS, NULL}, - { (char *)"HNSW_efConstruction_get", _wrap_HNSW_efConstruction_get, METH_VARARGS, NULL}, - { (char *)"HNSW_efSearch_set", _wrap_HNSW_efSearch_set, METH_VARARGS, NULL}, - { (char *)"HNSW_efSearch_get", _wrap_HNSW_efSearch_get, METH_VARARGS, NULL}, - { (char *)"HNSW_check_relative_distance_set", _wrap_HNSW_check_relative_distance_set, METH_VARARGS, NULL}, - { (char *)"HNSW_check_relative_distance_get", _wrap_HNSW_check_relative_distance_get, METH_VARARGS, NULL}, - { (char *)"HNSW_upper_beam_set", _wrap_HNSW_upper_beam_set, METH_VARARGS, NULL}, - { (char *)"HNSW_upper_beam_get", _wrap_HNSW_upper_beam_get, METH_VARARGS, NULL}, - { (char *)"HNSW_search_bounded_queue_set", _wrap_HNSW_search_bounded_queue_set, METH_VARARGS, NULL}, - { (char *)"HNSW_search_bounded_queue_get", _wrap_HNSW_search_bounded_queue_get, METH_VARARGS, NULL}, - { (char *)"HNSW_set_default_probas", _wrap_HNSW_set_default_probas, METH_VARARGS, NULL}, - { (char *)"HNSW_set_nb_neighbors", _wrap_HNSW_set_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_nb_neighbors", _wrap_HNSW_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nb_neighbors", _wrap_HNSW_cum_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbor_range", _wrap_HNSW_neighbor_range, METH_VARARGS, NULL}, - { (char *)"new_HNSW", _wrap_new_HNSW, METH_VARARGS, NULL}, - { (char *)"HNSW_random_level", _wrap_HNSW_random_level, METH_VARARGS, NULL}, - { (char *)"HNSW_fill_with_random_links", _wrap_HNSW_fill_with_random_links, METH_VARARGS, NULL}, - { (char *)"HNSW_add_links_starting_from", _wrap_HNSW_add_links_starting_from, METH_VARARGS, NULL}, - { (char *)"HNSW_add_with_locks", _wrap_HNSW_add_with_locks, METH_VARARGS, NULL}, - { (char *)"HNSW_search_from_candidates", _wrap_HNSW_search_from_candidates, METH_VARARGS, NULL}, - { (char *)"HNSW_search_from_candidate_unbounded", _wrap_HNSW_search_from_candidate_unbounded, METH_VARARGS, NULL}, - { (char *)"HNSW_search", _wrap_HNSW_search, METH_VARARGS, NULL}, - { (char *)"HNSW_reset", _wrap_HNSW_reset, METH_VARARGS, NULL}, - { (char *)"HNSW_clear_neighbor_tables", _wrap_HNSW_clear_neighbor_tables, METH_VARARGS, NULL}, - { (char *)"HNSW_print_neighbor_stats", _wrap_HNSW_print_neighbor_stats, METH_VARARGS, NULL}, - { (char *)"HNSW_prepare_level_tab", _wrap_HNSW_prepare_level_tab, METH_VARARGS, NULL}, - { (char *)"HNSW_shrink_neighbor_list", _wrap_HNSW_shrink_neighbor_list, METH_VARARGS, NULL}, - { (char *)"delete_HNSW", _wrap_delete_HNSW, METH_VARARGS, NULL}, - { (char *)"HNSW_swigregister", HNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visited_set", _wrap_VisitedTable_visited_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visited_get", _wrap_VisitedTable_visited_get, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visno_set", _wrap_VisitedTable_visno_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visno_get", _wrap_VisitedTable_visno_get, METH_VARARGS, NULL}, - { (char *)"new_VisitedTable", _wrap_new_VisitedTable, METH_VARARGS, NULL}, - { (char *)"VisitedTable_set", _wrap_VisitedTable_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_get", _wrap_VisitedTable_get, METH_VARARGS, NULL}, - { (char *)"VisitedTable_advance", _wrap_VisitedTable_advance, METH_VARARGS, NULL}, - { (char *)"delete_VisitedTable", _wrap_delete_VisitedTable, METH_VARARGS, NULL}, - { (char *)"VisitedTable_swigregister", VisitedTable_swigregister, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n1_set", _wrap_HNSWStats_n1_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n1_get", _wrap_HNSWStats_n1_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n2_set", _wrap_HNSWStats_n2_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n2_get", _wrap_HNSWStats_n2_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n3_set", _wrap_HNSWStats_n3_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n3_get", _wrap_HNSWStats_n3_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_ndis_set", _wrap_HNSWStats_ndis_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_ndis_get", _wrap_HNSWStats_ndis_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_nreorder_set", _wrap_HNSWStats_nreorder_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_nreorder_get", _wrap_HNSWStats_nreorder_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_view_set", _wrap_HNSWStats_view_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_view_get", _wrap_HNSWStats_view_get, METH_VARARGS, NULL}, - { (char *)"new_HNSWStats", _wrap_new_HNSWStats, METH_VARARGS, NULL}, - { (char *)"HNSWStats_reset", _wrap_HNSWStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_HNSWStats", _wrap_delete_HNSWStats, METH_VARARGS, NULL}, - { (char *)"HNSWStats_swigregister", HNSWStats_swigregister, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_index_get", _wrap_ReconstructFromNeighbors_index_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_M_set", _wrap_ReconstructFromNeighbors_M_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_M_get", _wrap_ReconstructFromNeighbors_M_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_set", _wrap_ReconstructFromNeighbors_k_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_get", _wrap_ReconstructFromNeighbors_k_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_nsq_set", _wrap_ReconstructFromNeighbors_nsq_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_nsq_get", _wrap_ReconstructFromNeighbors_nsq_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_code_size_set", _wrap_ReconstructFromNeighbors_code_size_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_code_size_get", _wrap_ReconstructFromNeighbors_code_size_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_reorder_set", _wrap_ReconstructFromNeighbors_k_reorder_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_reorder_get", _wrap_ReconstructFromNeighbors_k_reorder_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codebook_set", _wrap_ReconstructFromNeighbors_codebook_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codebook_get", _wrap_ReconstructFromNeighbors_codebook_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codes_set", _wrap_ReconstructFromNeighbors_codes_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codes_get", _wrap_ReconstructFromNeighbors_codes_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_ntotal_set", _wrap_ReconstructFromNeighbors_ntotal_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_ntotal_get", _wrap_ReconstructFromNeighbors_ntotal_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_d_set", _wrap_ReconstructFromNeighbors_d_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_d_get", _wrap_ReconstructFromNeighbors_d_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_dsub_set", _wrap_ReconstructFromNeighbors_dsub_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_dsub_get", _wrap_ReconstructFromNeighbors_dsub_get, METH_VARARGS, NULL}, - { (char *)"new_ReconstructFromNeighbors", _wrap_new_ReconstructFromNeighbors, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_add_codes", _wrap_ReconstructFromNeighbors_add_codes, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_compute_distances", _wrap_ReconstructFromNeighbors_compute_distances, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_estimate_code", _wrap_ReconstructFromNeighbors_estimate_code, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_reconstruct", _wrap_ReconstructFromNeighbors_reconstruct, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_reconstruct_n", _wrap_ReconstructFromNeighbors_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_get_neighbor_table", _wrap_ReconstructFromNeighbors_get_neighbor_table, METH_VARARGS, NULL}, - { (char *)"delete_ReconstructFromNeighbors", _wrap_delete_ReconstructFromNeighbors, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_swigregister", ReconstructFromNeighbors_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_hnsw_set", _wrap_IndexHNSW_hnsw_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_hnsw_get", _wrap_IndexHNSW_hnsw_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_own_fields_set", _wrap_IndexHNSW_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_own_fields_get", _wrap_IndexHNSW_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_storage_set", _wrap_IndexHNSW_storage_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_storage_get", _wrap_IndexHNSW_storage_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct_from_neighbors_set", _wrap_IndexHNSW_reconstruct_from_neighbors_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct_from_neighbors_get", _wrap_IndexHNSW_reconstruct_from_neighbors_get, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSW", _wrap_delete_IndexHNSW, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_get_distance_computer", _wrap_IndexHNSW_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_add", _wrap_IndexHNSW_add, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_train", _wrap_IndexHNSW_train, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_search", _wrap_IndexHNSW_search, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct", _wrap_IndexHNSW_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reset", _wrap_IndexHNSW_reset, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_shrink_level_0_neighbors", _wrap_IndexHNSW_shrink_level_0_neighbors, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_search_level_0", _wrap_IndexHNSW_search_level_0, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_init_level_0_from_knngraph", _wrap_IndexHNSW_init_level_0_from_knngraph, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_init_level_0_from_entry_points", _wrap_IndexHNSW_init_level_0_from_entry_points, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reorder_links", _wrap_IndexHNSW_reorder_links, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_link_singletons", _wrap_IndexHNSW_link_singletons, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_swigregister", IndexHNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWFlat", _wrap_new_IndexHNSWFlat, METH_VARARGS, NULL}, - { (char *)"IndexHNSWFlat_get_distance_computer", _wrap_IndexHNSWFlat_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWFlat", _wrap_delete_IndexHNSWFlat, METH_VARARGS, NULL}, - { (char *)"IndexHNSWFlat_swigregister", IndexHNSWFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWPQ", _wrap_new_IndexHNSWPQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_train", _wrap_IndexHNSWPQ_train, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_get_distance_computer", _wrap_IndexHNSWPQ_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWPQ", _wrap_delete_IndexHNSWPQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_swigregister", IndexHNSWPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWSQ", _wrap_new_IndexHNSWSQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWSQ_get_distance_computer", _wrap_IndexHNSWSQ_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWSQ", _wrap_delete_IndexHNSWSQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWSQ_swigregister", IndexHNSWSQ_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSW2Level", _wrap_new_IndexHNSW2Level, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_get_distance_computer", _wrap_IndexHNSW2Level_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_flip_to_ivf", _wrap_IndexHNSW2Level_flip_to_ivf, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_search", _wrap_IndexHNSW2Level_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSW2Level", _wrap_delete_IndexHNSW2Level, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_swigregister", IndexHNSW2Level_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_add_core", _wrap_IndexIVFFlat_add_core, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_add_with_ids", _wrap_IndexIVFFlat_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_encode_vectors", _wrap_IndexIVFFlat_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_get_InvertedListScanner", _wrap_IndexIVFFlat_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_update_vectors", _wrap_IndexIVFFlat_update_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_reconstruct_from_offset", _wrap_IndexIVFFlat_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFFlat", _wrap_new_IndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFFlat", _wrap_delete_IndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_swigregister", IndexIVFFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_instances_set", _wrap_IndexIVFFlatDedup_instances_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_instances_get", _wrap_IndexIVFFlatDedup_instances_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_train", _wrap_IndexIVFFlatDedup_train, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_add_with_ids", _wrap_IndexIVFFlatDedup_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_search_preassigned", _wrap_IndexIVFFlatDedup_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_remove_ids", _wrap_IndexIVFFlatDedup_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_range_search", _wrap_IndexIVFFlatDedup_range_search, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_update_vectors", _wrap_IndexIVFFlatDedup_update_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_reconstruct_from_offset", _wrap_IndexIVFFlatDedup_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFFlatDedup", _wrap_new_IndexIVFFlatDedup, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFFlatDedup", _wrap_delete_IndexIVFFlatDedup, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_swigregister", IndexIVFFlatDedup_swigregister, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_lists_set", _wrap_OnDiskInvertedLists_lists_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_lists_get", _wrap_OnDiskInvertedLists_lists_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_slots_set", _wrap_OnDiskInvertedLists_slots_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_slots_get", _wrap_OnDiskInvertedLists_slots_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_filename_set", _wrap_OnDiskInvertedLists_filename_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_filename_get", _wrap_OnDiskInvertedLists_filename_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_totsize_set", _wrap_OnDiskInvertedLists_totsize_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_totsize_get", _wrap_OnDiskInvertedLists_totsize_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_ptr_set", _wrap_OnDiskInvertedLists_ptr_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_ptr_get", _wrap_OnDiskInvertedLists_ptr_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_read_only_set", _wrap_OnDiskInvertedLists_read_only_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_read_only_get", _wrap_OnDiskInvertedLists_read_only_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_list_size", _wrap_OnDiskInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_get_codes", _wrap_OnDiskInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_get_ids", _wrap_OnDiskInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_add_entries", _wrap_OnDiskInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_update_entries", _wrap_OnDiskInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_resize", _wrap_OnDiskInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_merge_from", _wrap_OnDiskInvertedLists_merge_from, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_prefetch_lists", _wrap_OnDiskInvertedLists_prefetch_lists, METH_VARARGS, NULL}, - { (char *)"delete_OnDiskInvertedLists", _wrap_delete_OnDiskInvertedLists, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_locks_set", _wrap_OnDiskInvertedLists_locks_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_locks_get", _wrap_OnDiskInvertedLists_locks_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_pf_set", _wrap_OnDiskInvertedLists_pf_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_pf_get", _wrap_OnDiskInvertedLists_pf_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_do_mmap", _wrap_OnDiskInvertedLists_do_mmap, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_update_totsize", _wrap_OnDiskInvertedLists_update_totsize, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_resize_locked", _wrap_OnDiskInvertedLists_resize_locked, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_allocate_slot", _wrap_OnDiskInvertedLists_allocate_slot, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_free_slot", _wrap_OnDiskInvertedLists_free_slot, METH_VARARGS, NULL}, - { (char *)"new_OnDiskInvertedLists", _wrap_new_OnDiskInvertedLists, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_swigregister", OnDiskInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_scan_table_threshold_set", _wrap_IVFPQSearchParameters_scan_table_threshold_set, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_scan_table_threshold_get", _wrap_IVFPQSearchParameters_scan_table_threshold_get, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_polysemous_ht_set", _wrap_IVFPQSearchParameters_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_polysemous_ht_get", _wrap_IVFPQSearchParameters_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"delete_IVFPQSearchParameters", _wrap_delete_IVFPQSearchParameters, METH_VARARGS, NULL}, - { (char *)"new_IVFPQSearchParameters", _wrap_new_IVFPQSearchParameters, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_swigregister", IVFPQSearchParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_by_residual_set", _wrap_IndexIVFPQ_by_residual_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_by_residual_get", _wrap_IndexIVFPQ_by_residual_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_pq_set", _wrap_IndexIVFPQ_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_pq_get", _wrap_IndexIVFPQ_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_do_polysemous_training_set", _wrap_IndexIVFPQ_do_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_do_polysemous_training_get", _wrap_IndexIVFPQ_do_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_training_set", _wrap_IndexIVFPQ_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_training_get", _wrap_IndexIVFPQ_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_scan_table_threshold_set", _wrap_IndexIVFPQ_scan_table_threshold_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_scan_table_threshold_get", _wrap_IndexIVFPQ_scan_table_threshold_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_ht_set", _wrap_IndexIVFPQ_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_ht_get", _wrap_IndexIVFPQ_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_use_precomputed_table_set", _wrap_IndexIVFPQ_use_precomputed_table_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_use_precomputed_table_get", _wrap_IndexIVFPQ_use_precomputed_table_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_max_bytes_get", _wrap_IndexIVFPQ_precomputed_table_max_bytes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_max_bytes_set", _wrap_IndexIVFPQ_precomputed_table_max_bytes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_set", _wrap_IndexIVFPQ_precomputed_table_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_get", _wrap_IndexIVFPQ_precomputed_table_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_add_with_ids", _wrap_IndexIVFPQ_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode_vectors", _wrap_IndexIVFPQ_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_add_core_o", _wrap_IndexIVFPQ_add_core_o, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_train_residual", _wrap_IndexIVFPQ_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_train_residual_o", _wrap_IndexIVFPQ_train_residual_o, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_reconstruct_from_offset", _wrap_IndexIVFPQ_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_find_duplicates", _wrap_IndexIVFPQ_find_duplicates, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode", _wrap_IndexIVFPQ_encode, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode_multiple", _wrap_IndexIVFPQ_encode_multiple, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_decode_multiple", _wrap_IndexIVFPQ_decode_multiple, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_get_InvertedListScanner", _wrap_IndexIVFPQ_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precompute_table", _wrap_IndexIVFPQ_precompute_table, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQ", _wrap_new_IndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQ", _wrap_delete_IndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_swigregister", IndexIVFPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_nrefine_set", _wrap_IndexIVFPQStats_nrefine_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_nrefine_get", _wrap_IndexIVFPQStats_nrefine_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_n_hamming_pass_set", _wrap_IndexIVFPQStats_n_hamming_pass_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_n_hamming_pass_get", _wrap_IndexIVFPQStats_n_hamming_pass_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_search_cycles_set", _wrap_IndexIVFPQStats_search_cycles_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_search_cycles_get", _wrap_IndexIVFPQStats_search_cycles_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_refine_cycles_set", _wrap_IndexIVFPQStats_refine_cycles_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_refine_cycles_get", _wrap_IndexIVFPQStats_refine_cycles_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQStats", _wrap_new_IndexIVFPQStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_reset", _wrap_IndexIVFPQStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQStats", _wrap_delete_IndexIVFPQStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_swigregister", IndexIVFPQStats_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_pq_set", _wrap_IndexIVFPQR_refine_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_pq_get", _wrap_IndexIVFPQR_refine_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_codes_set", _wrap_IndexIVFPQR_refine_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_codes_get", _wrap_IndexIVFPQR_refine_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_k_factor_set", _wrap_IndexIVFPQR_k_factor_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_k_factor_get", _wrap_IndexIVFPQR_k_factor_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_reset", _wrap_IndexIVFPQR_reset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_remove_ids", _wrap_IndexIVFPQR_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_train_residual", _wrap_IndexIVFPQR_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_add_with_ids", _wrap_IndexIVFPQR_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_add_core", _wrap_IndexIVFPQR_add_core, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_reconstruct_from_offset", _wrap_IndexIVFPQR_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_merge_from", _wrap_IndexIVFPQR_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_search_preassigned", _wrap_IndexIVFPQR_search_preassigned, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQR", _wrap_new_IndexIVFPQR, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQR", _wrap_delete_IndexIVFPQR, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_swigregister", IndexIVFPQR_swigregister, METH_VARARGS, NULL}, - { (char *)"Index2Layer_q1_set", _wrap_Index2Layer_q1_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_q1_get", _wrap_Index2Layer_q1_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_pq_set", _wrap_Index2Layer_pq_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_pq_get", _wrap_Index2Layer_pq_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_codes_set", _wrap_Index2Layer_codes_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_codes_get", _wrap_Index2Layer_codes_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_1_set", _wrap_Index2Layer_code_size_1_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_1_get", _wrap_Index2Layer_code_size_1_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_2_set", _wrap_Index2Layer_code_size_2_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_2_get", _wrap_Index2Layer_code_size_2_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_set", _wrap_Index2Layer_code_size_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_get", _wrap_Index2Layer_code_size_get, METH_VARARGS, NULL}, - { (char *)"new_Index2Layer", _wrap_new_Index2Layer, METH_VARARGS, NULL}, - { (char *)"delete_Index2Layer", _wrap_delete_Index2Layer, METH_VARARGS, NULL}, - { (char *)"Index2Layer_train", _wrap_Index2Layer_train, METH_VARARGS, NULL}, - { (char *)"Index2Layer_add", _wrap_Index2Layer_add, METH_VARARGS, NULL}, - { (char *)"Index2Layer_search", _wrap_Index2Layer_search, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reconstruct_n", _wrap_Index2Layer_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reconstruct", _wrap_Index2Layer_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reset", _wrap_Index2Layer_reset, METH_VARARGS, NULL}, - { (char *)"Index2Layer_transfer_to_IVFPQ", _wrap_Index2Layer_transfer_to_IVFPQ, METH_VARARGS, NULL}, - { (char *)"Index2Layer_swigregister", Index2Layer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinary_d_set", _wrap_IndexBinary_d_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_d_get", _wrap_IndexBinary_d_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_code_size_set", _wrap_IndexBinary_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_code_size_get", _wrap_IndexBinary_code_size_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_ntotal_set", _wrap_IndexBinary_ntotal_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_ntotal_get", _wrap_IndexBinary_ntotal_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_verbose_set", _wrap_IndexBinary_verbose_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_verbose_get", _wrap_IndexBinary_verbose_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_is_trained_set", _wrap_IndexBinary_is_trained_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_is_trained_get", _wrap_IndexBinary_is_trained_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_metric_type_set", _wrap_IndexBinary_metric_type_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_metric_type_get", _wrap_IndexBinary_metric_type_get, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinary", _wrap_delete_IndexBinary, METH_VARARGS, NULL}, - { (char *)"IndexBinary_train", _wrap_IndexBinary_train, METH_VARARGS, NULL}, - { (char *)"IndexBinary_add", _wrap_IndexBinary_add, METH_VARARGS, NULL}, - { (char *)"IndexBinary_add_with_ids", _wrap_IndexBinary_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinary_search", _wrap_IndexBinary_search, METH_VARARGS, NULL}, - { (char *)"IndexBinary_range_search", _wrap_IndexBinary_range_search, METH_VARARGS, NULL}, - { (char *)"IndexBinary_assign", _wrap_IndexBinary_assign, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reset", _wrap_IndexBinary_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinary_remove_ids", _wrap_IndexBinary_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reconstruct", _wrap_IndexBinary_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reconstruct_n", _wrap_IndexBinary_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexBinary_search_and_reconstruct", _wrap_IndexBinary_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinary_display", _wrap_IndexBinary_display, METH_VARARGS, NULL}, - { (char *)"IndexBinary_swigregister", IndexBinary_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_xb_set", _wrap_IndexBinaryFlat_xb_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_xb_get", _wrap_IndexBinaryFlat_xb_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_use_heap_set", _wrap_IndexBinaryFlat_use_heap_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_use_heap_get", _wrap_IndexBinaryFlat_use_heap_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_query_batch_size_set", _wrap_IndexBinaryFlat_query_batch_size_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_query_batch_size_get", _wrap_IndexBinaryFlat_query_batch_size_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_add", _wrap_IndexBinaryFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_reset", _wrap_IndexBinaryFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_search", _wrap_IndexBinaryFlat_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_reconstruct", _wrap_IndexBinaryFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_remove_ids", _wrap_IndexBinaryFlat_remove_ids, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryFlat", _wrap_new_IndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryFlat", _wrap_delete_IndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_swigregister", IndexBinaryFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_invlists_set", _wrap_IndexBinaryIVF_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_invlists_get", _wrap_IndexBinaryIVF_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_invlists_set", _wrap_IndexBinaryIVF_own_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_invlists_get", _wrap_IndexBinaryIVF_own_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nprobe_set", _wrap_IndexBinaryIVF_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nprobe_get", _wrap_IndexBinaryIVF_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_max_codes_set", _wrap_IndexBinaryIVF_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_max_codes_get", _wrap_IndexBinaryIVF_max_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_use_heap_set", _wrap_IndexBinaryIVF_use_heap_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_use_heap_get", _wrap_IndexBinaryIVF_use_heap_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_maintain_direct_map_set", _wrap_IndexBinaryIVF_maintain_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_maintain_direct_map_get", _wrap_IndexBinaryIVF_maintain_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_direct_map_set", _wrap_IndexBinaryIVF_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_direct_map_get", _wrap_IndexBinaryIVF_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_quantizer_set", _wrap_IndexBinaryIVF_quantizer_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_quantizer_get", _wrap_IndexBinaryIVF_quantizer_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nlist_set", _wrap_IndexBinaryIVF_nlist_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nlist_get", _wrap_IndexBinaryIVF_nlist_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_fields_set", _wrap_IndexBinaryIVF_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_fields_get", _wrap_IndexBinaryIVF_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_cp_set", _wrap_IndexBinaryIVF_cp_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_cp_get", _wrap_IndexBinaryIVF_cp_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_clustering_index_set", _wrap_IndexBinaryIVF_clustering_index_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_clustering_index_get", _wrap_IndexBinaryIVF_clustering_index_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryIVF", _wrap_new_IndexBinaryIVF, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryIVF", _wrap_delete_IndexBinaryIVF, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reset", _wrap_IndexBinaryIVF_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_train", _wrap_IndexBinaryIVF_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add", _wrap_IndexBinaryIVF_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add_with_ids", _wrap_IndexBinaryIVF_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add_core", _wrap_IndexBinaryIVF_add_core, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search_preassigned", _wrap_IndexBinaryIVF_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_get_InvertedListScanner", _wrap_IndexBinaryIVF_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search", _wrap_IndexBinaryIVF_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct", _wrap_IndexBinaryIVF_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct_n", _wrap_IndexBinaryIVF_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search_and_reconstruct", _wrap_IndexBinaryIVF_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct_from_offset", _wrap_IndexBinaryIVF_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_remove_ids", _wrap_IndexBinaryIVF_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_merge_from", _wrap_IndexBinaryIVF_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_get_list_size", _wrap_IndexBinaryIVF_get_list_size, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_make_direct_map", _wrap_IndexBinaryIVF_make_direct_map, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_replace_invlists", _wrap_IndexBinaryIVF_replace_invlists, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_swigregister", IndexBinaryIVF_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_index_set", _wrap_IndexBinaryFromFloat_index_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_index_get", _wrap_IndexBinaryFromFloat_index_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_own_fields_set", _wrap_IndexBinaryFromFloat_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_own_fields_get", _wrap_IndexBinaryFromFloat_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryFromFloat", _wrap_new_IndexBinaryFromFloat, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryFromFloat", _wrap_delete_IndexBinaryFromFloat, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_add", _wrap_IndexBinaryFromFloat_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_reset", _wrap_IndexBinaryFromFloat_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_search", _wrap_IndexBinaryFromFloat_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_train", _wrap_IndexBinaryFromFloat_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_swigregister", IndexBinaryFromFloat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_hnsw_set", _wrap_IndexBinaryHNSW_hnsw_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_hnsw_get", _wrap_IndexBinaryHNSW_hnsw_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_own_fields_set", _wrap_IndexBinaryHNSW_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_own_fields_get", _wrap_IndexBinaryHNSW_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_storage_set", _wrap_IndexBinaryHNSW_storage_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_storage_get", _wrap_IndexBinaryHNSW_storage_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryHNSW", _wrap_new_IndexBinaryHNSW, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryHNSW", _wrap_delete_IndexBinaryHNSW, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_get_distance_computer", _wrap_IndexBinaryHNSW_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_add", _wrap_IndexBinaryHNSW_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_train", _wrap_IndexBinaryHNSW_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_search", _wrap_IndexBinaryHNSW_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_reconstruct", _wrap_IndexBinaryHNSW_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_reset", _wrap_IndexBinaryHNSW_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_swigregister", IndexBinaryHNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexShards_shard_indexes_set", _wrap_IndexShards_shard_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_shard_indexes_get", _wrap_IndexShards_shard_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_own_fields_set", _wrap_IndexShards_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_own_fields_get", _wrap_IndexShards_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_threaded_set", _wrap_IndexShards_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_threaded_get", _wrap_IndexShards_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_successive_ids_set", _wrap_IndexShards_successive_ids_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_successive_ids_get", _wrap_IndexShards_successive_ids_get, METH_VARARGS, NULL}, - { (char *)"new_IndexShards", _wrap_new_IndexShards, METH_VARARGS, NULL}, - { (char *)"IndexShards_add_shard", _wrap_IndexShards_add_shard, METH_VARARGS, NULL}, - { (char *)"IndexShards_sync_with_shard_indexes", _wrap_IndexShards_sync_with_shard_indexes, METH_VARARGS, NULL}, - { (char *)"IndexShards_at", _wrap_IndexShards_at, METH_VARARGS, NULL}, - { (char *)"IndexShards_add", _wrap_IndexShards_add, METH_VARARGS, NULL}, - { (char *)"IndexShards_add_with_ids", _wrap_IndexShards_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexShards_search", _wrap_IndexShards_search, METH_VARARGS, NULL}, - { (char *)"IndexShards_train", _wrap_IndexShards_train, METH_VARARGS, NULL}, - { (char *)"IndexShards_reset", _wrap_IndexShards_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexShards", _wrap_delete_IndexShards, METH_VARARGS, NULL}, - { (char *)"IndexShards_swigregister", IndexShards_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_shard_indexes_set", _wrap_IndexBinaryShards_shard_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_shard_indexes_get", _wrap_IndexBinaryShards_shard_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_own_fields_set", _wrap_IndexBinaryShards_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_own_fields_get", _wrap_IndexBinaryShards_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_threaded_set", _wrap_IndexBinaryShards_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_threaded_get", _wrap_IndexBinaryShards_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_successive_ids_set", _wrap_IndexBinaryShards_successive_ids_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_successive_ids_get", _wrap_IndexBinaryShards_successive_ids_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryShards", _wrap_new_IndexBinaryShards, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add_shard", _wrap_IndexBinaryShards_add_shard, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_sync_with_shard_indexes", _wrap_IndexBinaryShards_sync_with_shard_indexes, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_at", _wrap_IndexBinaryShards_at, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add", _wrap_IndexBinaryShards_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add_with_ids", _wrap_IndexBinaryShards_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_search", _wrap_IndexBinaryShards_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_train", _wrap_IndexBinaryShards_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_reset", _wrap_IndexBinaryShards_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryShards", _wrap_delete_IndexBinaryShards, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_swigregister", IndexBinaryShards_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexReplicas", _wrap_new_IndexReplicas, METH_VARARGS, NULL}, - { (char *)"delete_IndexReplicas", _wrap_delete_IndexReplicas, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_addIndex", _wrap_IndexReplicas_addIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_removeIndex", _wrap_IndexReplicas_removeIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_runOnIndex", _wrap_IndexReplicas_runOnIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_reset", _wrap_IndexReplicas_reset, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_train", _wrap_IndexReplicas_train, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_add", _wrap_IndexReplicas_add, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_search", _wrap_IndexReplicas_search, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_reconstruct", _wrap_IndexReplicas_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_own_fields_set", _wrap_IndexReplicas_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_own_fields_get", _wrap_IndexReplicas_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_count", _wrap_IndexReplicas_count, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_at", _wrap_IndexReplicas_at, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_swigregister", IndexReplicas_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryReplicas", _wrap_new_IndexBinaryReplicas, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryReplicas", _wrap_delete_IndexBinaryReplicas, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_addIndex", _wrap_IndexBinaryReplicas_addIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_removeIndex", _wrap_IndexBinaryReplicas_removeIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_runOnIndex", _wrap_IndexBinaryReplicas_runOnIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_reset", _wrap_IndexBinaryReplicas_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_train", _wrap_IndexBinaryReplicas_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_add", _wrap_IndexBinaryReplicas_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_search", _wrap_IndexBinaryReplicas_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_reconstruct", _wrap_IndexBinaryReplicas_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_own_fields_set", _wrap_IndexBinaryReplicas_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_own_fields_get", _wrap_IndexBinaryReplicas_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_count", _wrap_IndexBinaryReplicas_count, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_at", _wrap_IndexBinaryReplicas_at, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_swigregister", IndexBinaryReplicas_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_index_set", _wrap_IndexIDMap_index_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_index_get", _wrap_IndexIDMap_index_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_own_fields_set", _wrap_IndexIDMap_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_own_fields_get", _wrap_IndexIDMap_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_id_map_set", _wrap_IndexIDMap_id_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_id_map_get", _wrap_IndexIDMap_id_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_add_with_ids", _wrap_IndexIDMap_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_add", _wrap_IndexIDMap_add, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_search", _wrap_IndexIDMap_search, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_train", _wrap_IndexIDMap_train, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_reset", _wrap_IndexIDMap_reset, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_remove_ids", _wrap_IndexIDMap_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_range_search", _wrap_IndexIDMap_range_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexIDMap", _wrap_delete_IndexIDMap, METH_VARARGS, NULL}, - { (char *)"new_IndexIDMap", _wrap_new_IndexIDMap, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_swigregister", IndexIDMap_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_rev_map_set", _wrap_IndexIDMap2_rev_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_rev_map_get", _wrap_IndexIDMap2_rev_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_construct_rev_map", _wrap_IndexIDMap2_construct_rev_map, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_add_with_ids", _wrap_IndexIDMap2_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_remove_ids", _wrap_IndexIDMap2_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_reconstruct", _wrap_IndexIDMap2_reconstruct, METH_VARARGS, NULL}, - { (char *)"delete_IndexIDMap2", _wrap_delete_IndexIDMap2, METH_VARARGS, NULL}, - { (char *)"new_IndexIDMap2", _wrap_new_IndexIDMap2, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_swigregister", IndexIDMap2_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_own_fields_set", _wrap_IndexSplitVectors_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_own_fields_get", _wrap_IndexSplitVectors_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_threaded_set", _wrap_IndexSplitVectors_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_threaded_get", _wrap_IndexSplitVectors_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sub_indexes_set", _wrap_IndexSplitVectors_sub_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sub_indexes_get", _wrap_IndexSplitVectors_sub_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sum_d_set", _wrap_IndexSplitVectors_sum_d_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sum_d_get", _wrap_IndexSplitVectors_sum_d_get, METH_VARARGS, NULL}, - { (char *)"new_IndexSplitVectors", _wrap_new_IndexSplitVectors, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_add_sub_index", _wrap_IndexSplitVectors_add_sub_index, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sync_with_sub_indexes", _wrap_IndexSplitVectors_sync_with_sub_indexes, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_add", _wrap_IndexSplitVectors_add, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_search", _wrap_IndexSplitVectors_search, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_train", _wrap_IndexSplitVectors_train, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_reset", _wrap_IndexSplitVectors_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexSplitVectors", _wrap_delete_IndexSplitVectors, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_swigregister", IndexSplitVectors_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuClonerOptions", _wrap_new_GpuClonerOptions, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_indicesOptions_set", _wrap_GpuClonerOptions_indicesOptions_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_indicesOptions_get", _wrap_GpuClonerOptions_indicesOptions_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_useFloat16CoarseQuantizer_set", _wrap_GpuClonerOptions_useFloat16CoarseQuantizer_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_useFloat16CoarseQuantizer_get", _wrap_GpuClonerOptions_useFloat16CoarseQuantizer_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_useFloat16_set", _wrap_GpuClonerOptions_useFloat16_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_useFloat16_get", _wrap_GpuClonerOptions_useFloat16_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_usePrecomputed_set", _wrap_GpuClonerOptions_usePrecomputed_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_usePrecomputed_get", _wrap_GpuClonerOptions_usePrecomputed_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_reserveVecs_set", _wrap_GpuClonerOptions_reserveVecs_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_reserveVecs_get", _wrap_GpuClonerOptions_reserveVecs_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_storeTransposed_set", _wrap_GpuClonerOptions_storeTransposed_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_storeTransposed_get", _wrap_GpuClonerOptions_storeTransposed_get, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_verbose_set", _wrap_GpuClonerOptions_verbose_set, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_verbose_get", _wrap_GpuClonerOptions_verbose_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuClonerOptions", _wrap_delete_GpuClonerOptions, METH_VARARGS, NULL}, - { (char *)"GpuClonerOptions_swigregister", GpuClonerOptions_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuMultipleClonerOptions", _wrap_new_GpuMultipleClonerOptions, METH_VARARGS, NULL}, - { (char *)"GpuMultipleClonerOptions_shard_set", _wrap_GpuMultipleClonerOptions_shard_set, METH_VARARGS, NULL}, - { (char *)"GpuMultipleClonerOptions_shard_get", _wrap_GpuMultipleClonerOptions_shard_get, METH_VARARGS, NULL}, - { (char *)"GpuMultipleClonerOptions_shard_type_set", _wrap_GpuMultipleClonerOptions_shard_type_set, METH_VARARGS, NULL}, - { (char *)"GpuMultipleClonerOptions_shard_type_get", _wrap_GpuMultipleClonerOptions_shard_type_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuMultipleClonerOptions", _wrap_delete_GpuMultipleClonerOptions, METH_VARARGS, NULL}, - { (char *)"GpuMultipleClonerOptions_swigregister", GpuMultipleClonerOptions_swigregister, METH_VARARGS, NULL}, - { (char *)"allocMemorySpaceV", _wrap_allocMemorySpaceV, METH_VARARGS, NULL}, - { (char *)"freeMemorySpace", _wrap_freeMemorySpace, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexConfig", _wrap_new_GpuIndexConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexConfig_device_set", _wrap_GpuIndexConfig_device_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexConfig_device_get", _wrap_GpuIndexConfig_device_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexConfig_memorySpace_set", _wrap_GpuIndexConfig_memorySpace_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexConfig_memorySpace_get", _wrap_GpuIndexConfig_memorySpace_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexConfig", _wrap_delete_GpuIndexConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexConfig_swigregister", GpuIndexConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"GpuIndex_getDevice", _wrap_GpuIndex_getDevice, METH_VARARGS, NULL}, - { (char *)"GpuIndex_getResources", _wrap_GpuIndex_getResources, METH_VARARGS, NULL}, - { (char *)"GpuIndex_setMinPagingSize", _wrap_GpuIndex_setMinPagingSize, METH_VARARGS, NULL}, - { (char *)"GpuIndex_getMinPagingSize", _wrap_GpuIndex_getMinPagingSize, METH_VARARGS, NULL}, - { (char *)"GpuIndex_add", _wrap_GpuIndex_add, METH_VARARGS, NULL}, - { (char *)"GpuIndex_add_with_ids", _wrap_GpuIndex_add_with_ids, METH_VARARGS, NULL}, - { (char *)"GpuIndex_search", _wrap_GpuIndex_search, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndex", _wrap_delete_GpuIndex, METH_VARARGS, NULL}, - { (char *)"GpuIndex_swigregister", GpuIndex_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexFlatConfig", _wrap_new_GpuIndexFlatConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_useFloat16_set", _wrap_GpuIndexFlatConfig_useFloat16_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_useFloat16_get", _wrap_GpuIndexFlatConfig_useFloat16_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_useFloat16Accumulator_set", _wrap_GpuIndexFlatConfig_useFloat16Accumulator_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_useFloat16Accumulator_get", _wrap_GpuIndexFlatConfig_useFloat16Accumulator_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_storeTransposed_set", _wrap_GpuIndexFlatConfig_storeTransposed_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_storeTransposed_get", _wrap_GpuIndexFlatConfig_storeTransposed_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexFlatConfig", _wrap_delete_GpuIndexFlatConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatConfig_swigregister", GpuIndexFlatConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexFlat", _wrap_new_GpuIndexFlat, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexFlat", _wrap_delete_GpuIndexFlat, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_copyFrom", _wrap_GpuIndexFlat_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_copyTo", _wrap_GpuIndexFlat_copyTo, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_getNumVecs", _wrap_GpuIndexFlat_getNumVecs, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_reset", _wrap_GpuIndexFlat_reset, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_train", _wrap_GpuIndexFlat_train, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_add", _wrap_GpuIndexFlat_add, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_reconstruct", _wrap_GpuIndexFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_reconstruct_n", _wrap_GpuIndexFlat_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_getGpuData", _wrap_GpuIndexFlat_getGpuData, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlat_swigregister", GpuIndexFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexFlatL2", _wrap_new_GpuIndexFlatL2, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatL2_copyFrom", _wrap_GpuIndexFlatL2_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatL2_copyTo", _wrap_GpuIndexFlatL2_copyTo, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexFlatL2", _wrap_delete_GpuIndexFlatL2, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatL2_swigregister", GpuIndexFlatL2_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexFlatIP", _wrap_new_GpuIndexFlatIP, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatIP_copyFrom", _wrap_GpuIndexFlatIP_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatIP_copyTo", _wrap_GpuIndexFlatIP_copyTo, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexFlatIP", _wrap_delete_GpuIndexFlatIP, METH_VARARGS, NULL}, - { (char *)"GpuIndexFlatIP_swigregister", GpuIndexFlatIP_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexIVFConfig", _wrap_new_GpuIndexIVFConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFConfig_indicesOptions_set", _wrap_GpuIndexIVFConfig_indicesOptions_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFConfig_indicesOptions_get", _wrap_GpuIndexIVFConfig_indicesOptions_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFConfig_flatConfig_set", _wrap_GpuIndexIVFConfig_flatConfig_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFConfig_flatConfig_get", _wrap_GpuIndexIVFConfig_flatConfig_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVFConfig", _wrap_delete_GpuIndexIVFConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFConfig_swigregister", GpuIndexIVFConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVF", _wrap_delete_GpuIndexIVF, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_copyFrom", _wrap_GpuIndexIVF_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_copyTo", _wrap_GpuIndexIVF_copyTo, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_getNumLists", _wrap_GpuIndexIVF_getNumLists, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_getQuantizer", _wrap_GpuIndexIVF_getQuantizer, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_setNumProbes", _wrap_GpuIndexIVF_setNumProbes, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_getNumProbes", _wrap_GpuIndexIVF_getNumProbes, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_cp_set", _wrap_GpuIndexIVF_cp_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_cp_get", _wrap_GpuIndexIVF_cp_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVF_swigregister", GpuIndexIVF_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexIVFPQConfig", _wrap_new_GpuIndexIVFPQConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQConfig_useFloat16LookupTables_set", _wrap_GpuIndexIVFPQConfig_useFloat16LookupTables_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQConfig_useFloat16LookupTables_get", _wrap_GpuIndexIVFPQConfig_useFloat16LookupTables_get, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQConfig_usePrecomputedTables_set", _wrap_GpuIndexIVFPQConfig_usePrecomputedTables_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQConfig_usePrecomputedTables_get", _wrap_GpuIndexIVFPQConfig_usePrecomputedTables_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVFPQConfig", _wrap_delete_GpuIndexIVFPQConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQConfig_swigregister", GpuIndexIVFPQConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexIVFPQ", _wrap_new_GpuIndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVFPQ", _wrap_delete_GpuIndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_copyFrom", _wrap_GpuIndexIVFPQ_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_copyTo", _wrap_GpuIndexIVFPQ_copyTo, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_reserveMemory", _wrap_GpuIndexIVFPQ_reserveMemory, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_setPrecomputedCodes", _wrap_GpuIndexIVFPQ_setPrecomputedCodes, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getPrecomputedCodes", _wrap_GpuIndexIVFPQ_getPrecomputedCodes, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getNumSubQuantizers", _wrap_GpuIndexIVFPQ_getNumSubQuantizers, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getBitsPerCode", _wrap_GpuIndexIVFPQ_getBitsPerCode, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getCentroidsPerSubQuantizer", _wrap_GpuIndexIVFPQ_getCentroidsPerSubQuantizer, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_reclaimMemory", _wrap_GpuIndexIVFPQ_reclaimMemory, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_reset", _wrap_GpuIndexIVFPQ_reset, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_train", _wrap_GpuIndexIVFPQ_train, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getListLength", _wrap_GpuIndexIVFPQ_getListLength, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getListCodes", _wrap_GpuIndexIVFPQ_getListCodes, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_getListIndices", _wrap_GpuIndexIVFPQ_getListIndices, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFPQ_swigregister", GpuIndexIVFPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexIVFFlatConfig", _wrap_new_GpuIndexIVFFlatConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlatConfig_useFloat16IVFStorage_set", _wrap_GpuIndexIVFFlatConfig_useFloat16IVFStorage_set, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlatConfig_useFloat16IVFStorage_get", _wrap_GpuIndexIVFFlatConfig_useFloat16IVFStorage_get, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVFFlatConfig", _wrap_delete_GpuIndexIVFFlatConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlatConfig_swigregister", GpuIndexIVFFlatConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexIVFFlat", _wrap_new_GpuIndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexIVFFlat", _wrap_delete_GpuIndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_reserveMemory", _wrap_GpuIndexIVFFlat_reserveMemory, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_copyFrom", _wrap_GpuIndexIVFFlat_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_copyTo", _wrap_GpuIndexIVFFlat_copyTo, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_reclaimMemory", _wrap_GpuIndexIVFFlat_reclaimMemory, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_reset", _wrap_GpuIndexIVFFlat_reset, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_train", _wrap_GpuIndexIVFFlat_train, METH_VARARGS, NULL}, - { (char *)"GpuIndexIVFFlat_swigregister", GpuIndexIVFFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexBinaryFlatConfig", _wrap_new_GpuIndexBinaryFlatConfig, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexBinaryFlatConfig", _wrap_delete_GpuIndexBinaryFlatConfig, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlatConfig_swigregister", GpuIndexBinaryFlatConfig_swigregister, METH_VARARGS, NULL}, - { (char *)"new_GpuIndexBinaryFlat", _wrap_new_GpuIndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"delete_GpuIndexBinaryFlat", _wrap_delete_GpuIndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_copyFrom", _wrap_GpuIndexBinaryFlat_copyFrom, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_copyTo", _wrap_GpuIndexBinaryFlat_copyTo, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_add", _wrap_GpuIndexBinaryFlat_add, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_reset", _wrap_GpuIndexBinaryFlat_reset, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_search", _wrap_GpuIndexBinaryFlat_search, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_reconstruct", _wrap_GpuIndexBinaryFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"GpuIndexBinaryFlat_swigregister", GpuIndexBinaryFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"bruteForceKnn", _wrap_bruteForceKnn, METH_VARARGS, NULL}, - { (char *)"downcast_index", _wrap_downcast_index, METH_VARARGS, NULL}, - { (char *)"downcast_VectorTransform", _wrap_downcast_VectorTransform, METH_VARARGS, NULL}, - { (char *)"downcast_IndexBinary", _wrap_downcast_IndexBinary, METH_VARARGS, NULL}, - { (char *)"write_index", _wrap_write_index, METH_VARARGS, NULL}, - { (char *)"write_index_binary", _wrap_write_index_binary, METH_VARARGS, NULL}, - { (char *)"read_index", _wrap_read_index, METH_VARARGS, NULL}, - { (char *)"read_index_binary", _wrap_read_index_binary, METH_VARARGS, NULL}, - { (char *)"write_VectorTransform", _wrap_write_VectorTransform, METH_VARARGS, NULL}, - { (char *)"read_VectorTransform", _wrap_read_VectorTransform, METH_VARARGS, NULL}, - { (char *)"read_ProductQuantizer", _wrap_read_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"write_ProductQuantizer", _wrap_write_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"write_InvertedLists", _wrap_write_InvertedLists, METH_VARARGS, NULL}, - { (char *)"read_InvertedLists", _wrap_read_InvertedLists, METH_VARARGS, NULL}, - { (char *)"clone_index", _wrap_clone_index, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_VectorTransform", _wrap_Cloner_clone_VectorTransform, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_Index", _wrap_Cloner_clone_Index, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_IndexIVF", _wrap_Cloner_clone_IndexIVF, METH_VARARGS, NULL}, - { (char *)"delete_Cloner", _wrap_delete_Cloner, METH_VARARGS, NULL}, - { (char *)"new_Cloner", _wrap_new_Cloner, METH_VARARGS, NULL}, - { (char *)"Cloner_swigregister", Cloner_swigregister, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nq_set", _wrap_AutoTuneCriterion_nq_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nq_get", _wrap_AutoTuneCriterion_nq_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nnn_set", _wrap_AutoTuneCriterion_nnn_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nnn_get", _wrap_AutoTuneCriterion_nnn_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_nnn_set", _wrap_AutoTuneCriterion_gt_nnn_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_nnn_get", _wrap_AutoTuneCriterion_gt_nnn_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_D_set", _wrap_AutoTuneCriterion_gt_D_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_D_get", _wrap_AutoTuneCriterion_gt_D_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_I_set", _wrap_AutoTuneCriterion_gt_I_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_I_get", _wrap_AutoTuneCriterion_gt_I_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_set_groundtruth", _wrap_AutoTuneCriterion_set_groundtruth, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_evaluate", _wrap_AutoTuneCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_AutoTuneCriterion", _wrap_delete_AutoTuneCriterion, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_swigregister", AutoTuneCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_R_set", _wrap_OneRecallAtRCriterion_R_set, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_R_get", _wrap_OneRecallAtRCriterion_R_get, METH_VARARGS, NULL}, - { (char *)"new_OneRecallAtRCriterion", _wrap_new_OneRecallAtRCriterion, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_evaluate", _wrap_OneRecallAtRCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_OneRecallAtRCriterion", _wrap_delete_OneRecallAtRCriterion, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_swigregister", OneRecallAtRCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_R_set", _wrap_IntersectionCriterion_R_set, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_R_get", _wrap_IntersectionCriterion_R_get, METH_VARARGS, NULL}, - { (char *)"new_IntersectionCriterion", _wrap_new_IntersectionCriterion, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_evaluate", _wrap_IntersectionCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_IntersectionCriterion", _wrap_delete_IntersectionCriterion, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_swigregister", IntersectionCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_perf_set", _wrap_OperatingPoint_perf_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_perf_get", _wrap_OperatingPoint_perf_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_t_set", _wrap_OperatingPoint_t_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_t_get", _wrap_OperatingPoint_t_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_key_set", _wrap_OperatingPoint_key_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_key_get", _wrap_OperatingPoint_key_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_cno_set", _wrap_OperatingPoint_cno_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_cno_get", _wrap_OperatingPoint_cno_get, METH_VARARGS, NULL}, - { (char *)"new_OperatingPoint", _wrap_new_OperatingPoint, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPoint", _wrap_delete_OperatingPoint, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_swigregister", OperatingPoint_swigregister, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_pts_set", _wrap_OperatingPoints_all_pts_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_pts_get", _wrap_OperatingPoints_all_pts_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_pts_set", _wrap_OperatingPoints_optimal_pts_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_pts_get", _wrap_OperatingPoints_optimal_pts_get, METH_VARARGS, NULL}, - { (char *)"new_OperatingPoints", _wrap_new_OperatingPoints, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_merge_with", _wrap_OperatingPoints_merge_with, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_clear", _wrap_OperatingPoints_clear, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_add", _wrap_OperatingPoints_add, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_t_for_perf", _wrap_OperatingPoints_t_for_perf, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_display", _wrap_OperatingPoints_display, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_to_gnuplot", _wrap_OperatingPoints_all_to_gnuplot, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_to_gnuplot", _wrap_OperatingPoints_optimal_to_gnuplot, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPoints", _wrap_delete_OperatingPoints, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_swigregister", OperatingPoints_swigregister, METH_VARARGS, NULL}, - { (char *)"ParameterRange_name_set", _wrap_ParameterRange_name_set, METH_VARARGS, NULL}, - { (char *)"ParameterRange_name_get", _wrap_ParameterRange_name_get, METH_VARARGS, NULL}, - { (char *)"ParameterRange_values_set", _wrap_ParameterRange_values_set, METH_VARARGS, NULL}, - { (char *)"ParameterRange_values_get", _wrap_ParameterRange_values_get, METH_VARARGS, NULL}, - { (char *)"new_ParameterRange", _wrap_new_ParameterRange, METH_VARARGS, NULL}, - { (char *)"delete_ParameterRange", _wrap_delete_ParameterRange, METH_VARARGS, NULL}, - { (char *)"ParameterRange_swigregister", ParameterRange_swigregister, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_parameter_ranges_set", _wrap_ParameterSpace_parameter_ranges_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_parameter_ranges_get", _wrap_ParameterSpace_parameter_ranges_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_verbose_set", _wrap_ParameterSpace_verbose_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_verbose_get", _wrap_ParameterSpace_verbose_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_experiments_set", _wrap_ParameterSpace_n_experiments_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_experiments_get", _wrap_ParameterSpace_n_experiments_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_batchsize_set", _wrap_ParameterSpace_batchsize_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_batchsize_get", _wrap_ParameterSpace_batchsize_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_thread_over_batches_set", _wrap_ParameterSpace_thread_over_batches_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_thread_over_batches_get", _wrap_ParameterSpace_thread_over_batches_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_min_test_duration_set", _wrap_ParameterSpace_min_test_duration_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_min_test_duration_get", _wrap_ParameterSpace_min_test_duration_get, METH_VARARGS, NULL}, - { (char *)"new_ParameterSpace", _wrap_new_ParameterSpace, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_combinations", _wrap_ParameterSpace_n_combinations, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_combination_ge", _wrap_ParameterSpace_combination_ge, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_combination_name", _wrap_ParameterSpace_combination_name, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_display", _wrap_ParameterSpace_display, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_add_range", _wrap_ParameterSpace_add_range, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_initialize", _wrap_ParameterSpace_initialize, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_set_index_parameters", _wrap_ParameterSpace_set_index_parameters, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_set_index_parameter", _wrap_ParameterSpace_set_index_parameter, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_update_bounds", _wrap_ParameterSpace_update_bounds, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_explore", _wrap_ParameterSpace_explore, METH_VARARGS, NULL}, - { (char *)"delete_ParameterSpace", _wrap_delete_ParameterSpace, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_swigregister", ParameterSpace_swigregister, METH_VARARGS, NULL}, - { (char *)"index_factory", _wrap_index_factory, METH_VARARGS, NULL}, - { (char *)"index_binary_factory", _wrap_index_binary_factory, METH_VARARGS, NULL}, - { (char *)"new_MatrixStats", _wrap_new_MatrixStats, METH_VARARGS, NULL}, - { (char *)"MatrixStats_comments_set", _wrap_MatrixStats_comments_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_comments_get", _wrap_MatrixStats_comments_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_set", _wrap_MatrixStats_n_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_get", _wrap_MatrixStats_n_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_d_set", _wrap_MatrixStats_d_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_d_get", _wrap_MatrixStats_d_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_collision_set", _wrap_MatrixStats_n_collision_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_collision_get", _wrap_MatrixStats_n_collision_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_valid_set", _wrap_MatrixStats_n_valid_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_valid_get", _wrap_MatrixStats_n_valid_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n0_set", _wrap_MatrixStats_n0_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n0_get", _wrap_MatrixStats_n0_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_min_norm2_set", _wrap_MatrixStats_min_norm2_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_min_norm2_get", _wrap_MatrixStats_min_norm2_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_max_norm2_set", _wrap_MatrixStats_max_norm2_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_max_norm2_get", _wrap_MatrixStats_max_norm2_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_per_dim_stats_set", _wrap_MatrixStats_per_dim_stats_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_per_dim_stats_get", _wrap_MatrixStats_per_dim_stats_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_occurrences_set", _wrap_MatrixStats_occurrences_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_occurrences_get", _wrap_MatrixStats_occurrences_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_buf_set", _wrap_MatrixStats_buf_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_buf_get", _wrap_MatrixStats_buf_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_nbuf_set", _wrap_MatrixStats_nbuf_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_nbuf_get", _wrap_MatrixStats_nbuf_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_do_comment", _wrap_MatrixStats_do_comment, METH_VARARGS, NULL}, - { (char *)"delete_MatrixStats", _wrap_delete_MatrixStats, METH_VARARGS, NULL}, - { (char *)"MatrixStats_swigregister", MatrixStats_swigregister, METH_VARARGS, NULL}, - { (char *)"index_gpu_to_cpu", _wrap_index_gpu_to_cpu, METH_VARARGS, NULL}, - { (char *)"index_cpu_to_gpu", _wrap_index_cpu_to_gpu, METH_VARARGS, NULL}, - { (char *)"index_cpu_to_gpu_multiple", _wrap_index_cpu_to_gpu_multiple, METH_VARARGS, NULL}, - { (char *)"GpuParameterSpace_initialize", _wrap_GpuParameterSpace_initialize, METH_VARARGS, NULL}, - { (char *)"GpuParameterSpace_set_index_parameter", _wrap_GpuParameterSpace_set_index_parameter, METH_VARARGS, NULL}, - { (char *)"new_GpuParameterSpace", _wrap_new_GpuParameterSpace, METH_VARARGS, NULL}, - { (char *)"delete_GpuParameterSpace", _wrap_delete_GpuParameterSpace, METH_VARARGS, NULL}, - { (char *)"GpuParameterSpace_swigregister", GpuParameterSpace_swigregister, METH_VARARGS, NULL}, - { (char *)"swig_ptr", _wrap_swig_ptr, METH_VARARGS, NULL}, - { (char *)"rev_swig_ptr", _wrap_rev_swig_ptr, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_nh_set", _wrap_float_minheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_nh_get", _wrap_float_minheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_k_set", _wrap_float_minheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_k_get", _wrap_float_minheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_ids_set", _wrap_float_minheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_ids_get", _wrap_float_minheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_val_set", _wrap_float_minheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_val_get", _wrap_float_minheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_get_val", _wrap_float_minheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_get_ids", _wrap_float_minheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_heapify", _wrap_float_minheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_addn", _wrap_float_minheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_addn_with_ids", _wrap_float_minheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_reorder", _wrap_float_minheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_per_line_extrema", _wrap_float_minheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_float_minheap_array_t", _wrap_new_float_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_float_minheap_array_t", _wrap_delete_float_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_swigregister", float_minheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_nh_set", _wrap_int_minheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_nh_get", _wrap_int_minheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_k_set", _wrap_int_minheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_k_get", _wrap_int_minheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_ids_set", _wrap_int_minheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_ids_get", _wrap_int_minheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_val_set", _wrap_int_minheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_val_get", _wrap_int_minheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_get_val", _wrap_int_minheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_get_ids", _wrap_int_minheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_heapify", _wrap_int_minheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_addn", _wrap_int_minheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_addn_with_ids", _wrap_int_minheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_reorder", _wrap_int_minheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_per_line_extrema", _wrap_int_minheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_int_minheap_array_t", _wrap_new_int_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_int_minheap_array_t", _wrap_delete_int_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_swigregister", int_minheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_nh_set", _wrap_float_maxheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_nh_get", _wrap_float_maxheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_k_set", _wrap_float_maxheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_k_get", _wrap_float_maxheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_ids_set", _wrap_float_maxheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_ids_get", _wrap_float_maxheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_val_set", _wrap_float_maxheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_val_get", _wrap_float_maxheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_get_val", _wrap_float_maxheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_get_ids", _wrap_float_maxheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_heapify", _wrap_float_maxheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_addn", _wrap_float_maxheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_addn_with_ids", _wrap_float_maxheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_reorder", _wrap_float_maxheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_per_line_extrema", _wrap_float_maxheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_float_maxheap_array_t", _wrap_new_float_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_float_maxheap_array_t", _wrap_delete_float_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_swigregister", float_maxheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_nh_set", _wrap_int_maxheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_nh_get", _wrap_int_maxheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_k_set", _wrap_int_maxheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_k_get", _wrap_int_maxheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_ids_set", _wrap_int_maxheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_ids_get", _wrap_int_maxheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_val_set", _wrap_int_maxheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_val_get", _wrap_int_maxheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_get_val", _wrap_int_maxheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_get_ids", _wrap_int_maxheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_heapify", _wrap_int_maxheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_addn", _wrap_int_maxheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_addn_with_ids", _wrap_int_maxheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_reorder", _wrap_int_maxheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_per_line_extrema", _wrap_int_maxheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_int_maxheap_array_t", _wrap_new_int_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_int_maxheap_array_t", _wrap_delete_int_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_swigregister", int_maxheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"omp_set_num_threads", _wrap_omp_set_num_threads, METH_VARARGS, NULL}, - { (char *)"omp_get_max_threads", _wrap_omp_get_max_threads, METH_VARARGS, NULL}, - { (char *)"memcpy", _wrap_memcpy, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_float_ptr", _wrap_cast_integer_to_float_ptr, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_long_ptr", _wrap_cast_integer_to_long_ptr, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_int_ptr", _wrap_cast_integer_to_int_ptr, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_nq_set", _wrap_RangeSearchResult_nq_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_nq_get", _wrap_RangeSearchResult_nq_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_lims_set", _wrap_RangeSearchResult_lims_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_lims_get", _wrap_RangeSearchResult_lims_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_labels_set", _wrap_RangeSearchResult_labels_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_labels_get", _wrap_RangeSearchResult_labels_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_distances_set", _wrap_RangeSearchResult_distances_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_distances_get", _wrap_RangeSearchResult_distances_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_buffer_size_set", _wrap_RangeSearchResult_buffer_size_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_buffer_size_get", _wrap_RangeSearchResult_buffer_size_get, METH_VARARGS, NULL}, - { (char *)"new_RangeSearchResult", _wrap_new_RangeSearchResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_do_allocation", _wrap_RangeSearchResult_do_allocation, METH_VARARGS, NULL}, - { (char *)"delete_RangeSearchResult", _wrap_delete_RangeSearchResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_swigregister", RangeSearchResult_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelector_is_member", _wrap_IDSelector_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelector", _wrap_delete_IDSelector, METH_VARARGS, NULL}, - { (char *)"IDSelector_swigregister", IDSelector_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imin_set", _wrap_IDSelectorRange_imin_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imin_get", _wrap_IDSelectorRange_imin_get, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imax_set", _wrap_IDSelectorRange_imax_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imax_get", _wrap_IDSelectorRange_imax_get, METH_VARARGS, NULL}, - { (char *)"new_IDSelectorRange", _wrap_new_IDSelectorRange, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_is_member", _wrap_IDSelectorRange_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelectorRange", _wrap_delete_IDSelectorRange, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_swigregister", IDSelectorRange_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_nbits_set", _wrap_IDSelectorBatch_nbits_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_nbits_get", _wrap_IDSelectorBatch_nbits_get, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_mask_set", _wrap_IDSelectorBatch_mask_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_mask_get", _wrap_IDSelectorBatch_mask_get, METH_VARARGS, NULL}, - { (char *)"new_IDSelectorBatch", _wrap_new_IDSelectorBatch, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_is_member", _wrap_IDSelectorBatch_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelectorBatch", _wrap_delete_IDSelectorBatch, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_swigregister", IDSelectorBatch_swigregister, METH_VARARGS, NULL}, - { (char *)"BufferList_buffer_size_set", _wrap_BufferList_buffer_size_set, METH_VARARGS, NULL}, - { (char *)"BufferList_buffer_size_get", _wrap_BufferList_buffer_size_get, METH_VARARGS, NULL}, - { (char *)"BufferList_buffers_set", _wrap_BufferList_buffers_set, METH_VARARGS, NULL}, - { (char *)"BufferList_buffers_get", _wrap_BufferList_buffers_get, METH_VARARGS, NULL}, - { (char *)"BufferList_wp_set", _wrap_BufferList_wp_set, METH_VARARGS, NULL}, - { (char *)"BufferList_wp_get", _wrap_BufferList_wp_get, METH_VARARGS, NULL}, - { (char *)"new_BufferList", _wrap_new_BufferList, METH_VARARGS, NULL}, - { (char *)"delete_BufferList", _wrap_delete_BufferList, METH_VARARGS, NULL}, - { (char *)"BufferList_append_buffer", _wrap_BufferList_append_buffer, METH_VARARGS, NULL}, - { (char *)"BufferList_add", _wrap_BufferList_add, METH_VARARGS, NULL}, - { (char *)"BufferList_copy_range", _wrap_BufferList_copy_range, METH_VARARGS, NULL}, - { (char *)"BufferList_swigregister", BufferList_swigregister, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_qno_set", _wrap_RangeQueryResult_qno_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_qno_get", _wrap_RangeQueryResult_qno_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_nres_set", _wrap_RangeQueryResult_nres_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_nres_get", _wrap_RangeQueryResult_nres_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_pres_set", _wrap_RangeQueryResult_pres_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_pres_get", _wrap_RangeQueryResult_pres_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_add", _wrap_RangeQueryResult_add, METH_VARARGS, NULL}, - { (char *)"new_RangeQueryResult", _wrap_new_RangeQueryResult, METH_VARARGS, NULL}, - { (char *)"delete_RangeQueryResult", _wrap_delete_RangeQueryResult, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_swigregister", RangeQueryResult_swigregister, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_res_set", _wrap_RangeSearchPartialResult_res_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_res_get", _wrap_RangeSearchPartialResult_res_get, METH_VARARGS, NULL}, - { (char *)"new_RangeSearchPartialResult", _wrap_new_RangeSearchPartialResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_queries_set", _wrap_RangeSearchPartialResult_queries_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_queries_get", _wrap_RangeSearchPartialResult_queries_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_new_result", _wrap_RangeSearchPartialResult_new_result, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_finalize", _wrap_RangeSearchPartialResult_finalize, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_set_lims", _wrap_RangeSearchPartialResult_set_lims, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_set_result", _wrap_RangeSearchPartialResult_set_result, METH_VARARGS, NULL}, - { (char *)"delete_RangeSearchPartialResult", _wrap_delete_RangeSearchPartialResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_swigregister", RangeSearchPartialResult_swigregister, METH_VARARGS, NULL}, - { (char *)"IOReader_name_set", _wrap_IOReader_name_set, METH_VARARGS, NULL}, - { (char *)"IOReader_name_get", _wrap_IOReader_name_get, METH_VARARGS, NULL}, - { (char *)"IOReader___call__", _wrap_IOReader___call__, METH_VARARGS, NULL}, - { (char *)"IOReader_fileno", _wrap_IOReader_fileno, METH_VARARGS, NULL}, - { (char *)"delete_IOReader", _wrap_delete_IOReader, METH_VARARGS, NULL}, - { (char *)"IOReader_swigregister", IOReader_swigregister, METH_VARARGS, NULL}, - { (char *)"IOWriter_name_set", _wrap_IOWriter_name_set, METH_VARARGS, NULL}, - { (char *)"IOWriter_name_get", _wrap_IOWriter_name_get, METH_VARARGS, NULL}, - { (char *)"IOWriter___call__", _wrap_IOWriter___call__, METH_VARARGS, NULL}, - { (char *)"IOWriter_fileno", _wrap_IOWriter_fileno, METH_VARARGS, NULL}, - { (char *)"delete_IOWriter", _wrap_delete_IOWriter, METH_VARARGS, NULL}, - { (char *)"IOWriter_swigregister", IOWriter_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_data_set", _wrap_VectorIOReader_data_set, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_data_get", _wrap_VectorIOReader_data_get, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_rp_set", _wrap_VectorIOReader_rp_set, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_rp_get", _wrap_VectorIOReader_rp_get, METH_VARARGS, NULL}, - { (char *)"VectorIOReader___call__", _wrap_VectorIOReader___call__, METH_VARARGS, NULL}, - { (char *)"new_VectorIOReader", _wrap_new_VectorIOReader, METH_VARARGS, NULL}, - { (char *)"delete_VectorIOReader", _wrap_delete_VectorIOReader, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_swigregister", VectorIOReader_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_data_set", _wrap_VectorIOWriter_data_set, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_data_get", _wrap_VectorIOWriter_data_get, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter___call__", _wrap_VectorIOWriter___call__, METH_VARARGS, NULL}, - { (char *)"new_VectorIOWriter", _wrap_new_VectorIOWriter, METH_VARARGS, NULL}, - { (char *)"delete_VectorIOWriter", _wrap_delete_VectorIOWriter, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_swigregister", VectorIOWriter_swigregister, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_set_query", _wrap_DistanceComputer_set_query, METH_VARARGS, NULL}, - { (char *)"DistanceComputer___call__", _wrap_DistanceComputer___call__, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_symmetric_dis", _wrap_DistanceComputer_symmetric_dis, METH_VARARGS, NULL}, - { (char *)"delete_DistanceComputer", _wrap_delete_DistanceComputer, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_swigregister", DistanceComputer_swigregister, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_want_interrupt", _wrap_InterruptCallback_want_interrupt, METH_VARARGS, NULL}, - { (char *)"delete_InterruptCallback", _wrap_delete_InterruptCallback, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_check", _wrap_InterruptCallback_check, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_is_interrupted", _wrap_InterruptCallback_is_interrupted, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_get_period_hint", _wrap_InterruptCallback_get_period_hint, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_swigregister", InterruptCallback_swigregister, METH_VARARGS, NULL}, - { (char *)"ignore_SIGTTIN", _wrap_ignore_SIGTTIN, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_map_set", _wrap_MapLong2Long_map_set, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_map_get", _wrap_MapLong2Long_map_get, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_add", _wrap_MapLong2Long_add, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_search", _wrap_MapLong2Long_search, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_search_multiple", _wrap_MapLong2Long_search_multiple, METH_VARARGS, NULL}, - { (char *)"new_MapLong2Long", _wrap_new_MapLong2Long, METH_VARARGS, NULL}, - { (char *)"delete_MapLong2Long", _wrap_delete_MapLong2Long, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_swigregister", MapLong2Long_swigregister, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static void *_p_faiss__IndexHNSWFlatTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWFlat *) x)); -} -static void *_p_faiss__IndexHNSWSQTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWSQ *) x)); -} -static void *_p_faiss__IndexHNSWPQTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWPQ *) x)); -} -static void *_p_faiss__IndexHNSW2LevelTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSW2Level *) x)); -} -static void *_p_faiss__IndexIDMap2To_p_faiss__IndexIDMap(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIDMap *) ((faiss::IndexIDMap2 *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__IndexIVFPQ(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__RandomRotationMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::RandomRotationMatrix *) x)); -} -static void *_p_faiss__PCAMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::PCAMatrix *) x)); -} -static void *_p_faiss__OPQMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::OPQMatrix *) x)); -} -static void *_p_faiss__LinearTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::LinearTransform *) x)); -} -static void *_p_faiss__RemapDimensionsTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::RemapDimensionsTransform *) x)); -} -static void *_p_faiss__NormalizationTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::NormalizationTransform *) x)); -} -static void *_p_faiss__CenteringTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::CenteringTransform *) x)); -} -static void *_p_faiss__RandomRotationMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::RandomRotationMatrix *) x)); -} -static void *_p_faiss__PCAMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::PCAMatrix *) x)); -} -static void *_p_faiss__OPQMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::OPQMatrix *) x)); -} -static void *_p_p_faiss__RandomRotationMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::RandomRotationMatrix **) x)); -} -static void *_p_p_faiss__PCAMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::PCAMatrix **) x)); -} -static void *_p_p_faiss__OPQMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::OPQMatrix **) x)); -} -static void *_p_p_faiss__LinearTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::LinearTransform **) x)); -} -static void *_p_p_faiss__RemapDimensionsTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::RemapDimensionsTransform **) x)); -} -static void *_p_p_faiss__NormalizationTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::NormalizationTransform **) x)); -} -static void *_p_p_faiss__CenteringTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::CenteringTransform **) x)); -} -static void *_p_faiss__gpu__GpuMultipleClonerOptionsTo_p_faiss__gpu__GpuClonerOptions(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuClonerOptions *) ((faiss::gpu::GpuMultipleClonerOptions *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVFFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IDSelectorBatchTo_p_faiss__IDSelector(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IDSelector *) ((faiss::IDSelectorBatch *) x)); -} -static void *_p_faiss__IDSelectorRangeTo_p_faiss__IDSelector(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IDSelector *) ((faiss::IDSelectorRange *) x)); -} -static void *_p_faiss__RangeSearchPartialResultTo_p_faiss__BufferList(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::BufferList *) ((faiss::RangeSearchPartialResult *) x)); -} -static void *_p_faiss__ReproduceDistancesObjectiveTo_p_faiss__PermutationObjective(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::PermutationObjective *) ((faiss::ReproduceDistancesObjective *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatL2To_p_faiss__gpu__GpuIndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatL2 *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__gpu__GpuIndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatIP *) x)); -} -static void *_p_faiss__IndexFlatL2To_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) ((faiss::IndexFlatL2 *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) (faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__IndexFlatIPTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) ((faiss::IndexFlatIP *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) (faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__ArrayInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::ArrayInvertedLists *) x)); -} -static void *_p_faiss__ConcatenatedInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::ConcatenatedInvertedLists *) x)); -} -static void *_p_faiss__OnDiskInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::OnDiskInvertedLists *) x)); -} -static void *_p_p_faiss__ArrayInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::ArrayInvertedLists **) x)); -} -static void *_p_p_faiss__ConcatenatedInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::ConcatenatedInvertedLists **) x)); -} -static void *_p_p_faiss__OnDiskInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::OnDiskInvertedLists **) x)); -} -static void *_p_faiss__VectorIOReaderTo_p_faiss__IOReader(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IOReader *) ((faiss::VectorIOReader *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__IndexFlatL2(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlatL2(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) (faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) (faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__gpu__GpuIndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFPQ *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__gpu__GpuIndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFPQConfigTo_p_faiss__gpu__GpuIndexIVFConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexIVFConfig *) ((faiss::gpu::GpuIndexIVFPQConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFFlatConfigTo_p_faiss__gpu__GpuIndexIVFConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexIVFConfig *) ((faiss::gpu::GpuIndexIVFFlatConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFPQConfigTo_p_faiss__gpu__GpuIndexConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexConfig *) (faiss::gpu::GpuIndexIVFConfig *) ((faiss::gpu::GpuIndexIVFPQConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatConfigTo_p_faiss__gpu__GpuIndexConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexConfig *) ((faiss::gpu::GpuIndexFlatConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFConfigTo_p_faiss__gpu__GpuIndexConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexConfig *) ((faiss::gpu::GpuIndexIVFConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFFlatConfigTo_p_faiss__gpu__GpuIndexConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexConfig *) (faiss::gpu::GpuIndexIVFConfig *) ((faiss::gpu::GpuIndexIVFFlatConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexBinaryFlatConfigTo_p_faiss__gpu__GpuIndexConfig(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndexConfig *) ((faiss::gpu::GpuIndexBinaryFlatConfig *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatTo_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatL2To_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) (faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatL2 *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFTo_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexIVF *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) (faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFPQ *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) (faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__gpu__GpuIndex(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuIndex *) (faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatIP *) x)); -} -static void *_p_faiss__PolysemousTrainingTo_p_faiss__SimulatedAnnealingParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::SimulatedAnnealingParameters *) ((faiss::PolysemousTraining *) x)); -} -static void *_p_faiss__SimulatedAnnealingOptimizerTo_p_faiss__SimulatedAnnealingParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::SimulatedAnnealingParameters *) ((faiss::SimulatedAnnealingOptimizer *) x)); -} -static void *_p_faiss__ClusteringTo_p_faiss__ClusteringParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::ClusteringParameters *) ((faiss::Clustering *) x)); -} -static void *_p_faiss__IVFPQSearchParametersTo_p_faiss__IVFSearchParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IVFSearchParameters *) ((faiss::IVFPQSearchParameters *) x)); -} -static void *_p_p_faiss__IndexPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexPQ **) x)); -} -static void *_p_p_faiss__IndexIVFFlatDedupTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup **) x)); -} -static void *_p_p_faiss__IndexPreTransformTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexPreTransform **) x)); -} -static void *_p_p_faiss__IndexSplitVectorsTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexSplitVectors **) x)); -} -static void *_p_p_faiss__IndexIDMap2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIDMap *) ((faiss::IndexIDMap2 **) x)); -} -static void *_p_p_faiss__IndexIVFFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFFlat **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexIVFFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFFlat **) x)); -} -static void *_p_p_faiss__MultiIndexQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::MultiIndexQuantizer **) x)); -} -static void *_p_p_faiss__IndexScalarQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexScalarQuantizer **) x)); -} -static void *_p_p_faiss__IndexIVFScalarQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer **) x)); -} -static void *_p_p_faiss__IndexRefineFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexRefineFlat **) x)); -} -static void *_p_p_faiss__IndexIVFPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFPQ **) x)); -} -static void *_p_p_faiss__IndexLSHTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexLSH **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexIVFPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFPQ **) x)); -} -static void *_p_p_faiss__IndexHNSWSQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWSQ **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::gpu::GpuIndex **) x)); -} -static void *_p_p_faiss__IndexIDMapTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexIDMap **) x)); -} -static void *_p_p_faiss__IndexHNSW2LevelTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSW2Level **) x)); -} -static void *_p_p_faiss__Index2LayerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::Index2Layer **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexFlatL2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatL2 **) x)); -} -static void *_p_p_faiss__IndexFlatL2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *) ((faiss::IndexFlatL2 **) x)); -} -static void *_p_p_faiss__IndexHNSWFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWFlat **) x)); -} -static void *_p_p_faiss__IndexIVFPQRTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR **) x)); -} -static void *_p_p_faiss__IndexFlat1DTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlat1D **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexFlat **) x)); -} -static void *_p_p_faiss__IndexFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexFlat **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexFlatIPTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatIP **) x)); -} -static void *_p_p_faiss__IndexFlatIPTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *) ((faiss::IndexFlatIP **) x)); -} -static void *_p_p_faiss__IndexHNSWTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexHNSW **) x)); -} -static void *_p_p_faiss__IndexHNSWPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWPQ **) x)); -} -static void *_p_p_faiss__IndexFlatL2BaseShiftTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift **) x)); -} -static void *_p_p_faiss__gpu__GpuIndexIVFTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexIVF **) x)); -} -static void *_p_p_faiss__IndexIVFTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexIVF **) x)); -} -static void *_p_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexReplicasTemplate< faiss::Index > **) x)); -} -static void *_p_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexShardsTemplate< faiss::Index > **) x)); -} -static void *_p_p_faiss__MultiIndexQuantizer2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 **) x)); -} -static void *_p_faiss__IndexPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexPreTransformTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexPreTransform *) x)); -} -static void *_p_faiss__IndexSplitVectorsTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexSplitVectors *) x)); -} -static void *_p_faiss__IndexIDMap2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIDMap *) ((faiss::IndexIDMap2 *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFFlat *) x)); -} -static void *_p_faiss__MultiIndexQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::MultiIndexQuantizer *) x)); -} -static void *_p_faiss__IndexScalarQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexScalarQuantizer *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexRefineFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexRefineFlat *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexLSHTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexLSH *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexIVF *) ((faiss::gpu::GpuIndexIVFPQ *) x)); -} -static void *_p_faiss__IndexHNSWSQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWSQ *) x)); -} -static void *_p_faiss__gpu__GpuIndexTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::gpu::GpuIndex *) x)); -} -static void *_p_faiss__IndexIDMapTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexIDMap *) x)); -} -static void *_p_faiss__IndexHNSW2LevelTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSW2Level *) x)); -} -static void *_p_faiss__Index2LayerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::Index2Layer *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatL2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatL2 *) x)); -} -static void *_p_faiss__IndexFlatL2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *) ((faiss::IndexFlatL2 *) x)); -} -static void *_p_faiss__IndexHNSWFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWFlat *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexFlat *) x)); -} -static void *_p_faiss__IndexFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *)(faiss::gpu::GpuIndexFlat *) ((faiss::gpu::GpuIndexFlatIP *) x)); -} -static void *_p_faiss__IndexFlatIPTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *) ((faiss::IndexFlatIP *) x)); -} -static void *_p_faiss__IndexHNSWTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexHNSW *) x)); -} -static void *_p_faiss__IndexHNSWPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWPQ *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__gpu__GpuIndexIVFTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::gpu::GpuIndex *) ((faiss::gpu::GpuIndexIVF *) x)); -} -static void *_p_faiss__IndexIVFTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexIVF *) x)); -} -static void *_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexReplicasTemplate< faiss::Index > *) x)); -} -static void *_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexShardsTemplate< faiss::Index > *) x)); -} -static void *_p_faiss__MultiIndexQuantizer2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 *) x)); -} -static void *_p_faiss__gpu__GpuParameterSpaceTo_p_faiss__ParameterSpace(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::ParameterSpace *) ((faiss::gpu::GpuParameterSpace *) x)); -} -static void *_p_faiss__IndexBinaryFlatTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryFlat *) x)); -} -static void *_p_faiss__gpu__GpuIndexBinaryFlatTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::gpu::GpuIndexBinaryFlat *) x)); -} -static void *_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexShardsTemplate< faiss::IndexBinary > *) x)); -} -static void *_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexReplicasTemplate< faiss::IndexBinary > *) x)); -} -static void *_p_faiss__IndexBinaryHNSWTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryHNSW *) x)); -} -static void *_p_faiss__IndexBinaryIVFTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryIVF *) x)); -} -static void *_p_faiss__IndexBinaryFromFloatTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryFromFloat *) x)); -} -static void *_p_faiss__MultiIndexQuantizer2To_p_faiss__MultiIndexQuantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 *) x)); -} -static void *_p_faiss__IndexIVFTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) ((faiss::IndexIVF *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__OneRecallAtRCriterionTo_p_faiss__AutoTuneCriterion(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::AutoTuneCriterion *) ((faiss::OneRecallAtRCriterion *) x)); -} -static void *_p_faiss__IntersectionCriterionTo_p_faiss__AutoTuneCriterion(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::AutoTuneCriterion *) ((faiss::IntersectionCriterion *) x)); -} -static void *_p_faiss__gpu__StandardGpuResourcesTo_p_faiss__gpu__GpuResources(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuResources *) ((faiss::gpu::StandardGpuResources *) x)); -} -static void *_p_p_faiss__gpu__StandardGpuResourcesTo_p_p_faiss__gpu__GpuResources(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::gpu::GpuResources **) ((faiss::gpu::StandardGpuResources **) x)); -} -static void *_p_faiss__VectorIOWriterTo_p_faiss__IOWriter(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IOWriter *) ((faiss::VectorIOWriter *) x)); -} -static swig_type_info _swigt__p_Crev = {"_p_Crev", "Crev *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_MapLong2Long = {"_p_MapLong2Long", "MapLong2Long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Node = {"_p_Node", "Node *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_T = {"_p_T", "T *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_TI = {"_p_TI", "TI *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_component_t = {"_p_component_t", "component_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_cublasHandle_t = {"_p_cublasHandle_t", "cublasHandle_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_cudaStream_t = {"_p_cudaStream_t", "cudaStream_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_distance_t = {"_p_distance_t", "distance_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ArrayInvertedLists = {"_p_faiss__ArrayInvertedLists", "faiss::ArrayInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__AutoTuneCriterion = {"_p_faiss__AutoTuneCriterion", "faiss::AutoTuneCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__BinaryInvertedListScanner = {"_p_faiss__BinaryInvertedListScanner", "faiss::BinaryInvertedListScanner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__BufferList = {"_p_faiss__BufferList", "faiss::BufferList *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__CenteringTransform = {"_p_faiss__CenteringTransform", "faiss::CenteringTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Cloner = {"_p_faiss__Cloner", "faiss::Cloner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Clustering = {"_p_faiss__Clustering", "faiss::Clustering *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ClusteringParameters = {"_p_faiss__ClusteringParameters", "faiss::ClusteringParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ConcatenatedInvertedLists = {"_p_faiss__ConcatenatedInvertedLists", "faiss::ConcatenatedInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__DistanceComputer = {"_p_faiss__DistanceComputer", "faiss::DistanceComputer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer16 = {"_p_faiss__GenHammingComputer16", "faiss::GenHammingComputer16 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer32 = {"_p_faiss__GenHammingComputer32", "faiss::GenHammingComputer32 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer8 = {"_p_faiss__GenHammingComputer8", "faiss::GenHammingComputer8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputerM8 = {"_p_faiss__GenHammingComputerM8", "faiss::GenHammingComputerM8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSW = {"_p_faiss__HNSW", "faiss::HNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSWStats = {"_p_faiss__HNSWStats", "faiss::HNSWStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSW__MinimaxHeap = {"_p_faiss__HNSW__MinimaxHeap", "faiss::HNSW::MinimaxHeap *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer16 = {"_p_faiss__HammingComputer16", "faiss::HammingComputer16 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer20 = {"_p_faiss__HammingComputer20", "faiss::HammingComputer20 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer32 = {"_p_faiss__HammingComputer32", "faiss::HammingComputer32 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer4 = {"_p_faiss__HammingComputer4", "faiss::HammingComputer4 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer64 = {"_p_faiss__HammingComputer64", "faiss::HammingComputer64 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer8 = {"_p_faiss__HammingComputer8", "faiss::HammingComputer8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerDefault = {"_p_faiss__HammingComputerDefault", "faiss::HammingComputerDefault *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerM4 = {"_p_faiss__HammingComputerM4", "faiss::HammingComputerM4 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerM8 = {"_p_faiss__HammingComputerM8", "faiss::HammingComputerM8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t", "faiss::HeapArray< faiss::CMax< float,long > > *|faiss::float_maxheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t", "faiss::HeapArray< faiss::CMax< int,long > > *|faiss::int_maxheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t", "faiss::HeapArray< faiss::CMin< float,long > > *|faiss::float_minheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t", "faiss::HeapArray< faiss::CMin< int,long > > *|faiss::int_minheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelector = {"_p_faiss__IDSelector", "faiss::IDSelector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelectorBatch = {"_p_faiss__IDSelectorBatch", "faiss::IDSelectorBatch *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelectorRange = {"_p_faiss__IDSelectorRange", "faiss::IDSelectorRange *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IOReader = {"_p_faiss__IOReader", "faiss::IOReader *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IOWriter = {"_p_faiss__IOWriter", "faiss::IOWriter *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IVFPQSearchParameters = {"_p_faiss__IVFPQSearchParameters", "faiss::IVFPQSearchParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IVFSearchParameters = {"_p_faiss__IVFSearchParameters", "faiss::IVFSearchParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Index = {"_p_faiss__Index", "faiss::Index *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Index2Layer = {"_p_faiss__Index2Layer", "faiss::Index2Layer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinary = {"_p_faiss__IndexBinary", "faiss::IndexBinary *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryFlat = {"_p_faiss__IndexBinaryFlat", "faiss::IndexBinaryFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryFromFloat = {"_p_faiss__IndexBinaryFromFloat", "faiss::IndexBinaryFromFloat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryHNSW = {"_p_faiss__IndexBinaryHNSW", "faiss::IndexBinaryHNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryIVF = {"_p_faiss__IndexBinaryIVF", "faiss::IndexBinaryIVF *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlat = {"_p_faiss__IndexFlat", "faiss::IndexFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlat1D = {"_p_faiss__IndexFlat1D", "faiss::IndexFlat1D *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatIP = {"_p_faiss__IndexFlatIP", "faiss::IndexFlatIP *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatL2 = {"_p_faiss__IndexFlatL2", "faiss::IndexFlatL2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatL2BaseShift = {"_p_faiss__IndexFlatL2BaseShift", "faiss::IndexFlatL2BaseShift *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSW = {"_p_faiss__IndexHNSW", "faiss::IndexHNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSW2Level = {"_p_faiss__IndexHNSW2Level", "faiss::IndexHNSW2Level *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWFlat = {"_p_faiss__IndexHNSWFlat", "faiss::IndexHNSWFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWPQ = {"_p_faiss__IndexHNSWPQ", "faiss::IndexHNSWPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWSQ = {"_p_faiss__IndexHNSWSQ", "faiss::IndexHNSWSQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIDMap = {"_p_faiss__IndexIDMap", "faiss::IndexIDMap *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIDMap2 = {"_p_faiss__IndexIDMap2", "faiss::IndexIDMap2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVF = {"_p_faiss__IndexIVF", "faiss::IndexIVF *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFFlat = {"_p_faiss__IndexIVFFlat", "faiss::IndexIVFFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFFlatDedup = {"_p_faiss__IndexIVFFlatDedup", "faiss::IndexIVFFlatDedup *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQ = {"_p_faiss__IndexIVFPQ", "faiss::IndexIVFPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQR = {"_p_faiss__IndexIVFPQR", "faiss::IndexIVFPQR *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQStats = {"_p_faiss__IndexIVFPQStats", "faiss::IndexIVFPQStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFScalarQuantizer = {"_p_faiss__IndexIVFScalarQuantizer", "faiss::IndexIVFScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFStats = {"_p_faiss__IndexIVFStats", "faiss::IndexIVFStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexLSH = {"_p_faiss__IndexLSH", "faiss::IndexLSH *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPQ = {"_p_faiss__IndexPQ", "faiss::IndexPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPQStats = {"_p_faiss__IndexPQStats", "faiss::IndexPQStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPreTransform = {"_p_faiss__IndexPreTransform", "faiss::IndexPreTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexRefineFlat = {"_p_faiss__IndexRefineFlat", "faiss::IndexRefineFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t = {"_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t", "faiss::IndexBinaryReplicas *|faiss::IndexReplicasTemplate< faiss::IndexBinary > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t = {"_p_faiss__IndexReplicasTemplateT_faiss__Index_t", "faiss::IndexReplicas *|faiss::IndexReplicasTemplate< faiss::Index > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexScalarQuantizer = {"_p_faiss__IndexScalarQuantizer", "faiss::IndexScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t = {"_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t", "faiss::IndexBinaryShards *|faiss::IndexShardsTemplate< faiss::IndexBinary > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t = {"_p_faiss__IndexShardsTemplateT_faiss__Index_t", "faiss::IndexShards *|faiss::IndexShardsTemplate< faiss::Index > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexSplitVectors = {"_p_faiss__IndexSplitVectors", "faiss::IndexSplitVectors *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InterruptCallback = {"_p_faiss__InterruptCallback", "faiss::InterruptCallback *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IntersectionCriterion = {"_p_faiss__IntersectionCriterion", "faiss::IntersectionCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InvertedListScanner = {"_p_faiss__InvertedListScanner", "faiss::InvertedListScanner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InvertedLists = {"_p_faiss__InvertedLists", "faiss::InvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Level1Quantizer = {"_p_faiss__Level1Quantizer", "faiss::Level1Quantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__LinearTransform = {"_p_faiss__LinearTransform", "faiss::LinearTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__LockLevels = {"_p_faiss__LockLevels", "faiss::LockLevels *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MatrixStats = {"_p_faiss__MatrixStats", "faiss::MatrixStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MultiIndexQuantizer = {"_p_faiss__MultiIndexQuantizer", "faiss::MultiIndexQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MultiIndexQuantizer2 = {"_p_faiss__MultiIndexQuantizer2", "faiss::MultiIndexQuantizer2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__NormalizationTransform = {"_p_faiss__NormalizationTransform", "faiss::NormalizationTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OPQMatrix = {"_p_faiss__OPQMatrix", "faiss::OPQMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OnDiskInvertedLists = {"_p_faiss__OnDiskInvertedLists", "faiss::OnDiskInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch = {"_p_faiss__OnDiskInvertedLists__OngoingPrefetch", "faiss::OnDiskInvertedLists::OngoingPrefetch *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OneRecallAtRCriterion = {"_p_faiss__OneRecallAtRCriterion", "faiss::OneRecallAtRCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OperatingPoint = {"_p_faiss__OperatingPoint", "faiss::OperatingPoint *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OperatingPoints = {"_p_faiss__OperatingPoints", "faiss::OperatingPoints *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PCAMatrix = {"_p_faiss__PCAMatrix", "faiss::PCAMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ParameterRange = {"_p_faiss__ParameterRange", "faiss::ParameterRange *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ParameterSpace = {"_p_faiss__ParameterSpace", "faiss::ParameterSpace *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PermutationObjective = {"_p_faiss__PermutationObjective", "faiss::PermutationObjective *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PolysemousTraining = {"_p_faiss__PolysemousTraining", "faiss::PolysemousTraining *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ProductQuantizer = {"_p_faiss__ProductQuantizer", "faiss::ProductQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RandomGenerator = {"_p_faiss__RandomGenerator", "faiss::RandomGenerator *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RandomRotationMatrix = {"_p_faiss__RandomRotationMatrix", "faiss::RandomRotationMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeQueryResult = {"_p_faiss__RangeQueryResult", "faiss::RangeQueryResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeSearchPartialResult = {"_p_faiss__RangeSearchPartialResult", "faiss::RangeSearchPartialResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeSearchResult = {"_p_faiss__RangeSearchResult", "faiss::RangeSearchResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ReconstructFromNeighbors = {"_p_faiss__ReconstructFromNeighbors", "faiss::ReconstructFromNeighbors *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RemapDimensionsTransform = {"_p_faiss__RemapDimensionsTransform", "faiss::RemapDimensionsTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ReproduceDistancesObjective = {"_p_faiss__ReproduceDistancesObjective", "faiss::ReproduceDistancesObjective *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SQDistanceComputer = {"_p_faiss__SQDistanceComputer", "faiss::SQDistanceComputer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ScalarQuantizer = {"_p_faiss__ScalarQuantizer", "faiss::ScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SimulatedAnnealingOptimizer = {"_p_faiss__SimulatedAnnealingOptimizer", "faiss::SimulatedAnnealingOptimizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SimulatedAnnealingParameters = {"_p_faiss__SimulatedAnnealingParameters", "faiss::SimulatedAnnealingParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorIOReader = {"_p_faiss__VectorIOReader", "faiss::VectorIOReader *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorIOWriter = {"_p_faiss__VectorIOWriter", "faiss::VectorIOWriter *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorTransform = {"_p_faiss__VectorTransform", "faiss::VectorTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VisitedTable = {"_p_faiss__VisitedTable", "faiss::VisitedTable *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__FlatIndex = {"_p_faiss__gpu__FlatIndex", "faiss::gpu::FlatIndex *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuClonerOptions = {"_p_faiss__gpu__GpuClonerOptions", "faiss::gpu::GpuClonerOptions *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndex = {"_p_faiss__gpu__GpuIndex", "faiss::gpu::GpuIndex *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexBinaryFlat = {"_p_faiss__gpu__GpuIndexBinaryFlat", "faiss::gpu::GpuIndexBinaryFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexBinaryFlatConfig = {"_p_faiss__gpu__GpuIndexBinaryFlatConfig", "faiss::gpu::GpuIndexBinaryFlatConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexConfig = {"_p_faiss__gpu__GpuIndexConfig", "faiss::gpu::GpuIndexConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexFlat = {"_p_faiss__gpu__GpuIndexFlat", "faiss::gpu::GpuIndexFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexFlatConfig = {"_p_faiss__gpu__GpuIndexFlatConfig", "faiss::gpu::GpuIndexFlatConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexFlatIP = {"_p_faiss__gpu__GpuIndexFlatIP", "faiss::gpu::GpuIndexFlatIP *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexFlatL2 = {"_p_faiss__gpu__GpuIndexFlatL2", "faiss::gpu::GpuIndexFlatL2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVF = {"_p_faiss__gpu__GpuIndexIVF", "faiss::gpu::GpuIndexIVF *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVFConfig = {"_p_faiss__gpu__GpuIndexIVFConfig", "faiss::gpu::GpuIndexIVFConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVFFlat = {"_p_faiss__gpu__GpuIndexIVFFlat", "faiss::gpu::GpuIndexIVFFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVFFlatConfig = {"_p_faiss__gpu__GpuIndexIVFFlatConfig", "faiss::gpu::GpuIndexIVFFlatConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVFPQ = {"_p_faiss__gpu__GpuIndexIVFPQ", "faiss::gpu::GpuIndexIVFPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuIndexIVFPQConfig = {"_p_faiss__gpu__GpuIndexIVFPQConfig", "faiss::gpu::GpuIndexIVFPQConfig *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuMultipleClonerOptions = {"_p_faiss__gpu__GpuMultipleClonerOptions", "faiss::gpu::GpuMultipleClonerOptions *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuParameterSpace = {"_p_faiss__gpu__GpuParameterSpace", "faiss::gpu::GpuParameterSpace *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__GpuResources = {"_p_faiss__gpu__GpuResources", "faiss::gpu::GpuResources *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__gpu__StandardGpuResources = {"_p_faiss__gpu__StandardGpuResources", "faiss::gpu::StandardGpuResources *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ivflib__SlidingIndexWindow = {"_p_faiss__ivflib__SlidingIndexWindow", "faiss::ivflib::SlidingIndexWindow *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_float = {"_p_float", "faiss::IndexShardsTemplate< faiss::Index >::distance_t *|faiss::IndexShardsTemplate< faiss::Index >::component_t *|float *|faiss::IndexReplicasTemplate< faiss::Index >::distance_t *|faiss::HeapArray< faiss::CMin< float,long > >::T *|faiss::HeapArray< faiss::CMax< float,long > >::T *|faiss::IndexReplicasTemplate< faiss::Index >::component_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_idx_t = {"_p_idx_t", "idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *|int *|int32_t *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *|hamdis_t *|faiss::HeapArray< faiss::CMin< int,long > >::T *|faiss::HeapArray< faiss::CMax< int,long > >::T *|faiss::IndexHNSW::storage_idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_long = {"_p_long", "faiss::IndexReplicasTemplate< faiss::Index >::idx_t *|faiss::IndexShardsTemplate< faiss::Index >::idx_t *|faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *|faiss::HeapArray< faiss::CMax< float,long > >::TI *|faiss::HeapArray< faiss::CMin< float,long > >::TI *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *|faiss::RangeSearchResult::idx_t *|faiss::AutoTuneCriterion::idx_t *|faiss::Index::idx_t *|faiss::InvertedLists::idx_t *|faiss::ivflib::idx_t *|faiss::HNSW::idx_t *|faiss::ReconstructFromNeighbors::idx_t *|faiss::IndexBinary::idx_t *|faiss::IDSelector::idx_t *|faiss::BufferList::idx_t *|faiss::HeapArray< faiss::CMin< int,long > >::TI *|faiss::HeapArray< faiss::CMax< int,long > >::TI *|long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_omp_lock_t = {"_p_omp_lock_t", "omp_lock_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__Index = {"_p_p_faiss__Index", "faiss::Index **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexPQ = {"_p_p_faiss__IndexPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFFlatDedup = {"_p_p_faiss__IndexIVFFlatDedup", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexPreTransform = {"_p_p_faiss__IndexPreTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexSplitVectors = {"_p_p_faiss__IndexSplitVectors", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIDMap2 = {"_p_p_faiss__IndexIDMap2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFFlat = {"_p_p_faiss__IndexIVFFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexIVFFlat = {"_p_p_faiss__gpu__GpuIndexIVFFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__MultiIndexQuantizer = {"_p_p_faiss__MultiIndexQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexScalarQuantizer = {"_p_p_faiss__IndexScalarQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFScalarQuantizer = {"_p_p_faiss__IndexIVFScalarQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexRefineFlat = {"_p_p_faiss__IndexRefineFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexIVFPQ = {"_p_p_faiss__gpu__GpuIndexIVFPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFPQ = {"_p_p_faiss__IndexIVFPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexLSH = {"_p_p_faiss__IndexLSH", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWSQ = {"_p_p_faiss__IndexHNSWSQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndex = {"_p_p_faiss__gpu__GpuIndex", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIDMap = {"_p_p_faiss__IndexIDMap", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSW2Level = {"_p_p_faiss__IndexHNSW2Level", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__Index2Layer = {"_p_p_faiss__Index2Layer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexFlatL2 = {"_p_p_faiss__gpu__GpuIndexFlatL2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatL2 = {"_p_p_faiss__IndexFlatL2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWFlat = {"_p_p_faiss__IndexHNSWFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFPQR = {"_p_p_faiss__IndexIVFPQR", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlat1D = {"_p_p_faiss__IndexFlat1D", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexFlat = {"_p_p_faiss__gpu__GpuIndexFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlat = {"_p_p_faiss__IndexFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexFlatIP = {"_p_p_faiss__gpu__GpuIndexFlatIP", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatIP = {"_p_p_faiss__IndexFlatIP", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSW = {"_p_p_faiss__IndexHNSW", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWPQ = {"_p_p_faiss__IndexHNSWPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatL2BaseShift = {"_p_p_faiss__IndexFlatL2BaseShift", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuIndexIVF = {"_p_p_faiss__gpu__GpuIndexIVF", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVF = {"_p_p_faiss__IndexIVF", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__MultiIndexQuantizer2 = {"_p_p_faiss__MultiIndexQuantizer2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t = {"_p_p_faiss__IndexReplicasTemplateT_faiss__Index_t", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t = {"_p_p_faiss__IndexShardsTemplateT_faiss__Index_t", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__InvertedLists = {"_p_p_faiss__InvertedLists", "faiss::InvertedLists **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__ArrayInvertedLists = {"_p_p_faiss__ArrayInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__ConcatenatedInvertedLists = {"_p_p_faiss__ConcatenatedInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__OnDiskInvertedLists = {"_p_p_faiss__OnDiskInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__VectorTransform = {"_p_p_faiss__VectorTransform", "faiss::VectorTransform **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__RandomRotationMatrix = {"_p_p_faiss__RandomRotationMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__PCAMatrix = {"_p_p_faiss__PCAMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__OPQMatrix = {"_p_p_faiss__OPQMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__LinearTransform = {"_p_p_faiss__LinearTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__RemapDimensionsTransform = {"_p_p_faiss__RemapDimensionsTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__NormalizationTransform = {"_p_p_faiss__NormalizationTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__CenteringTransform = {"_p_p_faiss__CenteringTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__GpuResources = {"_p_p_faiss__gpu__GpuResources", "faiss::gpu::GpuResources **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__gpu__StandardGpuResources = {"_p_p_faiss__gpu__StandardGpuResources", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t = {"_p_std__functionT_void_ffaiss__IndexBinary_pF_t", "std::function< void (faiss::IndexBinary *) > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__functionT_void_ffaiss__Index_pF_t = {"_p_std__functionT_void_ffaiss__Index_pF_t", "std::function< void (faiss::Index *) > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t = {"_p_std__listT_faiss__OnDiskInvertedLists__Slot_t", "std::list< faiss::OnDiskInvertedLists::Slot > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__mt19937 = {"_p_std__mt19937", "std::mt19937 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__pairT_float_int_t = {"_p_std__pairT_float_int_t", "std::pair< float,int > *|faiss::HNSW::Node *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__pairT_void_p_unsigned_long_t = {"_p_std__pairT_void_p_unsigned_long_t", "std::pair< void *,unsigned long > *|std::pair< void *,size_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t = {"_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t", "std::priority_queue< faiss::HNSW::NodeDistFarther > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__priority_queueT_std__pairT_float_int_t_t = {"_p_std__priority_queueT_std__pairT_float_int_t_t", "std::priority_queue< std::pair< float,int > > *|std::priority_queue< faiss::HNSW::Node > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_mapT_long_long_t = {"_p_std__unordered_mapT_long_long_t", "std::unordered_map< long,long > *|std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t = {"_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t", "std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *|std::unordered_map< unsigned long,faiss::MatrixStats::Occurrence > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_multimapT_long_long_t = {"_p_std__unordered_multimapT_long_long_t", "std::unordered_multimap< long,long > *|std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_char_t = {"_p_std__vectorT_char_t", "std::vector< char > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_cudaStream_t_t = {"_p_std__vectorT_cudaStream_t_t", "std::vector< cudaStream_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_double_t = {"_p_std__vectorT_double_t", "std::vector< double > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__BufferList__Buffer_t = {"_p_std__vectorT_faiss__BufferList__Buffer_t", "std::vector< faiss::BufferList::Buffer > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t = {"_p_std__vectorT_faiss__HNSW__NodeDistFarther_t", "std::vector< faiss::HNSW::NodeDistFarther > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__IndexBinary_p_t = {"_p_std__vectorT_faiss__IndexBinary_p_t", "std::vector< faiss::IndexBinary * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__Index_p_t = {"_p_std__vectorT_faiss__Index_p_t", "std::vector< faiss::Index * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__InvertedLists_const_p_t = {"_p_std__vectorT_faiss__InvertedLists_const_p_t", "std::vector< faiss::InvertedLists const * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__InvertedLists_p_t = {"_p_std__vectorT_faiss__InvertedLists_p_t", "std::vector< faiss::InvertedLists * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t = {"_p_std__vectorT_faiss__MatrixStats__PerDimStats_t", "std::vector< faiss::MatrixStats::PerDimStats > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t = {"_p_std__vectorT_faiss__OnDiskInvertedLists__List_t", "std::vector< faiss::OnDiskInvertedLists::List > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__OperatingPoint_t = {"_p_std__vectorT_faiss__OperatingPoint_t", "std::vector< faiss::OperatingPoint > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__ParameterRange_t = {"_p_std__vectorT_faiss__ParameterRange_t", "std::vector< faiss::ParameterRange > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__RangeQueryResult_t = {"_p_std__vectorT_faiss__RangeQueryResult_t", "std::vector< faiss::RangeQueryResult > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__VectorTransform_p_t = {"_p_std__vectorT_faiss__VectorTransform_p_t", "std::vector< faiss::VectorTransform * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__gpu__GpuResources_p_t = {"_p_std__vectorT_faiss__gpu__GpuResources_p_t", "std::vector< faiss::gpu::GpuResources * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_float_t = {"_p_std__vectorT_float_t", "std::vector< float > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_int_t = {"_p_std__vectorT_int_t", "std::vector< faiss::HNSW::storage_idx_t > *|std::vector< int > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_long_t = {"_p_std__vectorT_long_t", "std::vector< long > *|std::vector< faiss::Index::idx_t > *|std::vector< faiss::AutoTuneCriterion::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_omp_lock_t_t = {"_p_std__vectorT_omp_lock_t_t", "std::vector< omp_lock_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_float_t_t = {"_p_std__vectorT_std__vectorT_float_t_t", "std::vector< std::vector< float > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_long_t_t = {"_p_std__vectorT_std__vectorT_long_t_t", "std::vector< std::vector< long > > *|std::vector< std::vector< faiss::InvertedLists::idx_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_uint8_t_t_t = {"_p_std__vectorT_std__vectorT_uint8_t_t_t", "std::vector< std::vector< unsigned char > > *|std::vector< std::vector< uint8_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t = {"_p_std__vectorT_std__vectorT_unsigned_long_t_t", "std::vector< std::vector< unsigned long > > *|std::vector< std::vector< size_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_unsigned_char_t = {"_p_std__vectorT_unsigned_char_t", "std::vector< unsigned char > *|std::vector< uint8_t > *|std::vector< faiss::IndexLSH::uint8_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_unsigned_long_t = {"_p_std__vectorT_unsigned_long_t", "std::vector< unsigned long > *|std::vector< size_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_storage_idx_t = {"_p_storage_idx_t", "storage_idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *|unsigned char *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *|uint8_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uint64_t *|size_t *|unsigned long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_Crev, - &_swigt__p_FILE, - &_swigt__p_MapLong2Long, - &_swigt__p_Node, - &_swigt__p_T, - &_swigt__p_TI, - &_swigt__p_char, - &_swigt__p_component_t, - &_swigt__p_cublasHandle_t, - &_swigt__p_cudaStream_t, - &_swigt__p_distance_t, - &_swigt__p_double, - &_swigt__p_faiss__ArrayInvertedLists, - &_swigt__p_faiss__AutoTuneCriterion, - &_swigt__p_faiss__BinaryInvertedListScanner, - &_swigt__p_faiss__BufferList, - &_swigt__p_faiss__CenteringTransform, - &_swigt__p_faiss__Cloner, - &_swigt__p_faiss__Clustering, - &_swigt__p_faiss__ClusteringParameters, - &_swigt__p_faiss__ConcatenatedInvertedLists, - &_swigt__p_faiss__DistanceComputer, - &_swigt__p_faiss__GenHammingComputer16, - &_swigt__p_faiss__GenHammingComputer32, - &_swigt__p_faiss__GenHammingComputer8, - &_swigt__p_faiss__GenHammingComputerM8, - &_swigt__p_faiss__HNSW, - &_swigt__p_faiss__HNSWStats, - &_swigt__p_faiss__HNSW__MinimaxHeap, - &_swigt__p_faiss__HammingComputer16, - &_swigt__p_faiss__HammingComputer20, - &_swigt__p_faiss__HammingComputer32, - &_swigt__p_faiss__HammingComputer4, - &_swigt__p_faiss__HammingComputer64, - &_swigt__p_faiss__HammingComputer8, - &_swigt__p_faiss__HammingComputerDefault, - &_swigt__p_faiss__HammingComputerM4, - &_swigt__p_faiss__HammingComputerM8, - &_swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, - &_swigt__p_faiss__IDSelector, - &_swigt__p_faiss__IDSelectorBatch, - &_swigt__p_faiss__IDSelectorRange, - &_swigt__p_faiss__IOReader, - &_swigt__p_faiss__IOWriter, - &_swigt__p_faiss__IVFPQSearchParameters, - &_swigt__p_faiss__IVFSearchParameters, - &_swigt__p_faiss__Index, - &_swigt__p_faiss__Index2Layer, - &_swigt__p_faiss__IndexBinary, - &_swigt__p_faiss__IndexBinaryFlat, - &_swigt__p_faiss__IndexBinaryFromFloat, - &_swigt__p_faiss__IndexBinaryHNSW, - &_swigt__p_faiss__IndexBinaryIVF, - &_swigt__p_faiss__IndexFlat, - &_swigt__p_faiss__IndexFlat1D, - &_swigt__p_faiss__IndexFlatIP, - &_swigt__p_faiss__IndexFlatL2, - &_swigt__p_faiss__IndexFlatL2BaseShift, - &_swigt__p_faiss__IndexHNSW, - &_swigt__p_faiss__IndexHNSW2Level, - &_swigt__p_faiss__IndexHNSWFlat, - &_swigt__p_faiss__IndexHNSWPQ, - &_swigt__p_faiss__IndexHNSWSQ, - &_swigt__p_faiss__IndexIDMap, - &_swigt__p_faiss__IndexIDMap2, - &_swigt__p_faiss__IndexIVF, - &_swigt__p_faiss__IndexIVFFlat, - &_swigt__p_faiss__IndexIVFFlatDedup, - &_swigt__p_faiss__IndexIVFPQ, - &_swigt__p_faiss__IndexIVFPQR, - &_swigt__p_faiss__IndexIVFPQStats, - &_swigt__p_faiss__IndexIVFScalarQuantizer, - &_swigt__p_faiss__IndexIVFStats, - &_swigt__p_faiss__IndexLSH, - &_swigt__p_faiss__IndexPQ, - &_swigt__p_faiss__IndexPQStats, - &_swigt__p_faiss__IndexPreTransform, - &_swigt__p_faiss__IndexRefineFlat, - &_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, - &_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, - &_swigt__p_faiss__IndexScalarQuantizer, - &_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, - &_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, - &_swigt__p_faiss__IndexSplitVectors, - &_swigt__p_faiss__InterruptCallback, - &_swigt__p_faiss__IntersectionCriterion, - &_swigt__p_faiss__InvertedListScanner, - &_swigt__p_faiss__InvertedLists, - &_swigt__p_faiss__Level1Quantizer, - &_swigt__p_faiss__LinearTransform, - &_swigt__p_faiss__LockLevels, - &_swigt__p_faiss__MatrixStats, - &_swigt__p_faiss__MultiIndexQuantizer, - &_swigt__p_faiss__MultiIndexQuantizer2, - &_swigt__p_faiss__NormalizationTransform, - &_swigt__p_faiss__OPQMatrix, - &_swigt__p_faiss__OnDiskInvertedLists, - &_swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch, - &_swigt__p_faiss__OneRecallAtRCriterion, - &_swigt__p_faiss__OperatingPoint, - &_swigt__p_faiss__OperatingPoints, - &_swigt__p_faiss__PCAMatrix, - &_swigt__p_faiss__ParameterRange, - &_swigt__p_faiss__ParameterSpace, - &_swigt__p_faiss__PermutationObjective, - &_swigt__p_faiss__PolysemousTraining, - &_swigt__p_faiss__ProductQuantizer, - &_swigt__p_faiss__RandomGenerator, - &_swigt__p_faiss__RandomRotationMatrix, - &_swigt__p_faiss__RangeQueryResult, - &_swigt__p_faiss__RangeSearchPartialResult, - &_swigt__p_faiss__RangeSearchResult, - &_swigt__p_faiss__ReconstructFromNeighbors, - &_swigt__p_faiss__RemapDimensionsTransform, - &_swigt__p_faiss__ReproduceDistancesObjective, - &_swigt__p_faiss__SQDistanceComputer, - &_swigt__p_faiss__ScalarQuantizer, - &_swigt__p_faiss__SimulatedAnnealingOptimizer, - &_swigt__p_faiss__SimulatedAnnealingParameters, - &_swigt__p_faiss__VectorIOReader, - &_swigt__p_faiss__VectorIOWriter, - &_swigt__p_faiss__VectorTransform, - &_swigt__p_faiss__VisitedTable, - &_swigt__p_faiss__gpu__FlatIndex, - &_swigt__p_faiss__gpu__GpuClonerOptions, - &_swigt__p_faiss__gpu__GpuIndex, - &_swigt__p_faiss__gpu__GpuIndexBinaryFlat, - &_swigt__p_faiss__gpu__GpuIndexBinaryFlatConfig, - &_swigt__p_faiss__gpu__GpuIndexConfig, - &_swigt__p_faiss__gpu__GpuIndexFlat, - &_swigt__p_faiss__gpu__GpuIndexFlatConfig, - &_swigt__p_faiss__gpu__GpuIndexFlatIP, - &_swigt__p_faiss__gpu__GpuIndexFlatL2, - &_swigt__p_faiss__gpu__GpuIndexIVF, - &_swigt__p_faiss__gpu__GpuIndexIVFConfig, - &_swigt__p_faiss__gpu__GpuIndexIVFFlat, - &_swigt__p_faiss__gpu__GpuIndexIVFFlatConfig, - &_swigt__p_faiss__gpu__GpuIndexIVFPQ, - &_swigt__p_faiss__gpu__GpuIndexIVFPQConfig, - &_swigt__p_faiss__gpu__GpuMultipleClonerOptions, - &_swigt__p_faiss__gpu__GpuParameterSpace, - &_swigt__p_faiss__gpu__GpuResources, - &_swigt__p_faiss__gpu__StandardGpuResources, - &_swigt__p_faiss__ivflib__SlidingIndexWindow, - &_swigt__p_float, - &_swigt__p_idx_t, - &_swigt__p_int, - &_swigt__p_long, - &_swigt__p_omp_lock_t, - &_swigt__p_p_faiss__ArrayInvertedLists, - &_swigt__p_p_faiss__CenteringTransform, - &_swigt__p_p_faiss__ConcatenatedInvertedLists, - &_swigt__p_p_faiss__Index, - &_swigt__p_p_faiss__Index2Layer, - &_swigt__p_p_faiss__IndexFlat, - &_swigt__p_p_faiss__IndexFlat1D, - &_swigt__p_p_faiss__IndexFlatIP, - &_swigt__p_p_faiss__IndexFlatL2, - &_swigt__p_p_faiss__IndexFlatL2BaseShift, - &_swigt__p_p_faiss__IndexHNSW, - &_swigt__p_p_faiss__IndexHNSW2Level, - &_swigt__p_p_faiss__IndexHNSWFlat, - &_swigt__p_p_faiss__IndexHNSWPQ, - &_swigt__p_p_faiss__IndexHNSWSQ, - &_swigt__p_p_faiss__IndexIDMap, - &_swigt__p_p_faiss__IndexIDMap2, - &_swigt__p_p_faiss__IndexIVF, - &_swigt__p_p_faiss__IndexIVFFlat, - &_swigt__p_p_faiss__IndexIVFFlatDedup, - &_swigt__p_p_faiss__IndexIVFPQ, - &_swigt__p_p_faiss__IndexIVFPQR, - &_swigt__p_p_faiss__IndexIVFScalarQuantizer, - &_swigt__p_p_faiss__IndexLSH, - &_swigt__p_p_faiss__IndexPQ, - &_swigt__p_p_faiss__IndexPreTransform, - &_swigt__p_p_faiss__IndexRefineFlat, - &_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, - &_swigt__p_p_faiss__IndexScalarQuantizer, - &_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, - &_swigt__p_p_faiss__IndexSplitVectors, - &_swigt__p_p_faiss__InvertedLists, - &_swigt__p_p_faiss__LinearTransform, - &_swigt__p_p_faiss__MultiIndexQuantizer, - &_swigt__p_p_faiss__MultiIndexQuantizer2, - &_swigt__p_p_faiss__NormalizationTransform, - &_swigt__p_p_faiss__OPQMatrix, - &_swigt__p_p_faiss__OnDiskInvertedLists, - &_swigt__p_p_faiss__PCAMatrix, - &_swigt__p_p_faiss__RandomRotationMatrix, - &_swigt__p_p_faiss__RemapDimensionsTransform, - &_swigt__p_p_faiss__VectorTransform, - &_swigt__p_p_faiss__gpu__GpuIndex, - &_swigt__p_p_faiss__gpu__GpuIndexFlat, - &_swigt__p_p_faiss__gpu__GpuIndexFlatIP, - &_swigt__p_p_faiss__gpu__GpuIndexFlatL2, - &_swigt__p_p_faiss__gpu__GpuIndexIVF, - &_swigt__p_p_faiss__gpu__GpuIndexIVFFlat, - &_swigt__p_p_faiss__gpu__GpuIndexIVFPQ, - &_swigt__p_p_faiss__gpu__GpuResources, - &_swigt__p_p_faiss__gpu__StandardGpuResources, - &_swigt__p_p_void, - &_swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t, - &_swigt__p_std__functionT_void_ffaiss__Index_pF_t, - &_swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, - &_swigt__p_std__mt19937, - &_swigt__p_std__pairT_float_int_t, - &_swigt__p_std__pairT_void_p_unsigned_long_t, - &_swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, - &_swigt__p_std__priority_queueT_std__pairT_float_int_t_t, - &_swigt__p_std__unordered_mapT_long_long_t, - &_swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, - &_swigt__p_std__unordered_multimapT_long_long_t, - &_swigt__p_std__vectorT_char_t, - &_swigt__p_std__vectorT_cudaStream_t_t, - &_swigt__p_std__vectorT_double_t, - &_swigt__p_std__vectorT_faiss__BufferList__Buffer_t, - &_swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, - &_swigt__p_std__vectorT_faiss__IndexBinary_p_t, - &_swigt__p_std__vectorT_faiss__Index_p_t, - &_swigt__p_std__vectorT_faiss__InvertedLists_const_p_t, - &_swigt__p_std__vectorT_faiss__InvertedLists_p_t, - &_swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, - &_swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, - &_swigt__p_std__vectorT_faiss__OperatingPoint_t, - &_swigt__p_std__vectorT_faiss__ParameterRange_t, - &_swigt__p_std__vectorT_faiss__RangeQueryResult_t, - &_swigt__p_std__vectorT_faiss__VectorTransform_p_t, - &_swigt__p_std__vectorT_faiss__gpu__GpuResources_p_t, - &_swigt__p_std__vectorT_float_t, - &_swigt__p_std__vectorT_int_t, - &_swigt__p_std__vectorT_long_t, - &_swigt__p_std__vectorT_omp_lock_t_t, - &_swigt__p_std__vectorT_std__vectorT_float_t_t, - &_swigt__p_std__vectorT_std__vectorT_long_t_t, - &_swigt__p_std__vectorT_std__vectorT_uint8_t_t_t, - &_swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t, - &_swigt__p_std__vectorT_unsigned_char_t, - &_swigt__p_std__vectorT_unsigned_long_t, - &_swigt__p_storage_idx_t, - &_swigt__p_uint32_t, - &_swigt__p_unsigned_char, - &_swigt__p_unsigned_long, - &_swigt__p_void, -}; - -static swig_cast_info _swigc__p_Crev[] = { {&_swigt__p_Crev, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_MapLong2Long[] = { {&_swigt__p_MapLong2Long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Node[] = { {&_swigt__p_Node, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_T[] = { {&_swigt__p_T, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_TI[] = { {&_swigt__p_TI, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_component_t[] = { {&_swigt__p_component_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_cublasHandle_t[] = { {&_swigt__p_cublasHandle_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_cudaStream_t[] = { {&_swigt__p_cudaStream_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_distance_t[] = { {&_swigt__p_distance_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ArrayInvertedLists[] = { {&_swigt__p_faiss__ArrayInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__AutoTuneCriterion[] = { {&_swigt__p_faiss__AutoTuneCriterion, 0, 0, 0}, {&_swigt__p_faiss__OneRecallAtRCriterion, _p_faiss__OneRecallAtRCriterionTo_p_faiss__AutoTuneCriterion, 0, 0}, {&_swigt__p_faiss__IntersectionCriterion, _p_faiss__IntersectionCriterionTo_p_faiss__AutoTuneCriterion, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__BinaryInvertedListScanner[] = { {&_swigt__p_faiss__BinaryInvertedListScanner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__BufferList[] = { {&_swigt__p_faiss__RangeSearchPartialResult, _p_faiss__RangeSearchPartialResultTo_p_faiss__BufferList, 0, 0}, {&_swigt__p_faiss__BufferList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__CenteringTransform[] = { {&_swigt__p_faiss__CenteringTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Cloner[] = { {&_swigt__p_faiss__Cloner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Clustering[] = { {&_swigt__p_faiss__Clustering, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ClusteringParameters[] = { {&_swigt__p_faiss__Clustering, _p_faiss__ClusteringTo_p_faiss__ClusteringParameters, 0, 0}, {&_swigt__p_faiss__ClusteringParameters, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ConcatenatedInvertedLists[] = { {&_swigt__p_faiss__ConcatenatedInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__DistanceComputer[] = { {&_swigt__p_faiss__DistanceComputer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer16[] = { {&_swigt__p_faiss__GenHammingComputer16, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer32[] = { {&_swigt__p_faiss__GenHammingComputer32, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer8[] = { {&_swigt__p_faiss__GenHammingComputer8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputerM8[] = { {&_swigt__p_faiss__GenHammingComputerM8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSW[] = { {&_swigt__p_faiss__HNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSWStats[] = { {&_swigt__p_faiss__HNSWStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSW__MinimaxHeap[] = { {&_swigt__p_faiss__HNSW__MinimaxHeap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer16[] = { {&_swigt__p_faiss__HammingComputer16, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer20[] = { {&_swigt__p_faiss__HammingComputer20, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer32[] = { {&_swigt__p_faiss__HammingComputer32, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer4[] = { {&_swigt__p_faiss__HammingComputer4, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer64[] = { {&_swigt__p_faiss__HammingComputer64, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer8[] = { {&_swigt__p_faiss__HammingComputer8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerDefault[] = { {&_swigt__p_faiss__HammingComputerDefault, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerM4[] = { {&_swigt__p_faiss__HammingComputerM4, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerM8[] = { {&_swigt__p_faiss__HammingComputerM8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelector[] = { {&_swigt__p_faiss__IDSelector, 0, 0, 0}, {&_swigt__p_faiss__IDSelectorBatch, _p_faiss__IDSelectorBatchTo_p_faiss__IDSelector, 0, 0}, {&_swigt__p_faiss__IDSelectorRange, _p_faiss__IDSelectorRangeTo_p_faiss__IDSelector, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelectorBatch[] = { {&_swigt__p_faiss__IDSelectorBatch, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelectorRange[] = { {&_swigt__p_faiss__IDSelectorRange, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IOReader[] = { {&_swigt__p_faiss__IOReader, 0, 0, 0}, {&_swigt__p_faiss__VectorIOReader, _p_faiss__VectorIOReaderTo_p_faiss__IOReader, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IOWriter[] = { {&_swigt__p_faiss__IOWriter, 0, 0, 0}, {&_swigt__p_faiss__VectorIOWriter, _p_faiss__VectorIOWriterTo_p_faiss__IOWriter, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IVFPQSearchParameters[] = { {&_swigt__p_faiss__IVFPQSearchParameters, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IVFSearchParameters[] = { {&_swigt__p_faiss__IVFSearchParameters, 0, 0, 0}, {&_swigt__p_faiss__IVFPQSearchParameters, _p_faiss__IVFPQSearchParametersTo_p_faiss__IVFSearchParameters, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Index[] = { {&_swigt__p_faiss__IndexPQ, _p_faiss__IndexPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexPreTransform, _p_faiss__IndexPreTransformTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__Index, 0, 0, 0}, {&_swigt__p_faiss__IndexSplitVectors, _p_faiss__IndexSplitVectorsTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIDMap2, _p_faiss__IndexIDMap2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFFlat, _p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer, _p_faiss__MultiIndexQuantizerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexScalarQuantizer, _p_faiss__IndexScalarQuantizerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexRefineFlat, _p_faiss__IndexRefineFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFPQ, _p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexLSH, _p_faiss__IndexLSHTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWSQ, _p_faiss__IndexHNSWSQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndex, _p_faiss__gpu__GpuIndexTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIDMap, _p_faiss__IndexIDMapTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSW2Level, _p_faiss__IndexHNSW2LevelTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__Index2Layer, _p_faiss__Index2LayerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatL2, _p_faiss__IndexFlatL2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatL2, _p_faiss__gpu__GpuIndexFlatL2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWFlat, _p_faiss__IndexHNSWFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlat, _p_faiss__IndexFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlat, _p_faiss__gpu__GpuIndexFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatIP, _p_faiss__IndexFlatIPTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatIP, _p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSW, _p_faiss__IndexHNSWTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWPQ, _p_faiss__IndexHNSWPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVF, _p_faiss__gpu__GpuIndexIVFTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVF, _p_faiss__IndexIVFTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer2, _p_faiss__MultiIndexQuantizer2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, _p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, _p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_faiss__Index, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Index2Layer[] = { {&_swigt__p_faiss__Index2Layer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinary[] = { {&_swigt__p_faiss__IndexBinaryFlat, _p_faiss__IndexBinaryFlatTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexBinaryFlat, _p_faiss__gpu__GpuIndexBinaryFlatTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinary, 0, 0, 0}, {&_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, _p_faiss__IndexShardsTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, _p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryHNSW, _p_faiss__IndexBinaryHNSWTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryIVF, _p_faiss__IndexBinaryIVFTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryFromFloat, _p_faiss__IndexBinaryFromFloatTo_p_faiss__IndexBinary, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryFlat[] = { {&_swigt__p_faiss__IndexBinaryFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryFromFloat[] = { {&_swigt__p_faiss__IndexBinaryFromFloat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryHNSW[] = { {&_swigt__p_faiss__IndexBinaryHNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryIVF[] = { {&_swigt__p_faiss__IndexBinaryIVF, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlat[] = { {&_swigt__p_faiss__IndexFlat, 0, 0, 0}, {&_swigt__p_faiss__IndexFlatL2, _p_faiss__IndexFlatL2To_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlatIP, _p_faiss__IndexFlatIPTo_p_faiss__IndexFlat, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlat1D[] = { {&_swigt__p_faiss__IndexFlat1D, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatIP[] = { {&_swigt__p_faiss__IndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatL2[] = { {&_swigt__p_faiss__IndexFlatL2, 0, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__IndexFlatL2, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlatL2, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatL2BaseShift[] = { {&_swigt__p_faiss__IndexFlatL2BaseShift, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSW[] = { {&_swigt__p_faiss__IndexHNSWFlat, _p_faiss__IndexHNSWFlatTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSW, 0, 0, 0}, {&_swigt__p_faiss__IndexHNSWSQ, _p_faiss__IndexHNSWSQTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSWPQ, _p_faiss__IndexHNSWPQTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSW2Level, _p_faiss__IndexHNSW2LevelTo_p_faiss__IndexHNSW, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSW2Level[] = { {&_swigt__p_faiss__IndexHNSW2Level, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWFlat[] = { {&_swigt__p_faiss__IndexHNSWFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWPQ[] = { {&_swigt__p_faiss__IndexHNSWPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWSQ[] = { {&_swigt__p_faiss__IndexHNSWSQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIDMap[] = { {&_swigt__p_faiss__IndexIDMap2, _p_faiss__IndexIDMap2To_p_faiss__IndexIDMap, 0, 0}, {&_swigt__p_faiss__IndexIDMap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIDMap2[] = { {&_swigt__p_faiss__IndexIDMap2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVF[] = { {&_swigt__p_faiss__IndexIVF, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__IndexIVF, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFFlat[] = { {&_swigt__p_faiss__IndexIVFFlat, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVFFlat, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFFlatDedup[] = { {&_swigt__p_faiss__IndexIVFFlatDedup, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQ[] = { {&_swigt__p_faiss__IndexIVFPQ, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__IndexIVFPQ, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQR[] = { {&_swigt__p_faiss__IndexIVFPQR, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQStats[] = { {&_swigt__p_faiss__IndexIVFPQStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFScalarQuantizer[] = { {&_swigt__p_faiss__IndexIVFScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFStats[] = { {&_swigt__p_faiss__IndexIVFStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexLSH[] = { {&_swigt__p_faiss__IndexLSH, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPQ[] = { {&_swigt__p_faiss__IndexPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPQStats[] = { {&_swigt__p_faiss__IndexPQStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPreTransform[] = { {&_swigt__p_faiss__IndexPreTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexRefineFlat[] = { {&_swigt__p_faiss__IndexRefineFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t[] = { {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexReplicasTemplateT_faiss__Index_t[] = { {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexScalarQuantizer[] = { {&_swigt__p_faiss__IndexScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t[] = { {&_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexShardsTemplateT_faiss__Index_t[] = { {&_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexSplitVectors[] = { {&_swigt__p_faiss__IndexSplitVectors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InterruptCallback[] = { {&_swigt__p_faiss__InterruptCallback, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IntersectionCriterion[] = { {&_swigt__p_faiss__IntersectionCriterion, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InvertedListScanner[] = { {&_swigt__p_faiss__InvertedListScanner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InvertedLists[] = { {&_swigt__p_faiss__InvertedLists, 0, 0, 0}, {&_swigt__p_faiss__ArrayInvertedLists, _p_faiss__ArrayInvertedListsTo_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_faiss__ConcatenatedInvertedLists, _p_faiss__ConcatenatedInvertedListsTo_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_faiss__OnDiskInvertedLists, _p_faiss__OnDiskInvertedListsTo_p_faiss__InvertedLists, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Level1Quantizer[] = { {&_swigt__p_faiss__Level1Quantizer, 0, 0, 0}, {&_swigt__p_faiss__IndexIVF, _p_faiss__IndexIVFTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__Level1Quantizer, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__LinearTransform[] = { {&_swigt__p_faiss__RandomRotationMatrix, _p_faiss__RandomRotationMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__PCAMatrix, _p_faiss__PCAMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__OPQMatrix, _p_faiss__OPQMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__LinearTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__LockLevels[] = { {&_swigt__p_faiss__LockLevels, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MatrixStats[] = { {&_swigt__p_faiss__MatrixStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MultiIndexQuantizer[] = { {&_swigt__p_faiss__MultiIndexQuantizer, 0, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer2, _p_faiss__MultiIndexQuantizer2To_p_faiss__MultiIndexQuantizer, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MultiIndexQuantizer2[] = { {&_swigt__p_faiss__MultiIndexQuantizer2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__NormalizationTransform[] = { {&_swigt__p_faiss__NormalizationTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OPQMatrix[] = { {&_swigt__p_faiss__OPQMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OnDiskInvertedLists[] = { {&_swigt__p_faiss__OnDiskInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OnDiskInvertedLists__OngoingPrefetch[] = { {&_swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OneRecallAtRCriterion[] = { {&_swigt__p_faiss__OneRecallAtRCriterion, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OperatingPoint[] = { {&_swigt__p_faiss__OperatingPoint, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OperatingPoints[] = { {&_swigt__p_faiss__OperatingPoints, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PCAMatrix[] = { {&_swigt__p_faiss__PCAMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ParameterRange[] = { {&_swigt__p_faiss__ParameterRange, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ParameterSpace[] = { {&_swigt__p_faiss__ParameterSpace, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuParameterSpace, _p_faiss__gpu__GpuParameterSpaceTo_p_faiss__ParameterSpace, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PermutationObjective[] = { {&_swigt__p_faiss__PermutationObjective, 0, 0, 0}, {&_swigt__p_faiss__ReproduceDistancesObjective, _p_faiss__ReproduceDistancesObjectiveTo_p_faiss__PermutationObjective, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PolysemousTraining[] = { {&_swigt__p_faiss__PolysemousTraining, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ProductQuantizer[] = { {&_swigt__p_faiss__ProductQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RandomGenerator[] = { {&_swigt__p_faiss__RandomGenerator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RandomRotationMatrix[] = { {&_swigt__p_faiss__RandomRotationMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeQueryResult[] = { {&_swigt__p_faiss__RangeQueryResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeSearchPartialResult[] = { {&_swigt__p_faiss__RangeSearchPartialResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeSearchResult[] = { {&_swigt__p_faiss__RangeSearchResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ReconstructFromNeighbors[] = { {&_swigt__p_faiss__ReconstructFromNeighbors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RemapDimensionsTransform[] = { {&_swigt__p_faiss__RemapDimensionsTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ReproduceDistancesObjective[] = { {&_swigt__p_faiss__ReproduceDistancesObjective, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SQDistanceComputer[] = { {&_swigt__p_faiss__SQDistanceComputer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ScalarQuantizer[] = { {&_swigt__p_faiss__ScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SimulatedAnnealingOptimizer[] = { {&_swigt__p_faiss__SimulatedAnnealingOptimizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SimulatedAnnealingParameters[] = { {&_swigt__p_faiss__SimulatedAnnealingParameters, 0, 0, 0}, {&_swigt__p_faiss__PolysemousTraining, _p_faiss__PolysemousTrainingTo_p_faiss__SimulatedAnnealingParameters, 0, 0}, {&_swigt__p_faiss__SimulatedAnnealingOptimizer, _p_faiss__SimulatedAnnealingOptimizerTo_p_faiss__SimulatedAnnealingParameters, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorIOReader[] = { {&_swigt__p_faiss__VectorIOReader, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorIOWriter[] = { {&_swigt__p_faiss__VectorIOWriter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorTransform[] = { {&_swigt__p_faiss__RandomRotationMatrix, _p_faiss__RandomRotationMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__PCAMatrix, _p_faiss__PCAMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__OPQMatrix, _p_faiss__OPQMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__VectorTransform, 0, 0, 0}, {&_swigt__p_faiss__LinearTransform, _p_faiss__LinearTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__RemapDimensionsTransform, _p_faiss__RemapDimensionsTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__NormalizationTransform, _p_faiss__NormalizationTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__CenteringTransform, _p_faiss__CenteringTransformTo_p_faiss__VectorTransform, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VisitedTable[] = { {&_swigt__p_faiss__VisitedTable, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__FlatIndex[] = { {&_swigt__p_faiss__gpu__FlatIndex, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuClonerOptions[] = { {&_swigt__p_faiss__gpu__GpuClonerOptions, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuMultipleClonerOptions, _p_faiss__gpu__GpuMultipleClonerOptionsTo_p_faiss__gpu__GpuClonerOptions, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndex[] = { {&_swigt__p_faiss__gpu__GpuIndex, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlat, _p_faiss__gpu__GpuIndexFlatTo_p_faiss__gpu__GpuIndex, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatL2, _p_faiss__gpu__GpuIndexFlatL2To_p_faiss__gpu__GpuIndex, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVF, _p_faiss__gpu__GpuIndexIVFTo_p_faiss__gpu__GpuIndex, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFPQ, _p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__gpu__GpuIndex, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFFlat, _p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__gpu__GpuIndex, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatIP, _p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__gpu__GpuIndex, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexBinaryFlat[] = { {&_swigt__p_faiss__gpu__GpuIndexBinaryFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexBinaryFlatConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexBinaryFlatConfig, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFPQConfig, _p_faiss__gpu__GpuIndexIVFPQConfigTo_p_faiss__gpu__GpuIndexConfig, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexConfig, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatConfig, _p_faiss__gpu__GpuIndexFlatConfigTo_p_faiss__gpu__GpuIndexConfig, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFConfig, _p_faiss__gpu__GpuIndexIVFConfigTo_p_faiss__gpu__GpuIndexConfig, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFFlatConfig, _p_faiss__gpu__GpuIndexIVFFlatConfigTo_p_faiss__gpu__GpuIndexConfig, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexBinaryFlatConfig, _p_faiss__gpu__GpuIndexBinaryFlatConfigTo_p_faiss__gpu__GpuIndexConfig, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexFlat[] = { {&_swigt__p_faiss__gpu__GpuIndexFlat, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatL2, _p_faiss__gpu__GpuIndexFlatL2To_p_faiss__gpu__GpuIndexFlat, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexFlatIP, _p_faiss__gpu__GpuIndexFlatIPTo_p_faiss__gpu__GpuIndexFlat, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexFlatConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexFlatConfig, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexFlatIP[] = { {&_swigt__p_faiss__gpu__GpuIndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexFlatL2[] = { {&_swigt__p_faiss__gpu__GpuIndexFlatL2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVF[] = { {&_swigt__p_faiss__gpu__GpuIndexIVF, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFPQ, _p_faiss__gpu__GpuIndexIVFPQTo_p_faiss__gpu__GpuIndexIVF, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFFlat, _p_faiss__gpu__GpuIndexIVFFlatTo_p_faiss__gpu__GpuIndexIVF, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVFConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFPQConfig, _p_faiss__gpu__GpuIndexIVFPQConfigTo_p_faiss__gpu__GpuIndexIVFConfig, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFConfig, 0, 0, 0}, {&_swigt__p_faiss__gpu__GpuIndexIVFFlatConfig, _p_faiss__gpu__GpuIndexIVFFlatConfigTo_p_faiss__gpu__GpuIndexIVFConfig, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVFFlat[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVFFlatConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFFlatConfig, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVFPQ[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuIndexIVFPQConfig[] = { {&_swigt__p_faiss__gpu__GpuIndexIVFPQConfig, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuMultipleClonerOptions[] = { {&_swigt__p_faiss__gpu__GpuMultipleClonerOptions, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuParameterSpace[] = { {&_swigt__p_faiss__gpu__GpuParameterSpace, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__GpuResources[] = { {&_swigt__p_faiss__gpu__GpuResources, 0, 0, 0}, {&_swigt__p_faiss__gpu__StandardGpuResources, _p_faiss__gpu__StandardGpuResourcesTo_p_faiss__gpu__GpuResources, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__gpu__StandardGpuResources[] = { {&_swigt__p_faiss__gpu__StandardGpuResources, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ivflib__SlidingIndexWindow[] = { {&_swigt__p_faiss__ivflib__SlidingIndexWindow, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_idx_t[] = { {&_swigt__p_idx_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_omp_lock_t[] = { {&_swigt__p_omp_lock_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexPQ[] = {{&_swigt__p_p_faiss__IndexPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFFlatDedup[] = {{&_swigt__p_p_faiss__IndexIVFFlatDedup, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexPreTransform[] = {{&_swigt__p_p_faiss__IndexPreTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexSplitVectors[] = {{&_swigt__p_p_faiss__IndexSplitVectors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIDMap2[] = {{&_swigt__p_p_faiss__IndexIDMap2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFFlat[] = {{&_swigt__p_p_faiss__IndexIVFFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexIVFFlat[] = {{&_swigt__p_p_faiss__gpu__GpuIndexIVFFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__MultiIndexQuantizer[] = {{&_swigt__p_p_faiss__MultiIndexQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexScalarQuantizer[] = {{&_swigt__p_p_faiss__IndexScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFScalarQuantizer[] = {{&_swigt__p_p_faiss__IndexIVFScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexRefineFlat[] = {{&_swigt__p_p_faiss__IndexRefineFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexIVFPQ[] = {{&_swigt__p_p_faiss__gpu__GpuIndexIVFPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFPQ[] = {{&_swigt__p_p_faiss__IndexIVFPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexLSH[] = {{&_swigt__p_p_faiss__IndexLSH, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWSQ[] = {{&_swigt__p_p_faiss__IndexHNSWSQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndex[] = {{&_swigt__p_p_faiss__gpu__GpuIndex, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIDMap[] = {{&_swigt__p_p_faiss__IndexIDMap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSW2Level[] = {{&_swigt__p_p_faiss__IndexHNSW2Level, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__Index2Layer[] = {{&_swigt__p_p_faiss__Index2Layer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexFlatL2[] = {{&_swigt__p_p_faiss__gpu__GpuIndexFlatL2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatL2[] = {{&_swigt__p_p_faiss__IndexFlatL2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWFlat[] = {{&_swigt__p_p_faiss__IndexHNSWFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFPQR[] = {{&_swigt__p_p_faiss__IndexIVFPQR, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlat1D[] = {{&_swigt__p_p_faiss__IndexFlat1D, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexFlat[] = {{&_swigt__p_p_faiss__gpu__GpuIndexFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlat[] = {{&_swigt__p_p_faiss__IndexFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexFlatIP[] = {{&_swigt__p_p_faiss__gpu__GpuIndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatIP[] = {{&_swigt__p_p_faiss__IndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSW[] = {{&_swigt__p_p_faiss__IndexHNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWPQ[] = {{&_swigt__p_p_faiss__IndexHNSWPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatL2BaseShift[] = {{&_swigt__p_p_faiss__IndexFlatL2BaseShift, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuIndexIVF[] = {{&_swigt__p_p_faiss__gpu__GpuIndexIVF, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVF[] = {{&_swigt__p_p_faiss__IndexIVF, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__MultiIndexQuantizer2[] = {{&_swigt__p_p_faiss__MultiIndexQuantizer2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t[] = {{&_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexShardsTemplateT_faiss__Index_t[] = {{&_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__Index[] = { {&_swigt__p_p_faiss__IndexPQ, _p_p_faiss__IndexPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFFlatDedup, _p_p_faiss__IndexIVFFlatDedupTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexPreTransform, _p_p_faiss__IndexPreTransformTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__Index, 0, 0, 0}, {&_swigt__p_p_faiss__IndexSplitVectors, _p_p_faiss__IndexSplitVectorsTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIDMap2, _p_p_faiss__IndexIDMap2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFFlat, _p_p_faiss__IndexIVFFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexIVFFlat, _p_p_faiss__gpu__GpuIndexIVFFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__MultiIndexQuantizer, _p_p_faiss__MultiIndexQuantizerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexScalarQuantizer, _p_p_faiss__IndexScalarQuantizerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFScalarQuantizer, _p_p_faiss__IndexIVFScalarQuantizerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexRefineFlat, _p_p_faiss__IndexRefineFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexIVFPQ, _p_p_faiss__gpu__GpuIndexIVFPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFPQ, _p_p_faiss__IndexIVFPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexLSH, _p_p_faiss__IndexLSHTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWSQ, _p_p_faiss__IndexHNSWSQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndex, _p_p_faiss__gpu__GpuIndexTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIDMap, _p_p_faiss__IndexIDMapTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSW2Level, _p_p_faiss__IndexHNSW2LevelTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__Index2Layer, _p_p_faiss__Index2LayerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexFlatL2, _p_p_faiss__gpu__GpuIndexFlatL2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatL2, _p_p_faiss__IndexFlatL2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWFlat, _p_p_faiss__IndexHNSWFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFPQR, _p_p_faiss__IndexIVFPQRTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlat1D, _p_p_faiss__IndexFlat1DTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexFlat, _p_p_faiss__gpu__GpuIndexFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlat, _p_p_faiss__IndexFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexFlatIP, _p_p_faiss__gpu__GpuIndexFlatIPTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatIP, _p_p_faiss__IndexFlatIPTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSW, _p_p_faiss__IndexHNSWTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWPQ, _p_p_faiss__IndexHNSWPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatL2BaseShift, _p_p_faiss__IndexFlatL2BaseShiftTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__gpu__GpuIndexIVF, _p_p_faiss__gpu__GpuIndexIVFTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVF, _p_p_faiss__IndexIVFTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__MultiIndexQuantizer2, _p_p_faiss__MultiIndexQuantizer2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, _p_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, _p_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_p_faiss__Index, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__ArrayInvertedLists[] = {{&_swigt__p_p_faiss__ArrayInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__ConcatenatedInvertedLists[] = {{&_swigt__p_p_faiss__ConcatenatedInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__OnDiskInvertedLists[] = {{&_swigt__p_p_faiss__OnDiskInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__InvertedLists[] = { {&_swigt__p_p_faiss__InvertedLists, 0, 0, 0}, {&_swigt__p_p_faiss__ArrayInvertedLists, _p_p_faiss__ArrayInvertedListsTo_p_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_p_faiss__ConcatenatedInvertedLists, _p_p_faiss__ConcatenatedInvertedListsTo_p_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_p_faiss__OnDiskInvertedLists, _p_p_faiss__OnDiskInvertedListsTo_p_p_faiss__InvertedLists, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__RandomRotationMatrix[] = {{&_swigt__p_p_faiss__RandomRotationMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__PCAMatrix[] = {{&_swigt__p_p_faiss__PCAMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__OPQMatrix[] = {{&_swigt__p_p_faiss__OPQMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__LinearTransform[] = {{&_swigt__p_p_faiss__LinearTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__RemapDimensionsTransform[] = {{&_swigt__p_p_faiss__RemapDimensionsTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__NormalizationTransform[] = {{&_swigt__p_p_faiss__NormalizationTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__CenteringTransform[] = {{&_swigt__p_p_faiss__CenteringTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__VectorTransform[] = { {&_swigt__p_p_faiss__RandomRotationMatrix, _p_p_faiss__RandomRotationMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__PCAMatrix, _p_p_faiss__PCAMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__OPQMatrix, _p_p_faiss__OPQMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__VectorTransform, 0, 0, 0}, {&_swigt__p_p_faiss__LinearTransform, _p_p_faiss__LinearTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__RemapDimensionsTransform, _p_p_faiss__RemapDimensionsTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__NormalizationTransform, _p_p_faiss__NormalizationTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__CenteringTransform, _p_p_faiss__CenteringTransformTo_p_p_faiss__VectorTransform, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__StandardGpuResources[] = {{&_swigt__p_p_faiss__gpu__StandardGpuResources, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__gpu__GpuResources[] = { {&_swigt__p_p_faiss__gpu__GpuResources, 0, 0, 0}, {&_swigt__p_p_faiss__gpu__StandardGpuResources, _p_p_faiss__gpu__StandardGpuResourcesTo_p_p_faiss__gpu__GpuResources, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__functionT_void_ffaiss__IndexBinary_pF_t[] = { {&_swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__functionT_void_ffaiss__Index_pF_t[] = { {&_swigt__p_std__functionT_void_ffaiss__Index_pF_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__listT_faiss__OnDiskInvertedLists__Slot_t[] = { {&_swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__mt19937[] = { {&_swigt__p_std__mt19937, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__pairT_float_int_t[] = { {&_swigt__p_std__pairT_float_int_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__pairT_void_p_unsigned_long_t[] = { {&_swigt__p_std__pairT_void_p_unsigned_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t[] = { {&_swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__priority_queueT_std__pairT_float_int_t_t[] = { {&_swigt__p_std__priority_queueT_std__pairT_float_int_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_mapT_long_long_t[] = { {&_swigt__p_std__unordered_mapT_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t[] = { {&_swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_multimapT_long_long_t[] = { {&_swigt__p_std__unordered_multimapT_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_char_t[] = { {&_swigt__p_std__vectorT_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_cudaStream_t_t[] = { {&_swigt__p_std__vectorT_cudaStream_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_double_t[] = { {&_swigt__p_std__vectorT_double_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__BufferList__Buffer_t[] = { {&_swigt__p_std__vectorT_faiss__BufferList__Buffer_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__HNSW__NodeDistFarther_t[] = { {&_swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__IndexBinary_p_t[] = { {&_swigt__p_std__vectorT_faiss__IndexBinary_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__Index_p_t[] = { {&_swigt__p_std__vectorT_faiss__Index_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__InvertedLists_const_p_t[] = { {&_swigt__p_std__vectorT_faiss__InvertedLists_const_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__InvertedLists_p_t[] = { {&_swigt__p_std__vectorT_faiss__InvertedLists_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__MatrixStats__PerDimStats_t[] = { {&_swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__OnDiskInvertedLists__List_t[] = { {&_swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__OperatingPoint_t[] = { {&_swigt__p_std__vectorT_faiss__OperatingPoint_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__ParameterRange_t[] = { {&_swigt__p_std__vectorT_faiss__ParameterRange_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__RangeQueryResult_t[] = { {&_swigt__p_std__vectorT_faiss__RangeQueryResult_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__VectorTransform_p_t[] = { {&_swigt__p_std__vectorT_faiss__VectorTransform_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__gpu__GpuResources_p_t[] = { {&_swigt__p_std__vectorT_faiss__gpu__GpuResources_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_float_t[] = { {&_swigt__p_std__vectorT_float_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_int_t[] = { {&_swigt__p_std__vectorT_int_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_long_t[] = { {&_swigt__p_std__vectorT_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_omp_lock_t_t[] = { {&_swigt__p_std__vectorT_omp_lock_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_float_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_float_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_long_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_uint8_t_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_uint8_t_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_unsigned_long_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_unsigned_char_t[] = { {&_swigt__p_std__vectorT_unsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_unsigned_long_t[] = { {&_swigt__p_std__vectorT_unsigned_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_storage_idx_t[] = { {&_swigt__p_storage_idx_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_Crev, - _swigc__p_FILE, - _swigc__p_MapLong2Long, - _swigc__p_Node, - _swigc__p_T, - _swigc__p_TI, - _swigc__p_char, - _swigc__p_component_t, - _swigc__p_cublasHandle_t, - _swigc__p_cudaStream_t, - _swigc__p_distance_t, - _swigc__p_double, - _swigc__p_faiss__ArrayInvertedLists, - _swigc__p_faiss__AutoTuneCriterion, - _swigc__p_faiss__BinaryInvertedListScanner, - _swigc__p_faiss__BufferList, - _swigc__p_faiss__CenteringTransform, - _swigc__p_faiss__Cloner, - _swigc__p_faiss__Clustering, - _swigc__p_faiss__ClusteringParameters, - _swigc__p_faiss__ConcatenatedInvertedLists, - _swigc__p_faiss__DistanceComputer, - _swigc__p_faiss__GenHammingComputer16, - _swigc__p_faiss__GenHammingComputer32, - _swigc__p_faiss__GenHammingComputer8, - _swigc__p_faiss__GenHammingComputerM8, - _swigc__p_faiss__HNSW, - _swigc__p_faiss__HNSWStats, - _swigc__p_faiss__HNSW__MinimaxHeap, - _swigc__p_faiss__HammingComputer16, - _swigc__p_faiss__HammingComputer20, - _swigc__p_faiss__HammingComputer32, - _swigc__p_faiss__HammingComputer4, - _swigc__p_faiss__HammingComputer64, - _swigc__p_faiss__HammingComputer8, - _swigc__p_faiss__HammingComputerDefault, - _swigc__p_faiss__HammingComputerM4, - _swigc__p_faiss__HammingComputerM8, - _swigc__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, - _swigc__p_faiss__IDSelector, - _swigc__p_faiss__IDSelectorBatch, - _swigc__p_faiss__IDSelectorRange, - _swigc__p_faiss__IOReader, - _swigc__p_faiss__IOWriter, - _swigc__p_faiss__IVFPQSearchParameters, - _swigc__p_faiss__IVFSearchParameters, - _swigc__p_faiss__Index, - _swigc__p_faiss__Index2Layer, - _swigc__p_faiss__IndexBinary, - _swigc__p_faiss__IndexBinaryFlat, - _swigc__p_faiss__IndexBinaryFromFloat, - _swigc__p_faiss__IndexBinaryHNSW, - _swigc__p_faiss__IndexBinaryIVF, - _swigc__p_faiss__IndexFlat, - _swigc__p_faiss__IndexFlat1D, - _swigc__p_faiss__IndexFlatIP, - _swigc__p_faiss__IndexFlatL2, - _swigc__p_faiss__IndexFlatL2BaseShift, - _swigc__p_faiss__IndexHNSW, - _swigc__p_faiss__IndexHNSW2Level, - _swigc__p_faiss__IndexHNSWFlat, - _swigc__p_faiss__IndexHNSWPQ, - _swigc__p_faiss__IndexHNSWSQ, - _swigc__p_faiss__IndexIDMap, - _swigc__p_faiss__IndexIDMap2, - _swigc__p_faiss__IndexIVF, - _swigc__p_faiss__IndexIVFFlat, - _swigc__p_faiss__IndexIVFFlatDedup, - _swigc__p_faiss__IndexIVFPQ, - _swigc__p_faiss__IndexIVFPQR, - _swigc__p_faiss__IndexIVFPQStats, - _swigc__p_faiss__IndexIVFScalarQuantizer, - _swigc__p_faiss__IndexIVFStats, - _swigc__p_faiss__IndexLSH, - _swigc__p_faiss__IndexPQ, - _swigc__p_faiss__IndexPQStats, - _swigc__p_faiss__IndexPreTransform, - _swigc__p_faiss__IndexRefineFlat, - _swigc__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, - _swigc__p_faiss__IndexReplicasTemplateT_faiss__Index_t, - _swigc__p_faiss__IndexScalarQuantizer, - _swigc__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, - _swigc__p_faiss__IndexShardsTemplateT_faiss__Index_t, - _swigc__p_faiss__IndexSplitVectors, - _swigc__p_faiss__InterruptCallback, - _swigc__p_faiss__IntersectionCriterion, - _swigc__p_faiss__InvertedListScanner, - _swigc__p_faiss__InvertedLists, - _swigc__p_faiss__Level1Quantizer, - _swigc__p_faiss__LinearTransform, - _swigc__p_faiss__LockLevels, - _swigc__p_faiss__MatrixStats, - _swigc__p_faiss__MultiIndexQuantizer, - _swigc__p_faiss__MultiIndexQuantizer2, - _swigc__p_faiss__NormalizationTransform, - _swigc__p_faiss__OPQMatrix, - _swigc__p_faiss__OnDiskInvertedLists, - _swigc__p_faiss__OnDiskInvertedLists__OngoingPrefetch, - _swigc__p_faiss__OneRecallAtRCriterion, - _swigc__p_faiss__OperatingPoint, - _swigc__p_faiss__OperatingPoints, - _swigc__p_faiss__PCAMatrix, - _swigc__p_faiss__ParameterRange, - _swigc__p_faiss__ParameterSpace, - _swigc__p_faiss__PermutationObjective, - _swigc__p_faiss__PolysemousTraining, - _swigc__p_faiss__ProductQuantizer, - _swigc__p_faiss__RandomGenerator, - _swigc__p_faiss__RandomRotationMatrix, - _swigc__p_faiss__RangeQueryResult, - _swigc__p_faiss__RangeSearchPartialResult, - _swigc__p_faiss__RangeSearchResult, - _swigc__p_faiss__ReconstructFromNeighbors, - _swigc__p_faiss__RemapDimensionsTransform, - _swigc__p_faiss__ReproduceDistancesObjective, - _swigc__p_faiss__SQDistanceComputer, - _swigc__p_faiss__ScalarQuantizer, - _swigc__p_faiss__SimulatedAnnealingOptimizer, - _swigc__p_faiss__SimulatedAnnealingParameters, - _swigc__p_faiss__VectorIOReader, - _swigc__p_faiss__VectorIOWriter, - _swigc__p_faiss__VectorTransform, - _swigc__p_faiss__VisitedTable, - _swigc__p_faiss__gpu__FlatIndex, - _swigc__p_faiss__gpu__GpuClonerOptions, - _swigc__p_faiss__gpu__GpuIndex, - _swigc__p_faiss__gpu__GpuIndexBinaryFlat, - _swigc__p_faiss__gpu__GpuIndexBinaryFlatConfig, - _swigc__p_faiss__gpu__GpuIndexConfig, - _swigc__p_faiss__gpu__GpuIndexFlat, - _swigc__p_faiss__gpu__GpuIndexFlatConfig, - _swigc__p_faiss__gpu__GpuIndexFlatIP, - _swigc__p_faiss__gpu__GpuIndexFlatL2, - _swigc__p_faiss__gpu__GpuIndexIVF, - _swigc__p_faiss__gpu__GpuIndexIVFConfig, - _swigc__p_faiss__gpu__GpuIndexIVFFlat, - _swigc__p_faiss__gpu__GpuIndexIVFFlatConfig, - _swigc__p_faiss__gpu__GpuIndexIVFPQ, - _swigc__p_faiss__gpu__GpuIndexIVFPQConfig, - _swigc__p_faiss__gpu__GpuMultipleClonerOptions, - _swigc__p_faiss__gpu__GpuParameterSpace, - _swigc__p_faiss__gpu__GpuResources, - _swigc__p_faiss__gpu__StandardGpuResources, - _swigc__p_faiss__ivflib__SlidingIndexWindow, - _swigc__p_float, - _swigc__p_idx_t, - _swigc__p_int, - _swigc__p_long, - _swigc__p_omp_lock_t, - _swigc__p_p_faiss__ArrayInvertedLists, - _swigc__p_p_faiss__CenteringTransform, - _swigc__p_p_faiss__ConcatenatedInvertedLists, - _swigc__p_p_faiss__Index, - _swigc__p_p_faiss__Index2Layer, - _swigc__p_p_faiss__IndexFlat, - _swigc__p_p_faiss__IndexFlat1D, - _swigc__p_p_faiss__IndexFlatIP, - _swigc__p_p_faiss__IndexFlatL2, - _swigc__p_p_faiss__IndexFlatL2BaseShift, - _swigc__p_p_faiss__IndexHNSW, - _swigc__p_p_faiss__IndexHNSW2Level, - _swigc__p_p_faiss__IndexHNSWFlat, - _swigc__p_p_faiss__IndexHNSWPQ, - _swigc__p_p_faiss__IndexHNSWSQ, - _swigc__p_p_faiss__IndexIDMap, - _swigc__p_p_faiss__IndexIDMap2, - _swigc__p_p_faiss__IndexIVF, - _swigc__p_p_faiss__IndexIVFFlat, - _swigc__p_p_faiss__IndexIVFFlatDedup, - _swigc__p_p_faiss__IndexIVFPQ, - _swigc__p_p_faiss__IndexIVFPQR, - _swigc__p_p_faiss__IndexIVFScalarQuantizer, - _swigc__p_p_faiss__IndexLSH, - _swigc__p_p_faiss__IndexPQ, - _swigc__p_p_faiss__IndexPreTransform, - _swigc__p_p_faiss__IndexRefineFlat, - _swigc__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, - _swigc__p_p_faiss__IndexScalarQuantizer, - _swigc__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, - _swigc__p_p_faiss__IndexSplitVectors, - _swigc__p_p_faiss__InvertedLists, - _swigc__p_p_faiss__LinearTransform, - _swigc__p_p_faiss__MultiIndexQuantizer, - _swigc__p_p_faiss__MultiIndexQuantizer2, - _swigc__p_p_faiss__NormalizationTransform, - _swigc__p_p_faiss__OPQMatrix, - _swigc__p_p_faiss__OnDiskInvertedLists, - _swigc__p_p_faiss__PCAMatrix, - _swigc__p_p_faiss__RandomRotationMatrix, - _swigc__p_p_faiss__RemapDimensionsTransform, - _swigc__p_p_faiss__VectorTransform, - _swigc__p_p_faiss__gpu__GpuIndex, - _swigc__p_p_faiss__gpu__GpuIndexFlat, - _swigc__p_p_faiss__gpu__GpuIndexFlatIP, - _swigc__p_p_faiss__gpu__GpuIndexFlatL2, - _swigc__p_p_faiss__gpu__GpuIndexIVF, - _swigc__p_p_faiss__gpu__GpuIndexIVFFlat, - _swigc__p_p_faiss__gpu__GpuIndexIVFPQ, - _swigc__p_p_faiss__gpu__GpuResources, - _swigc__p_p_faiss__gpu__StandardGpuResources, - _swigc__p_p_void, - _swigc__p_std__functionT_void_ffaiss__IndexBinary_pF_t, - _swigc__p_std__functionT_void_ffaiss__Index_pF_t, - _swigc__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, - _swigc__p_std__mt19937, - _swigc__p_std__pairT_float_int_t, - _swigc__p_std__pairT_void_p_unsigned_long_t, - _swigc__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, - _swigc__p_std__priority_queueT_std__pairT_float_int_t_t, - _swigc__p_std__unordered_mapT_long_long_t, - _swigc__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, - _swigc__p_std__unordered_multimapT_long_long_t, - _swigc__p_std__vectorT_char_t, - _swigc__p_std__vectorT_cudaStream_t_t, - _swigc__p_std__vectorT_double_t, - _swigc__p_std__vectorT_faiss__BufferList__Buffer_t, - _swigc__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, - _swigc__p_std__vectorT_faiss__IndexBinary_p_t, - _swigc__p_std__vectorT_faiss__Index_p_t, - _swigc__p_std__vectorT_faiss__InvertedLists_const_p_t, - _swigc__p_std__vectorT_faiss__InvertedLists_p_t, - _swigc__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, - _swigc__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, - _swigc__p_std__vectorT_faiss__OperatingPoint_t, - _swigc__p_std__vectorT_faiss__ParameterRange_t, - _swigc__p_std__vectorT_faiss__RangeQueryResult_t, - _swigc__p_std__vectorT_faiss__VectorTransform_p_t, - _swigc__p_std__vectorT_faiss__gpu__GpuResources_p_t, - _swigc__p_std__vectorT_float_t, - _swigc__p_std__vectorT_int_t, - _swigc__p_std__vectorT_long_t, - _swigc__p_std__vectorT_omp_lock_t_t, - _swigc__p_std__vectorT_std__vectorT_float_t_t, - _swigc__p_std__vectorT_std__vectorT_long_t_t, - _swigc__p_std__vectorT_std__vectorT_uint8_t_t_t, - _swigc__p_std__vectorT_std__vectorT_unsigned_long_t_t, - _swigc__p_std__vectorT_unsigned_char_t, - _swigc__p_std__vectorT_unsigned_long_t, - _swigc__p_storage_idx_t, - _swigc__p_uint32_t, - _swigc__p_unsigned_char, - _swigc__p_unsigned_long, - _swigc__p_void, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; - } - - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&varlink_type) < 0) - return NULL; -#endif - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - strncpy(gv->name,name,size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md; -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 - PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule((char *) SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - PyDict_SetItemString(md,(char *)"cvar", SWIG_globals()); - SWIG_addvarlink(SWIG_globals(),(char *)"hamming_batch_size",Swig_var_hamming_batch_size_get, Swig_var_hamming_batch_size_set); - SWIG_addvarlink(SWIG_globals(),(char *)"distance_compute_blas_threshold",Swig_var_distance_compute_blas_threshold_get, Swig_var_distance_compute_blas_threshold_set); - SWIG_Python_SetConstant(d, "FAISS_VERSION_MAJOR",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "FAISS_VERSION_MINOR",SWIG_From_int(static_cast< int >(4))); - SWIG_Python_SetConstant(d, "FAISS_VERSION_PATCH",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "METRIC_INNER_PRODUCT",SWIG_From_int(static_cast< int >(faiss::METRIC_INNER_PRODUCT))); - SWIG_Python_SetConstant(d, "METRIC_L2",SWIG_From_int(static_cast< int >(faiss::METRIC_L2))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_default",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_default))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hot_start",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hot_start))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_shared",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_shared))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hypercube",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hypercube))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hypercube_pca",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hypercube_pca))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_None",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_None))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_ReproduceDistances_affine",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_ReproduceDistances_affine))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_Ranking_weighted_diff",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_Ranking_weighted_diff))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_PQ",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_PQ))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_HE",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_HE))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_generalized_HE",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_generalized_HE))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_SDC",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_SDC))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_polysemous",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_polysemous))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_polysemous_generalize",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_polysemous_generalize))); - SWIG_addvarlink(SWIG_globals(),(char *)"indexPQ_stats",Swig_var_indexPQ_stats_get, Swig_var_indexPQ_stats_set); - SWIG_addvarlink(SWIG_globals(),(char *)"indexIVF_stats",Swig_var_indexIVF_stats_get, Swig_var_indexIVF_stats_set); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_4bit",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_4bit))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit_uniform",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit_uniform))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_4bit_uniform",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_4bit_uniform))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_fp16",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_fp16))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit_direct",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit_direct))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_minmax",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_minmax))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_meanstd",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_meanstd))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_quantiles",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_quantiles))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_optim",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_optim))); - SWIG_addvarlink(SWIG_globals(),(char *)"hnsw_stats",Swig_var_hnsw_stats_get, Swig_var_hnsw_stats_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IndexIVFPQ_precomputed_table_max_bytes",Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get, Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set); - SWIG_addvarlink(SWIG_globals(),(char *)"indexIVFPQ_stats",Swig_var_indexIVFPQ_stats_get, Swig_var_indexIVFPQ_stats_set); - SWIG_Python_SetConstant(d, "INDICES_CPU",SWIG_From_int(static_cast< int >(faiss::gpu::INDICES_CPU))); - SWIG_Python_SetConstant(d, "INDICES_IVF",SWIG_From_int(static_cast< int >(faiss::gpu::INDICES_IVF))); - SWIG_Python_SetConstant(d, "INDICES_32_BIT",SWIG_From_int(static_cast< int >(faiss::gpu::INDICES_32_BIT))); - SWIG_Python_SetConstant(d, "INDICES_64_BIT",SWIG_From_int(static_cast< int >(faiss::gpu::INDICES_64_BIT))); - SWIG_Python_SetConstant(d, "Device",SWIG_From_int(static_cast< int >(faiss::gpu::Device))); - SWIG_Python_SetConstant(d, "Unified",SWIG_From_int(static_cast< int >(faiss::gpu::Unified))); - SWIG_Python_SetConstant(d, "HostPinned",SWIG_From_int(static_cast< int >(faiss::gpu::HostPinned))); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_MMAP",Swig_var_IO_FLAG_MMAP_get, Swig_var_IO_FLAG_MMAP_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_READ_ONLY",Swig_var_IO_FLAG_READ_ONLY_get, Swig_var_IO_FLAG_READ_ONLY_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_ONDISK_SAME_DIR",Swig_var_IO_FLAG_ONDISK_SAME_DIR_get, Swig_var_IO_FLAG_ONDISK_SAME_DIR_set); - - /* needed, else crash at runtime */ - import_array(); - - faiss::InterruptCallback::instance.reset(new PythonInterruptCallback()); - - -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/python/swigfaiss_wrap.cpp b/python/swigfaiss_wrap.cpp deleted file mode 100644 index 51aa0f870..000000000 --- a/python/swigfaiss_wrap.cpp +++ /dev/null @@ -1,88327 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.12 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - - -#ifndef SWIGPYTHON -#define SWIGPYTHON -#endif - -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#endif - - -#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) -/* Use debug wrappers with the Python release dll */ -# undef _DEBUG -# include -# define _DEBUG -#else -# include -#endif - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - SWIG errors code. - - Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#define SWIG_CASTRANKLIMIT (1 << 8) -/* The NewMask denotes the object was created (using new/malloc) */ -#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ -#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) -/* Simple returning values */ -#define SWIG_BADOBJ (SWIG_ERROR) -#define SWIG_OLDOBJ (SWIG_OK) -#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) -#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ -#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) -#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) -#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) -#define PyString_Check(name) PyBytes_Check(name) -#define PyString_FromString(x) PyUnicode_FromString(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) -#define PyString_AsString(str) PyBytes_AsString(str) -#define PyString_Size(str) PyBytes_Size(str) -#define PyString_InternFromString(key) PyUnicode_InternFromString(key) -#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE -#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) -#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -/* Warning: This function will allocate a new string in Python 3, - * so please call SWIG_Python_str_DelForPy3(x) to free the space. - */ -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; - str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - return newstr; -#else - return PyString_AsString(str); -#endif -} - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) -#else -# define SWIG_Python_str_DelForPy3(x) -#endif - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -typedef inquiry lenfunc; -typedef intargfunc ssizeargfunc; -typedef intintargfunc ssizessizeargfunc; -typedef intobjargproc ssizeobjargproc; -typedef intintobjargproc ssizessizeobjargproc; -typedef getreadbufferproc readbufferproc; -typedef getwritebufferproc writebufferproc; -typedef getsegcountproc segcountproc; -typedef getcharbufferproc charbufferproc; -static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) -{ - long result = 0; - PyObject *i = PyNumber_Int(x); - if (i) { - result = PyInt_AsLong(i); - Py_DECREF(i); - } - return result; -} -#endif - -#if PY_VERSION_HEX < 0x02050000 -#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) -#endif - -#if PY_VERSION_HEX < 0x02040000 -#define Py_VISIT(op) \ - do { \ - if (op) { \ - int vret = visit((op), arg); \ - if (vret) \ - return vret; \ - } \ - } while (0) -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef struct { - PyTypeObject type; - PyNumberMethods as_number; - PyMappingMethods as_mapping; - PySequenceMethods as_sequence; - PyBufferProcs as_buffer; - PyObject *name, *slots; -} PyHeapTypeObject; -#endif - -#if PY_VERSION_HEX < 0x02030000 -typedef destructor freefunc; -#endif - -#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ - (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ - (PY_MAJOR_VERSION > 3)) -# define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif - -#if PY_VERSION_HEX < 0x03020000 -#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) -#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) -#define Py_hash_t long -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#if PY_VERSION_HEX >= 0x03000000 -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) -{ - return PyInstanceMethod_New(func); -} -#else -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) -{ - return NULL; -} -#endif - -#ifdef __cplusplus -} -#endif - - -/* ----------------------------------------------------------------------------- - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) - -#ifdef SWIGPYTHON_BUILTIN -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) -#else -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) -#endif - -#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) - -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -#if defined(SWIGPYTHON_BUILTIN) - -SWIGINTERN void -SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { - PyObject *s = PyString_InternFromString(key); - PyList_Append(seq, s); - Py_DECREF(s); -} - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); - if (public_interface) - SwigPyBuiltin_AddPublicSymbol(public_interface, name); -} - -#else - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { -#if PY_VERSION_HEX < 0x02030000 - PyDict_SetItemString(d, (char *)name, obj); -#else - PyDict_SetItemString(d, name, obj); -#endif - Py_DECREF(obj); -} - -#endif - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN Py_ssize_t -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - if (min <= 1 && max >= 1) { - Py_ssize_t i; - objs[0] = args; - for (i = 1; i < max; ++i) { - objs[i] = 0; - } - return 2; - } - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - Py_ssize_t i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) -#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) - -#ifdef __cplusplus -extern "C" { -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; - PyTypeObject *pytype; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - data->newargs = obj; - Py_INCREF(obj); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - data->pytype = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData *data) { - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -#ifdef SWIGPYTHON_BUILTIN - PyObject *dict; -#endif -} SwigPyObject; - - -#ifdef SWIGPYTHON_BUILTIN - -SWIGRUNTIME PyObject * -SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) -{ - SwigPyObject *sobj = (SwigPyObject *)v; - - if (!sobj->dict) - sobj->dict = PyDict_New(); - - Py_INCREF(sobj->dict); - return sobj->dict; -} - -#endif - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { - PyObject *ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); - if (v->next) { -# ifdef METH_NOARGS - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif -# if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -# else - PyString_ConcatAndDel(&repr,nrep); -# endif - } - return repr; -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); - return res; -} - - -SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); - -#ifdef SWIGPYTHON_BUILTIN -static swig_type_info *SwigPyObject_stype = 0; -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - SwigPyClientData *cd; - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - assert(cd); - assert(cd->pytype); - return cd->pytype; -} -#else -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); - return type; -} -#endif - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { -#ifdef SWIGPYTHON_BUILTIN - PyTypeObject *target_tp = SwigPyObject_type(); - if (PyType_IsSubtype(op->ob_type, target_tp)) - return 1; - return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); -#else - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -#endif -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - - /* PyObject_CallFunction() has the potential to silently drop - the active active exception. In cases of unnamed temporary - variable or where we just finished iterating over a generator - StopIteration will be active right now, and this needs to - remain true upon return from SwigPyObject_dealloc. So save - and restore. */ - - PyObject *val = NULL, *type = NULL, *tb = NULL; - PyErr_Fetch(&val, &type, &tb); - - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - if (!res) - PyErr_WriteUnraisable(destroy); - - PyErr_Restore(val, type, tb); - - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!SwigPyObject_Check(next)) { - PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#elif (PY_VERSION_HEX < 0x02050000) - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#else - if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -SwigPyObject_TypeOnce(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ -#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - 0, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpyobject_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpyobject_type) < 0) - return NULL; -#endif - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == SwigPyPacked_TypeOnce()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_TypeOnce(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - swigpypacked_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&swigpypacked_type) < 0) - return NULL; -#endif - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - PyObject *obj; - - if (SwigPyObject_Check(pyobj)) - return (SwigPyObject *) pyobj; - -#ifdef SWIGPYTHON_BUILTIN - (void)obj; -# ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - pyobj = PyWeakref_GET_OBJECT(pyobj); - if (pyobj && SwigPyObject_Check(pyobj)) - return (SwigPyObject*) pyobj; - } -# endif - return NULL; -#else - - obj = 0; - -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; -#endif -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - int res; - SwigPyObject *sobj; - int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; - - if (!obj) - return SWIG_ERROR; - if (obj == Py_None && !implicit_conv) { - if (ptr) - *ptr = 0; - return SWIG_OK; - } - - res = SWIG_ERROR; - - sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - res = SWIG_OK; - } else { - if (implicit_conv) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; - } - } - return res; -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; - } -#else - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } -#endif - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst = 0; - PyObject *dict = PyDict_New(); - if (dict) { - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { - SwigPyClientData *clientdata; - PyObject * robj; - int own; - - if (!ptr) - return SWIG_Py_Void(); - - clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - if (clientdata && clientdata->pytype) { - SwigPyObject *newobj; - if (flags & SWIG_BUILTIN_TP_INIT) { - newobj = (SwigPyObject*) self; - if (newobj->ptr) { - PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); - while (newobj->next) - newobj = (SwigPyObject *) newobj->next; - newobj->next = next_self; - newobj = (SwigPyObject *)next_self; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - } else { - newobj = PyObject_New(SwigPyObject, clientdata->pytype); -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif - } - if (newobj) { - newobj->ptr = ptr; - newobj->ty = type; - newobj->own = own; - newobj->next = 0; - return (PyObject*) newobj; - } - return SWIG_Py_Void(); - } - - assert(!(flags & SWIG_BUILTIN_TP_INIT)); - - robj = SwigPyObject_New(ptr, type, own); - if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - Py_DECREF(robj); - robj = inst; - } - return robj; -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); -#else -# ifdef SWIGPY_USE_CAPSULE - type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); -# else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); -# endif - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -#ifdef SWIGPY_USE_CAPSULE -SWIG_Python_DestroyModule(PyObject *obj) -#else -SWIG_Python_DestroyModule(void *vptr) -#endif -{ -#ifdef SWIGPY_USE_CAPSULE - swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); -#else - swig_module_info *swig_module = (swig_module_info *) vptr; -#endif - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); - swig_this = NULL; -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); -#endif -#ifdef SWIGPY_USE_CAPSULE - PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#else - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -#endif -} - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { -#ifdef SWIGPY_USE_CAPSULE - descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); -#else - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); -#endif - } else { - swig_module_info *swig_module = SWIG_GetModule(0); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { -#ifdef SWIGPY_USE_CAPSULE - obj = PyCapsule_New((void*) descriptor, NULL, NULL); -#else - obj = PyCObject_FromVoidPtr(descriptor, NULL); -#endif - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); - } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : ""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - SWIG_Python_str_DelForPy3(cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); -#if SWIG_POINTER_EXCEPTION - if (flags) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } -#endif - } - return result; -} - -#ifdef SWIGPYTHON_BUILTIN -SWIGRUNTIME int -SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { - PyTypeObject *tp = obj->ob_type; - PyObject *descr; - PyObject *encoded_name; - descrsetfunc f; - int res = -1; - -# ifdef Py_USING_UNICODE - if (PyString_Check(name)) { - name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); - if (!name) - return -1; - } else if (!PyUnicode_Check(name)) -# else - if (!PyString_Check(name)) -# endif - { - PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); - return -1; - } else { - Py_INCREF(name); - } - - if (!tp->tp_dict) { - if (PyType_Ready(tp) < 0) - goto done; - } - - descr = _PyType_Lookup(tp, name); - f = NULL; - if (descr != NULL) - f = descr->ob_type->tp_descr_set; - if (!f) { - if (PyString_Check(name)) { - encoded_name = name; - Py_INCREF(name); - } else { - encoded_name = PyUnicode_AsUTF8String(name); - } - PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); - Py_DECREF(encoded_name); - } else { - res = f(descr, obj, value); - } - - done: - Py_DECREF(name); - return res; -} -#endif - - -#ifdef __cplusplus -} -#endif - - - -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_Crev swig_types[0] -#define SWIGTYPE_p_FILE swig_types[1] -#define SWIGTYPE_p_MapLong2Long swig_types[2] -#define SWIGTYPE_p_Node swig_types[3] -#define SWIGTYPE_p_T swig_types[4] -#define SWIGTYPE_p_TI swig_types[5] -#define SWIGTYPE_p_char swig_types[6] -#define SWIGTYPE_p_component_t swig_types[7] -#define SWIGTYPE_p_distance_t swig_types[8] -#define SWIGTYPE_p_double swig_types[9] -#define SWIGTYPE_p_faiss__ArrayInvertedLists swig_types[10] -#define SWIGTYPE_p_faiss__AutoTuneCriterion swig_types[11] -#define SWIGTYPE_p_faiss__BinaryInvertedListScanner swig_types[12] -#define SWIGTYPE_p_faiss__BufferList swig_types[13] -#define SWIGTYPE_p_faiss__CenteringTransform swig_types[14] -#define SWIGTYPE_p_faiss__Cloner swig_types[15] -#define SWIGTYPE_p_faiss__Clustering swig_types[16] -#define SWIGTYPE_p_faiss__ClusteringParameters swig_types[17] -#define SWIGTYPE_p_faiss__ConcatenatedInvertedLists swig_types[18] -#define SWIGTYPE_p_faiss__DistanceComputer swig_types[19] -#define SWIGTYPE_p_faiss__GenHammingComputer16 swig_types[20] -#define SWIGTYPE_p_faiss__GenHammingComputer32 swig_types[21] -#define SWIGTYPE_p_faiss__GenHammingComputer8 swig_types[22] -#define SWIGTYPE_p_faiss__GenHammingComputerM8 swig_types[23] -#define SWIGTYPE_p_faiss__HNSW swig_types[24] -#define SWIGTYPE_p_faiss__HNSWStats swig_types[25] -#define SWIGTYPE_p_faiss__HNSW__MinimaxHeap swig_types[26] -#define SWIGTYPE_p_faiss__HammingComputer16 swig_types[27] -#define SWIGTYPE_p_faiss__HammingComputer20 swig_types[28] -#define SWIGTYPE_p_faiss__HammingComputer32 swig_types[29] -#define SWIGTYPE_p_faiss__HammingComputer4 swig_types[30] -#define SWIGTYPE_p_faiss__HammingComputer64 swig_types[31] -#define SWIGTYPE_p_faiss__HammingComputer8 swig_types[32] -#define SWIGTYPE_p_faiss__HammingComputerDefault swig_types[33] -#define SWIGTYPE_p_faiss__HammingComputerM4 swig_types[34] -#define SWIGTYPE_p_faiss__HammingComputerM8 swig_types[35] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t swig_types[36] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t swig_types[37] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t swig_types[38] -#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t swig_types[39] -#define SWIGTYPE_p_faiss__IDSelector swig_types[40] -#define SWIGTYPE_p_faiss__IDSelectorBatch swig_types[41] -#define SWIGTYPE_p_faiss__IDSelectorRange swig_types[42] -#define SWIGTYPE_p_faiss__IOReader swig_types[43] -#define SWIGTYPE_p_faiss__IOWriter swig_types[44] -#define SWIGTYPE_p_faiss__IVFPQSearchParameters swig_types[45] -#define SWIGTYPE_p_faiss__IVFSearchParameters swig_types[46] -#define SWIGTYPE_p_faiss__Index swig_types[47] -#define SWIGTYPE_p_faiss__Index2Layer swig_types[48] -#define SWIGTYPE_p_faiss__IndexBinary swig_types[49] -#define SWIGTYPE_p_faiss__IndexBinaryFlat swig_types[50] -#define SWIGTYPE_p_faiss__IndexBinaryFromFloat swig_types[51] -#define SWIGTYPE_p_faiss__IndexBinaryHNSW swig_types[52] -#define SWIGTYPE_p_faiss__IndexBinaryIVF swig_types[53] -#define SWIGTYPE_p_faiss__IndexFlat swig_types[54] -#define SWIGTYPE_p_faiss__IndexFlat1D swig_types[55] -#define SWIGTYPE_p_faiss__IndexFlatIP swig_types[56] -#define SWIGTYPE_p_faiss__IndexFlatL2 swig_types[57] -#define SWIGTYPE_p_faiss__IndexFlatL2BaseShift swig_types[58] -#define SWIGTYPE_p_faiss__IndexHNSW swig_types[59] -#define SWIGTYPE_p_faiss__IndexHNSW2Level swig_types[60] -#define SWIGTYPE_p_faiss__IndexHNSWFlat swig_types[61] -#define SWIGTYPE_p_faiss__IndexHNSWPQ swig_types[62] -#define SWIGTYPE_p_faiss__IndexHNSWSQ swig_types[63] -#define SWIGTYPE_p_faiss__IndexIDMap swig_types[64] -#define SWIGTYPE_p_faiss__IndexIDMap2 swig_types[65] -#define SWIGTYPE_p_faiss__IndexIVF swig_types[66] -#define SWIGTYPE_p_faiss__IndexIVFFlat swig_types[67] -#define SWIGTYPE_p_faiss__IndexIVFFlatDedup swig_types[68] -#define SWIGTYPE_p_faiss__IndexIVFPQ swig_types[69] -#define SWIGTYPE_p_faiss__IndexIVFPQR swig_types[70] -#define SWIGTYPE_p_faiss__IndexIVFPQStats swig_types[71] -#define SWIGTYPE_p_faiss__IndexIVFScalarQuantizer swig_types[72] -#define SWIGTYPE_p_faiss__IndexIVFStats swig_types[73] -#define SWIGTYPE_p_faiss__IndexLSH swig_types[74] -#define SWIGTYPE_p_faiss__IndexPQ swig_types[75] -#define SWIGTYPE_p_faiss__IndexPQStats swig_types[76] -#define SWIGTYPE_p_faiss__IndexPreTransform swig_types[77] -#define SWIGTYPE_p_faiss__IndexRefineFlat swig_types[78] -#define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t swig_types[79] -#define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[80] -#define SWIGTYPE_p_faiss__IndexScalarQuantizer swig_types[81] -#define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t swig_types[82] -#define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[83] -#define SWIGTYPE_p_faiss__IndexSplitVectors swig_types[84] -#define SWIGTYPE_p_faiss__InterruptCallback swig_types[85] -#define SWIGTYPE_p_faiss__IntersectionCriterion swig_types[86] -#define SWIGTYPE_p_faiss__InvertedListScanner swig_types[87] -#define SWIGTYPE_p_faiss__InvertedLists swig_types[88] -#define SWIGTYPE_p_faiss__Level1Quantizer swig_types[89] -#define SWIGTYPE_p_faiss__LinearTransform swig_types[90] -#define SWIGTYPE_p_faiss__LockLevels swig_types[91] -#define SWIGTYPE_p_faiss__MatrixStats swig_types[92] -#define SWIGTYPE_p_faiss__MultiIndexQuantizer swig_types[93] -#define SWIGTYPE_p_faiss__MultiIndexQuantizer2 swig_types[94] -#define SWIGTYPE_p_faiss__NormalizationTransform swig_types[95] -#define SWIGTYPE_p_faiss__OPQMatrix swig_types[96] -#define SWIGTYPE_p_faiss__OnDiskInvertedLists swig_types[97] -#define SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch swig_types[98] -#define SWIGTYPE_p_faiss__OneRecallAtRCriterion swig_types[99] -#define SWIGTYPE_p_faiss__OperatingPoint swig_types[100] -#define SWIGTYPE_p_faiss__OperatingPoints swig_types[101] -#define SWIGTYPE_p_faiss__PCAMatrix swig_types[102] -#define SWIGTYPE_p_faiss__ParameterRange swig_types[103] -#define SWIGTYPE_p_faiss__ParameterSpace swig_types[104] -#define SWIGTYPE_p_faiss__PermutationObjective swig_types[105] -#define SWIGTYPE_p_faiss__PolysemousTraining swig_types[106] -#define SWIGTYPE_p_faiss__ProductQuantizer swig_types[107] -#define SWIGTYPE_p_faiss__RandomGenerator swig_types[108] -#define SWIGTYPE_p_faiss__RandomRotationMatrix swig_types[109] -#define SWIGTYPE_p_faiss__RangeQueryResult swig_types[110] -#define SWIGTYPE_p_faiss__RangeSearchPartialResult swig_types[111] -#define SWIGTYPE_p_faiss__RangeSearchResult swig_types[112] -#define SWIGTYPE_p_faiss__ReconstructFromNeighbors swig_types[113] -#define SWIGTYPE_p_faiss__RemapDimensionsTransform swig_types[114] -#define SWIGTYPE_p_faiss__ReproduceDistancesObjective swig_types[115] -#define SWIGTYPE_p_faiss__SQDistanceComputer swig_types[116] -#define SWIGTYPE_p_faiss__ScalarQuantizer swig_types[117] -#define SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer swig_types[118] -#define SWIGTYPE_p_faiss__SimulatedAnnealingParameters swig_types[119] -#define SWIGTYPE_p_faiss__VectorIOReader swig_types[120] -#define SWIGTYPE_p_faiss__VectorIOWriter swig_types[121] -#define SWIGTYPE_p_faiss__VectorTransform swig_types[122] -#define SWIGTYPE_p_faiss__VisitedTable swig_types[123] -#define SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow swig_types[124] -#define SWIGTYPE_p_float swig_types[125] -#define SWIGTYPE_p_idx_t swig_types[126] -#define SWIGTYPE_p_int swig_types[127] -#define SWIGTYPE_p_long swig_types[128] -#define SWIGTYPE_p_omp_lock_t swig_types[129] -#define SWIGTYPE_p_p_faiss__ArrayInvertedLists swig_types[130] -#define SWIGTYPE_p_p_faiss__CenteringTransform swig_types[131] -#define SWIGTYPE_p_p_faiss__ConcatenatedInvertedLists swig_types[132] -#define SWIGTYPE_p_p_faiss__Index swig_types[133] -#define SWIGTYPE_p_p_faiss__Index2Layer swig_types[134] -#define SWIGTYPE_p_p_faiss__IndexFlat swig_types[135] -#define SWIGTYPE_p_p_faiss__IndexFlat1D swig_types[136] -#define SWIGTYPE_p_p_faiss__IndexFlatIP swig_types[137] -#define SWIGTYPE_p_p_faiss__IndexFlatL2 swig_types[138] -#define SWIGTYPE_p_p_faiss__IndexFlatL2BaseShift swig_types[139] -#define SWIGTYPE_p_p_faiss__IndexHNSW swig_types[140] -#define SWIGTYPE_p_p_faiss__IndexHNSW2Level swig_types[141] -#define SWIGTYPE_p_p_faiss__IndexHNSWFlat swig_types[142] -#define SWIGTYPE_p_p_faiss__IndexHNSWPQ swig_types[143] -#define SWIGTYPE_p_p_faiss__IndexHNSWSQ swig_types[144] -#define SWIGTYPE_p_p_faiss__IndexIDMap swig_types[145] -#define SWIGTYPE_p_p_faiss__IndexIDMap2 swig_types[146] -#define SWIGTYPE_p_p_faiss__IndexIVF swig_types[147] -#define SWIGTYPE_p_p_faiss__IndexIVFFlat swig_types[148] -#define SWIGTYPE_p_p_faiss__IndexIVFFlatDedup swig_types[149] -#define SWIGTYPE_p_p_faiss__IndexIVFPQ swig_types[150] -#define SWIGTYPE_p_p_faiss__IndexIVFPQR swig_types[151] -#define SWIGTYPE_p_p_faiss__IndexIVFScalarQuantizer swig_types[152] -#define SWIGTYPE_p_p_faiss__IndexLSH swig_types[153] -#define SWIGTYPE_p_p_faiss__IndexPQ swig_types[154] -#define SWIGTYPE_p_p_faiss__IndexPreTransform swig_types[155] -#define SWIGTYPE_p_p_faiss__IndexRefineFlat swig_types[156] -#define SWIGTYPE_p_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[157] -#define SWIGTYPE_p_p_faiss__IndexScalarQuantizer swig_types[158] -#define SWIGTYPE_p_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[159] -#define SWIGTYPE_p_p_faiss__IndexSplitVectors swig_types[160] -#define SWIGTYPE_p_p_faiss__InvertedLists swig_types[161] -#define SWIGTYPE_p_p_faiss__LinearTransform swig_types[162] -#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer swig_types[163] -#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer2 swig_types[164] -#define SWIGTYPE_p_p_faiss__NormalizationTransform swig_types[165] -#define SWIGTYPE_p_p_faiss__OPQMatrix swig_types[166] -#define SWIGTYPE_p_p_faiss__OnDiskInvertedLists swig_types[167] -#define SWIGTYPE_p_p_faiss__PCAMatrix swig_types[168] -#define SWIGTYPE_p_p_faiss__RandomRotationMatrix swig_types[169] -#define SWIGTYPE_p_p_faiss__RemapDimensionsTransform swig_types[170] -#define SWIGTYPE_p_p_faiss__VectorTransform swig_types[171] -#define SWIGTYPE_p_std__functionT_void_ffaiss__IndexBinary_pF_t swig_types[172] -#define SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t swig_types[173] -#define SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t swig_types[174] -#define SWIGTYPE_p_std__mt19937 swig_types[175] -#define SWIGTYPE_p_std__pairT_float_int_t swig_types[176] -#define SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t swig_types[177] -#define SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t swig_types[178] -#define SWIGTYPE_p_std__unordered_mapT_long_long_t swig_types[179] -#define SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t swig_types[180] -#define SWIGTYPE_p_std__unordered_multimapT_long_long_t swig_types[181] -#define SWIGTYPE_p_std__vectorT_char_t swig_types[182] -#define SWIGTYPE_p_std__vectorT_double_t swig_types[183] -#define SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t swig_types[184] -#define SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t swig_types[185] -#define SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t swig_types[186] -#define SWIGTYPE_p_std__vectorT_faiss__Index_p_t swig_types[187] -#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t swig_types[188] -#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t swig_types[189] -#define SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t swig_types[190] -#define SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t swig_types[191] -#define SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t swig_types[192] -#define SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t swig_types[193] -#define SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t swig_types[194] -#define SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t swig_types[195] -#define SWIGTYPE_p_std__vectorT_float_t swig_types[196] -#define SWIGTYPE_p_std__vectorT_int_t swig_types[197] -#define SWIGTYPE_p_std__vectorT_long_t swig_types[198] -#define SWIGTYPE_p_std__vectorT_omp_lock_t_t swig_types[199] -#define SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t swig_types[200] -#define SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t swig_types[201] -#define SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t swig_types[202] -#define SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t swig_types[203] -#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[204] -#define SWIGTYPE_p_std__vectorT_unsigned_long_t swig_types[205] -#define SWIGTYPE_p_storage_idx_t swig_types[206] -#define SWIGTYPE_p_uint32_t swig_types[207] -#define SWIGTYPE_p_unsigned_char swig_types[208] -#define SWIGTYPE_p_unsigned_long swig_types[209] -#define SWIGTYPE_p_void swig_types[210] -static swig_type_info *swig_types[212]; -static swig_module_info swig_module = {swig_types, 211, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif - -/*----------------------------------------------- - @(target):= _swigfaiss.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__swigfaiss - -#else -# define SWIG_init init_swigfaiss - -#endif -#define SWIG_name "_swigfaiss" - -#define SWIGVERSION 0x030012 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - SWIG_PYTHON_THREAD_END_BLOCK; - return *this; - } - - ~SwigPtr_PyObject() - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_XDECREF(_obj); - SWIG_PYTHON_THREAD_END_BLOCK; - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - - - -#include -#include - - -#ifdef SWIGLUA - -#include - -extern "C" { - -#include -#include -#undef THTensor - -} - -#endif - - -#ifdef SWIGPYTHON - -#undef popcount64 - -#define SWIG_FILE_WITH_INIT -#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION -#include - -#endif - - -#include "IndexFlat.h" -#include "VectorTransform.h" -#include "IndexLSH.h" -#include "IndexPQ.h" -#include "IndexIVF.h" -#include "IndexIVFPQ.h" -#include "IndexIVFFlat.h" -#include "IndexScalarQuantizer.h" -#include "IndexShards.h" -#include "IndexReplicas.h" -#include "HNSW.h" -#include "IndexHNSW.h" -#include "MetaIndexes.h" -#include "FaissAssert.h" - -#include "IndexBinaryFlat.h" -#include "IndexBinaryIVF.h" -#include "IndexBinaryFromFloat.h" -#include "IndexBinaryHNSW.h" - -#include "index_io.h" - -#include "IVFlib.h" -#include "utils.h" -#include "Heap.h" -#include "AuxIndexStructures.h" -#include "OnDiskInvertedLists.h" - -#include "Clustering.h" - -#include "hamming.h" - -#include "AutoTune.h" - - - - - -#include - - -#include - - -/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ -#ifndef SWIG_isfinite -/* isfinite() is a macro for C99 */ -# if defined(isfinite) -# define SWIG_isfinite(X) (isfinite(X)) -# elif defined __cplusplus && __cplusplus >= 201103L -/* Use a template so that this works whether isfinite() is std::isfinite() or - * in the global namespace. The reality seems to vary between compiler - * versions. - * - * Make sure namespace std exists to avoid compiler warnings. - * - * extern "C++" is required as this fragment can end up inside an extern "C" { } block - */ -namespace std { } -extern "C++" template -inline int SWIG_isfinite_func(T x) { - using namespace std; - return isfinite(x); -} -# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) -# elif defined(_MSC_VER) -# define SWIG_isfinite(X) (_finite(X)) -# elif defined(__sun) && defined(__SVR4) -# include -# define SWIG_isfinite(X) (finite(X)) -# endif -#endif - - -/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ -#ifdef SWIG_isfinite -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) -#else -# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) -#endif - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; -#if PY_VERSION_HEX < 0x03000000 - } else if (PyInt_Check(obj)) { - if (val) *val = (double) PyInt_AsLong(obj); - return SWIG_OK; -#endif - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -SWIGINTERN int -SWIG_AsVal_float (PyObject * obj, float *val) -{ - double v; - int res = SWIG_AsVal_double (obj, &v); - if (SWIG_IsOK(res)) { - if (SWIG_Float_Overflow_Check(v)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< float >(v); - } - } - return res; -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value)); -} -#endif - - -SWIGINTERNINLINE PyObject * -SWIG_From_size_t (size_t value) -{ -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else { - /* assume sizeof(size_t) <= sizeof(unsigned long long) */ - return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value)); - } -#endif -} - - -SWIGINTERNINLINE int -SWIG_CanCastAsInteger(double *d, double min, double max) { - double x = *d; - if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else -#endif - if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) -{ - int res = SWIG_TypeError; - if (PyLong_Check(obj)) { - unsigned long long v = PyLong_AsUnsignedLongLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - res = SWIG_OverflowError; - } - } else { - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj,&v); - if (SWIG_IsOK(res)) { - if (val) *val = v; - return res; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - res = SWIG_AsVal_double (obj,&d); - if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) - return SWIG_OverflowError; - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return SWIG_AddCast(res); - } - res = SWIG_TypeError; - } -#endif - return res; -} -#endif - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) -{ - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - } -#endif - return res; -} - - - #define SWIG_From_double PyFloat_FromDouble - - -SWIGINTERNINLINE PyObject * -SWIG_From_float (float value) -{ - return SWIG_From_double (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned char >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (PyBytes_Check(obj)) -#else - if (PyUnicode_Check(obj)) -#endif -#else - if (PyString_Check(obj)) -#endif - { - char *cstr; Py_ssize_t len; -#if PY_VERSION_HEX>=0x03000000 -#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if(alloc) *alloc = SWIG_NEWOBJ; -#endif - PyBytes_AsStringAndSize(obj, &cstr, &len); -#else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { -#if PY_VERSION_HEX>=0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - *cptr = PyBytes_AsString(obj); -#else - assert(0); /* Should never reach here with Unicode strings in Python 3 */ -#endif -#else - *cptr = SWIG_Python_str_AsChar(obj); -#endif - } - } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - Py_XDECREF(obj); -#endif - return SWIG_OK; - } else { -#if defined(SWIG_PYTHON_2_UNICODE) -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) -#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" -#endif -#if PY_VERSION_HEX<0x03000000 - if (PyUnicode_Check(obj)) { - char *cstr; Py_ssize_t len; - if (!alloc && cptr) { - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { - if (cptr) { - if (alloc) *alloc = SWIG_NEWOBJ; - *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); - } - if (psize) *psize = len + 1; - - Py_XDECREF(obj); - return SWIG_OK; - } else { - Py_XDECREF(obj); - } - } -#endif -#endif - - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsCharArray(PyObject * obj, char *val, size_t size) -{ - char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; - int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); - if (SWIG_IsOK(res)) { - /* special case of single char conversion when we don't need space for NUL */ - if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; - if (csize <= size) { - if (val) { - if (csize) memcpy(val, cptr, csize*sizeof(char)); - if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); - } - if (alloc == SWIG_NEWOBJ) { - delete[] cptr; - res = SWIG_DelNewMask(res); - } - return res; - } - if (alloc == SWIG_NEWOBJ) delete[] cptr; - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else -#endif - if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - return SWIG_OverflowError; - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_char (PyObject * obj, char *val) -{ - int res = SWIG_AsCharArray(obj, val, 1); - if (!SWIG_IsOK(res)) { - long v; - res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); - if (SWIG_IsOK(res)) { - if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { - if (val) *val = static_cast< char >(v); - } else { - res = SWIG_OverflowError; - } - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 -#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) - return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#else -#if PY_VERSION_HEX >= 0x03010000 - return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); -#else - return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif -#endif -#else - return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_char (char c) -{ - return SWIG_FromCharPtrAndSize(&c,1); -} - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) -{ - return PyInt_FromLong((long) value); -} - - -#include - - -int get_num_gpus() -{ - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_bool (PyObject *obj, bool *val) -{ - int r; - if (!PyBool_Check(obj)) - return SWIG_ERROR; - r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - - -SWIGINTERN int -SWIG_AsPtr_std_string (PyObject * obj, std::string **val) -{ - char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; - if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { - if (buf) { - if (val) *val = new std::string(buf, size - 1); - if (alloc == SWIG_NEWOBJ) delete[] buf; - return SWIG_NEWOBJ; - } else { - if (val) *val = 0; - return SWIG_OLDOBJ; - } - } else { - static int init = 0; - static swig_type_info* descriptor = 0; - if (!init) { - descriptor = SWIG_TypeQuery("std::string" " *"); - init = 1; - } - if (descriptor) { - std::string *vptr; - int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); - if (SWIG_IsOK(res) && val) *val = vptr; - return res; - } - } - return SWIG_ERROR; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_std_string (const std::string& s) -{ - return SWIG_FromCharPtrAndSize(s.data(), s.size()); -} - - - - - -faiss::Index * downcast_index (faiss::Index *index) -{ - return index; -} -faiss::VectorTransform * downcast_VectorTransform (faiss::VectorTransform *vt) -{ - return vt; -} -faiss::IndexBinary * downcast_IndexBinary (faiss::IndexBinary *index) -{ - return index; -} - - -PyObject *swig_ptr (PyObject *a) -{ - if(!PyArray_Check(a)) { - PyErr_SetString(PyExc_ValueError, "input not a numpy array"); - return NULL; - } - PyArrayObject *ao = (PyArrayObject *)a; - - if(!PyArray_ISCONTIGUOUS(ao)) { - PyErr_SetString(PyExc_ValueError, "array is not C-contiguous"); - return NULL; - } - void * data = PyArray_DATA(ao); - if(PyArray_TYPE(ao) == NPY_FLOAT32) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_float, 0); - } - if(PyArray_TYPE(ao) == NPY_FLOAT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_double, 0); - } - if(PyArray_TYPE(ao) == NPY_INT32) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_int, 0); - } - if(PyArray_TYPE(ao) == NPY_UINT8) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_char, 0); - } - if(PyArray_TYPE(ao) == NPY_INT8) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_char, 0); - } - if(PyArray_TYPE(ao) == NPY_UINT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); - } - if(PyArray_TYPE(ao) == NPY_INT64) { - return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0); - } - PyErr_SetString(PyExc_ValueError, "did not recognize array type"); - return NULL; -} - - -struct PythonInterruptCallback: faiss::InterruptCallback { - - bool want_interrupt () override { - int err; - { - PyGILState_STATE gstate; - gstate = PyGILState_Ensure(); - err = PyErr_CheckSignals(); - PyGILState_Release(gstate); - } - return err == -1; - } - -}; - - - - -PyObject * rev_swig_ptr(float *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_FLOAT32, src); -} - - -PyObject * rev_swig_ptr(int *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_INT32, src); -} - - -PyObject * rev_swig_ptr(unsigned char *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_UINT8, src); -} - - -PyObject * rev_swig_ptr(unsigned long *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_UINT64, src); -} - - -PyObject * rev_swig_ptr(long *src, npy_intp size) { - return PyArray_SimpleNewFromData(1, &size, NPY_INT64, src); -} - - -float * cast_integer_to_float_ptr (long x) { - return (float*)x; -} - -long * cast_integer_to_long_ptr (long x) { - return (long*)x; -} - -int * cast_integer_to_int_ptr (long x) { - return (int*)x; -} - - - -// may be useful for lua code launched in background from shell - -#include -void ignore_SIGTTIN() { - signal(SIGTTIN, SIG_IGN); -} - - - -// numpy misses a hash table implementation, hence this class. It -// represents not found values as -1 like in the Index implementation - -struct MapLong2Long { - std::unordered_map map; - - void add(size_t n, const long *keys, const long *vals) { - map.reserve(map.size() + n); - for (size_t i = 0; i < n; i++) { - map[keys[i]] = vals[i]; - } - } - - long search(long key) { - if (map.count(key) == 0) { - return -1; - } else { - return map[key]; - } - } - - void search_multiple(size_t n, const long *keys, long * vals) { - for (size_t i = 0; i < n; i++) { - vals[i] = search(keys[i]); - } - } -}; - - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_new_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_FloatVector")) SWIG_fail; - result = (std::vector< float > *)new std::vector< float >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_push_back" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_push_back" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_clear" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_data" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - result = (float *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_size" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_at" "', argument " "1"" of type '" "std::vector< float > const *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (float)((std::vector< float > const *)arg1)->at(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_resize" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - std::vector< float > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_swap" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< float > *arg1 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVector" "', argument " "1"" of type '" "std::vector< float > *""'"); - } - arg1 = reinterpret_cast< std::vector< float > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *FloatVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_float_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_DoubleVector")) SWIG_fail; - result = (std::vector< double > *)new std::vector< double >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_push_back" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_push_back" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_clear" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_data" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - result = (double *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_size" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_at" "', argument " "1"" of type '" "std::vector< double > const *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (double)((std::vector< double > const *)arg1)->at(arg2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_resize" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DoubleVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - std::vector< double > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_swap" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< double > *arg1 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DoubleVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DoubleVector" "', argument " "1"" of type '" "std::vector< double > *""'"); - } - arg1 = reinterpret_cast< std::vector< double > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *DoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ByteVector")) SWIG_fail; - result = (std::vector< uint8_t > *)new std::vector< uint8_t >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_push_back" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_push_back" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_clear" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_data" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - result = (unsigned char *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_size" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - unsigned char result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_at" "', argument " "1"" of type '" "std::vector< uint8_t > const *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (unsigned char)((std::vector< uint8_t > const *)arg1)->at(arg2); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_resize" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - std::vector< unsigned char > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_swap" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'"); - } - arg2 = reinterpret_cast< std::vector< unsigned char > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVector" "', argument " "1"" of type '" "std::vector< uint8_t > *""'"); - } - arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ByteVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CharVector")) SWIG_fail; - result = (std::vector< char > *)new std::vector< char >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_push_back" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_push_back" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_clear" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_data" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - result = (char *)(arg1)->data(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:CharVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_size" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char result; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_at" "', argument " "1"" of type '" "std::vector< char > const *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (char)((std::vector< char > const *)arg1)->at(arg2); - resultobj = SWIG_From_char(static_cast< char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_resize" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CharVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - std::vector< char > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_swap" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'"); - } - arg2 = reinterpret_cast< std::vector< char > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< char > *arg1 = (std::vector< char > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_CharVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CharVector" "', argument " "1"" of type '" "std::vector< char > *""'"); - } - arg1 = reinterpret_cast< std::vector< char > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CharVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_char_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Uint64Vector")) SWIG_fail; - result = (std::vector< unsigned long > *)new std::vector< unsigned long >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - unsigned long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_push_back" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_push_back" "', argument " "2"" of type '" "unsigned long""'"); - } - arg2 = static_cast< unsigned long >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_clear" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_data" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - result = (unsigned long *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_size" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - unsigned long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_at" "', argument " "1"" of type '" "std::vector< unsigned long > const *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (unsigned long)((std::vector< unsigned long > const *)arg1)->at(arg2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_resize" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Uint64Vector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - std::vector< unsigned long > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_swap" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'"); - } - arg2 = reinterpret_cast< std::vector< unsigned long > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Uint64Vector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Uint64Vector" "', argument " "1"" of type '" "std::vector< unsigned long > *""'"); - } - arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Uint64Vector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LongVector")) SWIG_fail; - result = (std::vector< long > *)new std::vector< long >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_push_back" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_push_back" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_clear" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_data" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - result = (long *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_size" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_at" "', argument " "1"" of type '" "std::vector< long > const *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (long)((std::vector< long > const *)arg1)->at(arg2); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_resize" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - std::vector< long > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_swap" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< long > *arg1 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVector" "', argument " "1"" of type '" "std::vector< long > *""'"); - } - arg1 = reinterpret_cast< std::vector< long > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LongVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_long_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IntVector")) SWIG_fail; - result = (std::vector< int > *)new std::vector< int >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_push_back" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_push_back" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_clear" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_data" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - result = (int *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IntVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_size" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_at" "', argument " "1"" of type '" "std::vector< int > const *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (int)((std::vector< int > const *)arg1)->at(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_resize" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - std::vector< int > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_swap" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< int > *arg1 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IntVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntVector" "', argument " "1"" of type '" "std::vector< int > *""'"); - } - arg1 = reinterpret_cast< std::vector< int > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_int_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorTransformVector")) SWIG_fail; - result = (std::vector< faiss::VectorTransform * > *)new std::vector< faiss::VectorTransform * >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_push_back" "', argument " "2"" of type '" "faiss::VectorTransform *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_clear" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_data" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - result = (faiss::VectorTransform **)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__VectorTransform, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_size" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_at" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::VectorTransform *)((std::vector< faiss::VectorTransform * > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_resize" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransformVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - std::vector< faiss::VectorTransform * > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_swap" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransformVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransformVector" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorTransformVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPointVector")) SWIG_fail; - result = (std::vector< faiss::OperatingPoint > *)new std::vector< faiss::OperatingPoint >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - faiss::OperatingPoint arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoint, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'"); - } else { - faiss::OperatingPoint * temp = reinterpret_cast< faiss::OperatingPoint * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_clear" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OperatingPoint *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_data" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - result = (faiss::OperatingPoint *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_size" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OperatingPoint result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_at" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< faiss::OperatingPoint > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new faiss::OperatingPoint(static_cast< const faiss::OperatingPoint& >(result))), SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_resize" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPointVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_swap" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPointVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPointVector" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPointVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_InvertedListsPtrVector")) SWIG_fail; - result = (std::vector< faiss::InvertedLists * > *)new std::vector< faiss::InvertedLists * >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_push_back" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_clear" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists **result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_data" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - result = (faiss::InvertedLists **)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_size" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_at" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > const *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::InvertedLists *)((std::vector< faiss::InvertedLists * > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_resize" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - std::vector< faiss::InvertedLists * > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_swap" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InvertedListsPtrVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InvertedListsPtrVector" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'"); - } - arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InvertedListsPtrVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_FloatVectorVector")) SWIG_fail; - result = (std::vector< std::vector< float > > *)new std::vector< std::vector< float > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - std::vector< float > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'"); - } else { - std::vector< float > * temp = reinterpret_cast< std::vector< float > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - result = (std::vector< float > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< float > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< float > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< float > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< float >(static_cast< const std::vector< float >& >(result))), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_FloatVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - std::vector< std::vector< float > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< float > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *FloatVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ByteVectorVector")) SWIG_fail; - result = (std::vector< std::vector< unsigned char > > *)new std::vector< std::vector< unsigned char > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - std::vector< unsigned char > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'"); - } else { - std::vector< unsigned char > * temp = reinterpret_cast< std::vector< unsigned char > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< unsigned char > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - result = (std::vector< unsigned char > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< unsigned char > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< unsigned char > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< unsigned char >(static_cast< const std::vector< unsigned char >& >(result))), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - std::vector< std::vector< unsigned char > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ByteVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LongVectorVector")) SWIG_fail; - result = (std::vector< std::vector< long > > *)new std::vector< std::vector< long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - std::vector< long > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_push_back",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'"); - } else { - std::vector< long > * temp = reinterpret_cast< std::vector< long > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - (arg1)->push_back(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_data",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - result = (std::vector< long > *)(arg1)->data(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - result = (size_t)(arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::vector< long > result; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< long > > const *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_at" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((std::vector< std::vector< long > > const *)arg1)->at(arg2); - resultobj = SWIG_NewPointerObj((new std::vector< long >(static_cast< const std::vector< long >& >(result))), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_resize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - (arg1)->resize(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LongVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - std::vector< std::vector< long > > *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< long > > * >(argp2); - (arg1)->swap(*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVectorVector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'"); - } - arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LongVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_hamming_batch_size_set(PyObject *_val) { - { - size_t val; - int res = SWIG_AsVal_size_t(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::hamming_batch_size""' of type '""size_t""'"); - } - faiss::hamming_batch_size = static_cast< size_t >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_hamming_batch_size_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_size_t(static_cast< size_t >(faiss::hamming_batch_size)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_popcount64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint64_t arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:popcount64",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "popcount64" "', argument " "1"" of type '" "uint64_t""'"); - } - arg1 = static_cast< uint64_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::popcount64(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - hamdis_t *arg6 = (hamdis_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "hammings" "', argument " "6"" of type '" "hamdis_t *""'"); - } - arg6 = reinterpret_cast< hamdis_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_bitvec_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:bitvec_print",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bitvec_print" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bitvec_print" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::bitvec_print((unsigned char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs2bitvecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs2bitvecs",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvecs2bitvecs" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs2bitvecs" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs2bitvecs" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvecs2bitvecs" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvecs2bitvecs((float const *)arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec2bitvec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec2bitvec",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec2bitvec" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec2bitvec" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec2bitvec" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec2bitvec((float const *)arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn_hc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_hc" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hammings_knn_mc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - int32_t *arg7 = (int32_t *) 0 ; - long *arg8 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:hammings_knn_mc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_mc" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_mc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings_knn_mc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_mc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_mc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_mc" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hammings_knn_mc" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "hammings_knn_mc" "', argument " "8"" of type '" "long *""'"); - } - arg8 = reinterpret_cast< long * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hammings_knn_mc((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - hamdis_t arg5 ; - size_t arg6 ; - size_t *arg7 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:hamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hamming_count_thres" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hamming_count_thres" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hamming_count_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hamming_count_thres" "', argument " "5"" of type '" "hamdis_t""'"); - } - arg5 = static_cast< hamdis_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hamming_count_thres" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hamming_count_thres" "', argument " "7"" of type '" "size_t *""'"); - } - arg7 = reinterpret_cast< size_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::hamming_count_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_match_hamming_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t arg4 ; - hamdis_t arg5 ; - size_t arg6 ; - long *arg7 = (long *) 0 ; - hamdis_t *arg8 = (hamdis_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:match_hamming_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "match_hamming_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "match_hamming_thres" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "match_hamming_thres" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "match_hamming_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "match_hamming_thres" "', argument " "5"" of type '" "hamdis_t""'"); - } - arg5 = static_cast< hamdis_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "match_hamming_thres" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "match_hamming_thres" "', argument " "7"" of type '" "long *""'"); - } - arg7 = reinterpret_cast< long * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "match_hamming_thres" "', argument " "8"" of type '" "hamdis_t *""'"); - } - arg8 = reinterpret_cast< hamdis_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::match_hamming_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_crosshamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - hamdis_t arg3 ; - size_t arg4 ; - size_t *arg5 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:crosshamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "crosshamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "crosshamming_count_thres" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "crosshamming_count_thres" "', argument " "3"" of type '" "hamdis_t""'"); - } - arg3 = static_cast< hamdis_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "crosshamming_count_thres" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "crosshamming_count_thres" "', argument " "5"" of type '" "size_t *""'"); - } - arg5 = reinterpret_cast< size_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::crosshamming_count_thres((unsigned char const *)arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'"); - } else { - uint32_t * temp = reinterpret_cast< uint32_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer4_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - result = ((arg1)->a0); - resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer4")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer4 *)new faiss::HammingComputer4(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer4",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer4" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer4" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer4 *)new faiss::HammingComputer4((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer4(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer4__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer4__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer4'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer4::HammingComputer4()\n" - " faiss::HammingComputer4::HammingComputer4(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer4_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer4_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_hamming" "', argument " "1"" of type '" "faiss::HammingComputer4 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer4 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer4 *arg1 = (faiss::HammingComputer4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer4",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer4" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer4, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer8_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer8")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer8 *)new faiss::HammingComputer8(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer8 *)new faiss::HammingComputer8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer8(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer8__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer8__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer8'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer8::HammingComputer8()\n" - " faiss::HammingComputer8::HammingComputer8(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer8_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer8_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_hamming" "', argument " "1"" of type '" "faiss::HammingComputer8 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer8 *arg1 = (faiss::HammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer8" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer16")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer16 *)new faiss::HammingComputer16(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer16",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer16" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer16 *)new faiss::HammingComputer16((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer16(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer16__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer16__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer16'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer16::HammingComputer16()\n" - " faiss::HammingComputer16::HammingComputer16(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer16_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer16_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_hamming" "', argument " "1"" of type '" "faiss::HammingComputer16 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer16 *arg1 = (faiss::HammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer16",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer16" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer16, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer20_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'"); - } else { - uint32_t * temp = reinterpret_cast< uint32_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - result = ((arg1)->a2); - resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer20")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer20 *)new faiss::HammingComputer20(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer20 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer20",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer20" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer20" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer20 *)new faiss::HammingComputer20((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer20(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer20__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer20__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer20'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer20::HammingComputer20()\n" - " faiss::HammingComputer20::HammingComputer20(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer20_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer20_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer20_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_hamming" "', argument " "1"" of type '" "faiss::HammingComputer20 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer20 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer20(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer20 *arg1 = (faiss::HammingComputer20 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer20",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer20" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer20_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer20, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer32")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer32 *)new faiss::HammingComputer32(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer32" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer32 *)new faiss::HammingComputer32((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer32(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer32__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer32__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer32'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer32::HammingComputer32()\n" - " faiss::HammingComputer32::HammingComputer32(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer32_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer32_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_hamming" "', argument " "1"" of type '" "faiss::HammingComputer32 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer32 *arg1 = (faiss::HammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer32" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer32, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputer64_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a4_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a4_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a4 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a4_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a4_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a4); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a5_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a5_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a5_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a5 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a5_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a5_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a5); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a6_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a6_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a6_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a6 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a6_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a6_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a6); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a7_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a7_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a7_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a7 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_a7_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a7_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - result = (uint64_t) ((arg1)->a7); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer64")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer64 *)new faiss::HammingComputer64(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputer64 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer64",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer64" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer64" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputer64 *)new faiss::HammingComputer64((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputer64(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputer64__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputer64__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer64'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputer64::HammingComputer64()\n" - " faiss::HammingComputer64::HammingComputer64(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer64_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer64_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputer64_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_hamming" "', argument " "1"" of type '" "faiss::HammingComputer64 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputer64 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputer64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputer64 *arg1 = (faiss::HammingComputer64 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer64",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer64" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputer64_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer64, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_a_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - if (arg1) (arg1)->a = (uint8_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - result = (uint8_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerDefault_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerDefault")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerDefault *)new faiss::HammingComputerDefault(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerDefault *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerDefault",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerDefault" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerDefault" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerDefault *)new faiss::HammingComputerDefault((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerDefault(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerDefault__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerDefault__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerDefault'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerDefault::HammingComputerDefault()\n" - " faiss::HammingComputerDefault::HammingComputerDefault(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerDefault_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerDefault_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerDefault_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_hamming" "', argument " "1"" of type '" "faiss::HammingComputerDefault const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerDefault const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerDefault(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerDefault *arg1 = (faiss::HammingComputerDefault *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerDefault",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerDefault" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerDefault_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint64_t *arg2 = (uint64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'"); - } - arg2 = reinterpret_cast< uint64_t * >(argp2); - if (arg1) (arg1)->a = (uint64_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - result = (uint64_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM8_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM8")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM8 *)new faiss::HammingComputerM8(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM8 *)new faiss::HammingComputerM8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM8(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerM8__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerM8__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM8'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerM8::HammingComputerM8()\n" - " faiss::HammingComputerM8::HammingComputerM8(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM8_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM8_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM8 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM8 *arg1 = (faiss::HammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM8" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HammingComputerM4_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint32_t *arg2 = (uint32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_uint32_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_a_set" "', argument " "2"" of type '" "uint32_t const *""'"); - } - arg2 = reinterpret_cast< uint32_t * >(argp2); - if (arg1) (arg1)->a = (uint32_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint32_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - result = (uint32_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint32_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM4_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM4")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM4 *)new faiss::HammingComputerM4(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HammingComputerM4 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM4",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM4" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM4" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HammingComputerM4 *)new faiss::HammingComputerM4((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HammingComputerM4(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HammingComputerM4__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HammingComputerM4__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM4'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HammingComputerM4::HammingComputerM4()\n" - " faiss::HammingComputerM4::HammingComputerM4(uint8_t const *,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM4_set",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_set" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM4_set" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HammingComputerM4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM4 const *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HammingComputerM4 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HammingComputerM4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HammingComputerM4 *arg1 = (faiss::HammingComputerM4 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM4",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM4" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'"); - } - arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HammingComputerM4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM4, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_generalized_hamming_64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint64_t arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:generalized_hamming_64",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "generalized_hamming_64" "', argument " "1"" of type '" "uint64_t""'"); - } - arg1 = static_cast< uint64_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::generalized_hamming_64(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer8_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer8 *)new faiss::GenHammingComputer8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer8 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer8 *arg1 = (faiss::GenHammingComputer8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer8" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer16 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer16",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer16" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer16 *)new faiss::GenHammingComputer16((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer16 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer16 *arg1 = (faiss::GenHammingComputer16 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer16",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer16" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a0); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a1); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a2); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint64_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); - if (arg1) (arg1)->a3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - result = (uint64_t) ((arg1)->a3); - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputer32 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer32",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer32" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputer32 *)new faiss::GenHammingComputer32((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer32 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputer32 *arg1 = (faiss::GenHammingComputer32 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer32",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer32" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - uint64_t *arg2 = (uint64_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'"); - } - arg2 = reinterpret_cast< uint64_t * >(argp2); - if (arg1) (arg1)->a = (uint64_t const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint64_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - result = (uint64_t *) ((arg1)->a); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputerM8_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::GenHammingComputerM8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputerM8",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputerM8" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::GenHammingComputerM8 *)new faiss::GenHammingComputerM8((uint8_t const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GenHammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 const *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::GenHammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::GenHammingComputerM8 *arg1 = (faiss::GenHammingComputerM8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputerM8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputerM8" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'"); - } - arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *GenHammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - int arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "generalized_hammings_knn_hc" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::int_maxheap_array_t *arg1 = (faiss::int_maxheap_array_t *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'"); - } - arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_generalized_hammings_knn_hc__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_generalized_hammings_knn_hc__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'generalized_hammings_knn_hc'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t,int)\n" - " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_get_num_gpus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int result; - - if (!PyArg_ParseTuple(args,(char *)":get_num_gpus")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)get_num_gpus(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_getmillisecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double result; - - if (!PyArg_ParseTuple(args,(char *)":getmillisecs")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::getmillisecs(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_get_mem_usage_kb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)":get_mem_usage_kb")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::get_mem_usage_kb(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_mt_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - std::mt19937 arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_mt_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_set" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mt19937, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'"); - } else { - std::mt19937 * temp = reinterpret_cast< std::mt19937 * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->mt = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_mt_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::mt19937 result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_mt_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_get" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - result = ((arg1)->mt); - resultobj = SWIG_NewPointerObj((new std::mt19937(static_cast< const std::mt19937& >(result))), SWIGTYPE_p_std__mt19937, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_int",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->rand_int(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_long",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_long" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->rand_long(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_rand_int",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomGenerator_rand_int" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->rand_int(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_RandomGenerator_rand_int__SWIG_0(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_RandomGenerator_rand_int__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'RandomGenerator_rand_int'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomGenerator::rand_int()\n" - " faiss::RandomGenerator::rand_int(int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_float",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_float" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)(arg1)->rand_float(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomGenerator_rand_double(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_double",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_double" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->rand_double(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RandomGenerator",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomGenerator" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomGenerator *)new faiss::RandomGenerator(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RandomGenerator")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomGenerator *)new faiss::RandomGenerator(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomGenerator(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RandomGenerator__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RandomGenerator__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomGenerator'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomGenerator::RandomGenerator(long)\n" - " faiss::RandomGenerator::RandomGenerator()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RandomGenerator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomGenerator *arg1 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomGenerator",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomGenerator" "', argument " "1"" of type '" "faiss::RandomGenerator *""'"); - } - arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RandomGenerator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomGenerator, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_float_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_rand" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::float_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_randn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_randn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_randn" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_randn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_randn" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::float_randn(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_long_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long *arg1 = (long *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:long_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "long_rand" "', argument " "1"" of type '" "long *""'"); - } - arg1 = reinterpret_cast< long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "long_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "long_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::long_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_byte_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:byte_rand",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "byte_rand" "', argument " "1"" of type '" "uint8_t *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "byte_rand" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "byte_rand" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::byte_rand(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rand_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - size_t arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:rand_perm",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_perm" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_perm" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rand_perm" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::rand_perm(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_L2sqr",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_L2sqr((float const *)arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_inner_product",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_inner_product((float const *)arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - long *arg3 = (long *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:imbalance_factor",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "imbalance_factor" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::imbalance_factor(arg1,arg2,(long const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int *arg2 = (int *) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:imbalance_factor",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::imbalance_factor(arg1,(int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_imbalance_factor(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_imbalance_factor__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_imbalance_factor__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'imbalance_factor'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::imbalance_factor(int,int,long const *)\n" - " faiss::imbalance_factor(int,int const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long arg8 ; - long arg9 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - long val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - ecode9 = SWIG_AsVal_long(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "pairwise_L2sqr" "', argument " "9"" of type '" "long""'"); - } - arg9 = static_cast< long >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long arg8 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long arg7 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_pairwise_L2sqr(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[10] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 9) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_3(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_2(self, args); - } - } - } - } - } - } - } - } - if (argc == 8) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_pairwise_L2sqr__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'pairwise_L2sqr'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long)\n" - " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_products_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_inner_products_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_ny" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_ny" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_ny" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_inner_products_ny" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_ny" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_inner_products_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_L2sqr_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_ny" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_ny" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_ny" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_L2sqr_ny" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_ny" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_L2sqr_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norm_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:fvec_norm_L2sqr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norm_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_norm_L2sqr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::fvec_norm_L2sqr((float const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norms_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_norms_L2(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_norms_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2sqr",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2sqr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_norms_L2sqr(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_renorm_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_renorm_L2",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_renorm_L2" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_renorm_L2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_renorm_L2" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_renorm_L2(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_inner_product_to_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:inner_product_to_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "inner_product_to_L2sqr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "inner_product_to_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "inner_product_to_L2sqr" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "inner_product_to_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "inner_product_to_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::inner_product_to_L2sqr(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_by_idx" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_by_idx" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_inner_products_by_idx" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_inner_products_by_idx" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_inner_products_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_by_idx" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_by_idx" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_L2sqr_by_idx" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_L2sqr_by_idx" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_L2sqr_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN int Swig_var_distance_compute_blas_threshold_set(PyObject *_val) { - { - int val; - int res = SWIG_AsVal_int(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::distance_compute_blas_threshold""' of type '""int""'"); - } - faiss::distance_compute_blas_threshold = static_cast< int >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_distance_compute_blas_threshold_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::distance_compute_blas_threshold)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_knn_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_product" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_product" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_inner_product" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr_base_shift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_base_shift",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_base_shift" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_base_shift" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr_base_shift" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_base_shift" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_base_shift" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr_base_shift" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_base_shift" "', argument " "7"" of type '" "float const *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr_base_shift((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,(float const *)arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - faiss::float_minheap_array_t *arg7 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_products_by_idx" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_inner_products_by_idx" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_products_by_idx" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_inner_products_by_idx" "', argument " "7"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg7 = reinterpret_cast< faiss::float_minheap_array_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_inner_products_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_knn_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - faiss::float_maxheap_array_t *arg7 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_by_idx" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_L2sqr_by_idx" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_by_idx" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_by_idx" "', argument " "7"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg7 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::knn_L2sqr_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_range_search_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - float arg6 ; - faiss::RangeSearchResult *arg7 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - float val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_L2sqr" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_L2sqr" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_L2sqr" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_L2sqr" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_L2sqr" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_float(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_L2sqr" "', argument " "6"" of type '" "float""'"); - } - arg6 = static_cast< float >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_L2sqr" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'"); - } - arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::range_search_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_range_search_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - float arg6 ; - faiss::RangeSearchResult *arg7 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - float val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_inner_product" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_inner_product" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_inner_product" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_inner_product" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_inner_product" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_float(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_inner_product" "', argument " "6"" of type '" "float""'"); - } - arg6 = static_cast< float >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_inner_product" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'"); - } - arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::range_search_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_madd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - float arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_madd(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_madd_and_argmin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - float arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd_and_argmin",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd_and_argmin" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd_and_argmin" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd_and_argmin" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd_and_argmin" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd_and_argmin" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::fvec_madd_and_argmin(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_reflection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:reflection",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "reflection" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "reflection" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "reflection" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "reflection" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "reflection" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::reflection((float const *)arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_km_update_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - float *arg2 = (float *) 0 ; - long *arg3 = (long *) 0 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:km_update_centroids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "km_update_centroids" "', argument " "1"" of type '" "float const *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "km_update_centroids" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "km_update_centroids" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "km_update_centroids" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "km_update_centroids" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "km_update_centroids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "km_update_centroids" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::km_update_centroids((float const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_matrix_qr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float *arg3 = (float *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:matrix_qr",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "matrix_qr" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matrix_qr" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "matrix_qr" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::matrix_qr(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ranklist_handle_ties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - long *arg2 = (long *) 0 ; - float *arg3 = (float *) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ranklist_handle_ties",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_handle_ties" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_handle_ties" "', argument " "2"" of type '" "long *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ranklist_handle_ties" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ranklist_handle_ties(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ranklist_intersection_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - long *arg2 = (long *) 0 ; - size_t arg3 ; - long *arg4 = (long *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ranklist_intersection_size",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_intersection_size" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_intersection_size" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ranklist_intersection_size" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ranklist_intersection_size" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::ranklist_intersection_size(arg1,(long const *)arg2,arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - bool arg7 ; - long arg8 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 ; - bool val7 ; - int ecode7 = 0 ; - long val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - ecode8 = SWIG_AsVal_long(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "merge_result_table_with" "', argument " "8"" of type '" "long""'"); - } - arg8 = static_cast< long >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - bool arg7 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - long *arg5 = (long *) 0 ; - float *arg6 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 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 * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_merge_result_table_with(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[9] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 8) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_merge_result_table_with__SWIG_2(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_merge_result_table_with__SWIG_1(self, args); - } - } - } - } - } - } - } - } - if (argc == 8) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_merge_result_table_with__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'merge_result_table_with'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool,long)\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool)\n" - " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_fvec_argsort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - size_t *arg3 = (size_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_argsort(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvec_argsort_parallel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - size_t *arg3 = (size_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort_parallel",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort_parallel" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort_parallel" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort_parallel" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::fvec_argsort_parallel(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ivec_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int *arg4 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ivec_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_hist" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_hist" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ivec_hist" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ivec_hist" "', argument " "4"" of type '" "int *""'"); - } - arg4 = reinterpret_cast< int * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)faiss::ivec_hist(arg1,(int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_bincode_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - int *arg4 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:bincode_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bincode_hist" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bincode_hist" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "bincode_hist" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "bincode_hist" "', argument " "4"" of type '" "int *""'"); - } - arg4 = reinterpret_cast< int * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::bincode_hist(arg1,arg2,(unsigned char const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ivec_checksum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - int *arg2 = (int *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ivec_checksum",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_checksum" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_checksum" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)faiss::ivec_checksum(arg1,(int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - bool arg5 ; - long arg6 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - bool val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - ecode5 = SWIG_AsVal_bool(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'"); - } - arg5 = static_cast< bool >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvecs_maybe_subsample" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - bool arg5 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - bool val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - ecode5 = SWIG_AsVal_bool(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'"); - } - arg5 = static_cast< bool >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t *arg2 = (size_t *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_fvecs_maybe_subsample__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'fvecs_maybe_subsample'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool,long)\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool)\n" - " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_binary_to_real(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:binary_to_real",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "binary_to_real" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "binary_to_real" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "binary_to_real" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::binary_to_real(arg1,(unsigned char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_real_to_binary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:real_to_binary",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "real_to_binary" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "real_to_binary" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "real_to_binary" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::real_to_binary(arg1,(float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_hash_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - uint8_t *arg1 = (uint8_t *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint64_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:hash_bytes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hash_bytes" "', argument " "1"" of type '" "uint8_t const *""'"); - } - arg1 = reinterpret_cast< uint8_t * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "hash_bytes" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint64_t)faiss::hash_bytes((unsigned char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_check_openmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool result; - - if (!PyArg_ParseTuple(args,(char *)":check_openmp")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)faiss::check_openmp(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_d_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (int) ((arg1)->d); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_ntotal_set" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (faiss::Index::idx_t) ((arg1)->ntotal); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_metric_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_metric_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_set" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_metric_type_set" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - if (arg1) (arg1)->metric_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_metric_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::MetricType result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_metric_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_get" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - result = (faiss::MetricType) ((arg1)->metric_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Index" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_train" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add_with_ids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Index_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_range_search" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - faiss::Index::idx_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_assign",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Index_assign" "', argument " "5"" of type '" "faiss::Index::idx_t""'"); - } - arg5 = static_cast< faiss::Index::idx_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_assign",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_assign(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Index_assign__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_Index_assign__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Index_assign'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *,faiss::Index::idx_t)\n" - " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Index_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reset" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_remove_ids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct_n" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Index_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Index_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search_and_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Index_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_compute_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_compute_residual",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_compute_residual" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_compute_residual" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_compute_residual" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_compute_residual" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->compute_residual((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_display" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Index_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Index, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_niter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_niter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_niter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->niter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_nredo_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_nredo_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nredo = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_nredo_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->nredo); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_spherical_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_spherical_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->spherical = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_spherical_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->spherical); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_int_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->int_centroids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_int_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->int_centroids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_update_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_update_index_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->update_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_update_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->update_index); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_frozen_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->frozen_centroids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_frozen_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (bool) ((arg1)->frozen_centroids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_min_points_per_centroid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->min_points_per_centroid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_min_points_per_centroid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->min_points_per_centroid); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_max_points_per_centroid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->max_points_per_centroid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_max_points_per_centroid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->max_points_per_centroid); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_seed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_seed_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->seed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_seed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - result = (int) ((arg1)->seed); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ClusteringParameters")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ClusteringParameters *)new faiss::ClusteringParameters(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ClusteringParameters *arg1 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ClusteringParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ClusteringParameters" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'"); - } - arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ClusteringParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ClusteringParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Clustering_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->centroids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (std::vector< float > *)& ((arg1)->centroids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_obj_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_obj_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_set" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_obj_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->obj = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_obj_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_get" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - result = (std::vector< float > *)& ((arg1)->obj); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Clustering *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Clustering",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - faiss::ClusteringParameters *arg3 = 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Clustering *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_Clustering",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'"); - } - arg3 = reinterpret_cast< faiss::ClusteringParameters * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2,(faiss::ClusteringParameters const &)*arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Clustering(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Clustering__SWIG_0(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__ClusteringParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Clustering__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Clustering'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Clustering::Clustering(int,int)\n" - " faiss::Clustering::Clustering(int,int,faiss::ClusteringParameters const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_Clustering_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - faiss::Clustering::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index *arg4 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Clustering_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_train" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_train" "', argument " "2"" of type '" "faiss::Clustering::idx_t""'"); - } - arg2 = static_cast< faiss::Clustering::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Clustering_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_faiss__Index, 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'"); - } - if (!argp4) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'"); - } - arg4 = reinterpret_cast< faiss::Index * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3,*arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Clustering_post_process_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Clustering_post_process_centroids",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_post_process_centroids" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->post_process_centroids(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Clustering *arg1 = (faiss::Clustering *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Clustering",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Clustering" "', argument " "1"" of type '" "faiss::Clustering *""'"); - } - arg1 = reinterpret_cast< faiss::Clustering * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Clustering_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Clustering, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_kmeans_clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:kmeans_clustering",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "kmeans_clustering" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "kmeans_clustering" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "kmeans_clustering" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "kmeans_clustering" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "kmeans_clustering" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float)faiss::kmeans_clustering(arg1,arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_M_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->M); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_nbits_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->nbits); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_dsub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_dsub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->dsub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_dsub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->dsub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_byte_per_idx_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->byte_per_idx = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_byte_per_idx_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->byte_per_idx); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_ksub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_ksub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ksub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_ksub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (size_t) ((arg1)->ksub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::ProductQuantizer::train_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_train_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train_type_set" "', argument " "2"" of type '" "faiss::ProductQuantizer::train_type_t""'"); - } - arg2 = static_cast< faiss::ProductQuantizer::train_type_t >(val2); - if (arg1) (arg1)->train_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer::train_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_train_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::ProductQuantizer::train_type_t) ((arg1)->train_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_assign_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_assign_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->assign_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_assign_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (faiss::Index *) ((arg1)->assign_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_centroids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->centroids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_centroids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->centroids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_get_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_get_centroids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_get_centroids" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_get_centroids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_get_centroids" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)(arg1)->get_centroids(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t arg3 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_ProductQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ProductQuantizer" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ProductQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ProductQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)new faiss::ProductQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ProductQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)new faiss::ProductQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_ProductQuantizer__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ProductQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::ProductQuantizer(size_t,size_t,size_t)\n" - " faiss::ProductQuantizer::ProductQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_set_derived_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_set_derived_values",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_derived_values" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_derived_values(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_set_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_set_params",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_params" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_set_params" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_set_params" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_params((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_code((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_codes((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes_with_assign_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes_with_assign_index",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->compute_codes_with_assign_index((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_decode",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_decode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_decode" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_decode(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_decode__SWIG_0(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_decode__SWIG_1(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_decode'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::decode(uint8_t const *,float *) const\n" - " faiss::ProductQuantizer::decode(uint8_t const *,float *,size_t) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code_from_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code_from_distance_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_code_from_distance_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_distance_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_distance_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_inner_prod_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_table((float const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_distance_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_distance_tables(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_inner_prod_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_tables(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_ip" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_minheap_array_t *arg6 = (faiss::float_minheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search_ip__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search_ip__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_ip'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_sdc_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->sdc_table = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_sdc_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->sdc_table); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_sdc_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_compute_sdc_table",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_sdc_table" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->compute_sdc_table(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - bool arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - bool val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - ecode7 = SWIG_AsVal_bool(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_sdc" "', argument " "7"" of type '" "bool""'"); - } - arg7 = static_cast< bool >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - size_t arg5 ; - faiss::float_maxheap_array_t *arg6 = (faiss::float_maxheap_array_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'"); - } - arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ProductQuantizer_search_sdc__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ProductQuantizer_search_sdc__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_sdc'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n" - " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_ProductQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ProductQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ProductQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorTransform_d_in_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_in_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_in_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d_in = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_in_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_in_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (int) ((arg1)->d_in); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_out_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_out_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_out_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d_out = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_d_out_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_out_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (int) ((arg1)->d_out); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_train" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_train" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_apply(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_apply",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::VectorTransform const *)arg1)->apply(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::VectorTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_reverse_transform" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::VectorTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_have_bias_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_have_bias_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->have_bias = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_have_bias_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->have_bias); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_is_orthonormal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_orthonormal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_is_orthonormal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->is_orthonormal); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_A_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_A_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_A_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->A = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_A_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_A_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->A); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_b_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_b_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_b_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->b = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_b_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_b_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->b); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - bool arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_LinearTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_LinearTransform" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_LinearTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_LinearTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_LinearTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::LinearTransform *)new faiss::LinearTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_LinearTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_LinearTransform__SWIG_3(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_LinearTransform__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_LinearTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::LinearTransform::LinearTransform(int,int,bool)\n" - " faiss::LinearTransform::LinearTransform(int,int)\n" - " faiss::LinearTransform::LinearTransform(int)\n" - " faiss::LinearTransform::LinearTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_transform_transpose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_transform_transpose",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_transform_transpose" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_transform_transpose" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_transform_transpose" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_transform_transpose" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->transform_transpose(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_reverse_transform" "', argument " "1"" of type '" "faiss::LinearTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::LinearTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_set_is_orthonormal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_set_is_orthonormal",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_set_is_orthonormal" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_is_orthonormal(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_LinearTransform_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_LinearTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::LinearTransform *arg1 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_LinearTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearTransform" "', argument " "1"" of type '" "faiss::LinearTransform *""'"); - } - arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *LinearTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__LinearTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RandomRotationMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomRotationMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RandomRotationMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomRotationMatrix *)new faiss::RandomRotationMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomRotationMatrix_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RandomRotationMatrix_init",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_init" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_init" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RandomRotationMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:RandomRotationMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_train" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RandomRotationMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RandomRotationMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RandomRotationMatrix *)new faiss::RandomRotationMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RandomRotationMatrix__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RandomRotationMatrix__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomRotationMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RandomRotationMatrix::RandomRotationMatrix(int,int)\n" - " faiss::RandomRotationMatrix::RandomRotationMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RandomRotationMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RandomRotationMatrix *arg1 = (faiss::RandomRotationMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomRotationMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomRotationMatrix" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RandomRotationMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigen_power_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_eigen_power_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->eigen_power = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigen_power_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (float) ((arg1)->eigen_power); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_random_rotation_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_random_rotation_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->random_rotation = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_random_rotation_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (bool) ((arg1)->random_rotation); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_max_points_per_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_points_per_d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_max_points_per_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (size_t) ((arg1)->max_points_per_d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_balanced_bins_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->balanced_bins = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_balanced_bins_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (int) ((arg1)->balanced_bins); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_mean_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->mean = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_mean_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->mean); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigenvalues_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->eigenvalues = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigenvalues_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->eigenvalues); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_PCAMat_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_PCAMat_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->PCAMat = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_PCAMat_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - result = (std::vector< float > *)& ((arg1)->PCAMat); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float arg3 ; - bool arg4 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_PCAMatrix",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_PCAMatrix" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_PCAMatrix",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_PCAMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_PCAMatrix",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_PCAMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PCAMatrix *)new faiss::PCAMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PCAMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_PCAMatrix__SWIG_4(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_3(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_PCAMatrix__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_PCAMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::PCAMatrix::PCAMatrix(int,int,float,bool)\n" - " faiss::PCAMatrix::PCAMatrix(int,int,float)\n" - " faiss::PCAMatrix::PCAMatrix(int,int)\n" - " faiss::PCAMatrix::PCAMatrix(int)\n" - " faiss::PCAMatrix::PCAMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:PCAMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_train" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PCAMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_copy_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - faiss::PCAMatrix *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_copy_from",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_copy_from" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__PCAMatrix, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'"); - } - arg2 = reinterpret_cast< faiss::PCAMatrix * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->copy_from((faiss::PCAMatrix const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PCAMatrix_prepare_Ab(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_prepare_Ab",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_prepare_Ab" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->prepare_Ab(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PCAMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PCAMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PCAMatrix" "', argument " "1"" of type '" "faiss::PCAMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PCAMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PCAMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OPQMatrix_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_M_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->M); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter_pq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter_pq); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->niter_pq_0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (int) ((arg1)->niter_pq_0); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_max_train_points_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_max_train_points_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_train_points = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_max_train_points_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (size_t) ((arg1)->max_train_points); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPQMatrix_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - result = (faiss::ProductQuantizer *) ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_OPQMatrix",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_OPQMatrix" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_OPQMatrix",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_OPQMatrix",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OPQMatrix")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OPQMatrix *)new faiss::OPQMatrix(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OPQMatrix(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_OPQMatrix__SWIG_3(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_OPQMatrix__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_OPQMatrix'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OPQMatrix::OPQMatrix(int,int,int)\n" - " faiss::OPQMatrix::OPQMatrix(int,int)\n" - " faiss::OPQMatrix::OPQMatrix(int)\n" - " faiss::OPQMatrix::OPQMatrix()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OPQMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OPQMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_train" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OPQMatrix_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OPQMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OPQMatrix",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OPQMatrix" "', argument " "1"" of type '" "faiss::OPQMatrix *""'"); - } - arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OPQMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OPQMatrix, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RemapDimensionsTransform_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_set" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RemapDimensionsTransform_map_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RemapDimensionsTransform_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_get" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - result = (std::vector< int > *)& ((arg1)->map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int *arg3 = (int *) 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "int const *""'"); - } - arg3 = reinterpret_cast< int * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,(int const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - bool arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RemapDimensionsTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::RemapDimensionsTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::RemapDimensionsTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RemapDimensionsTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_RemapDimensionsTransform__SWIG_3(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RemapDimensionsTransform__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RemapDimensionsTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,int const *)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,bool)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int)\n" - " faiss::RemapDimensionsTransform::RemapDimensionsTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RemapDimensionsTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RemapDimensionsTransform *arg1 = (faiss::RemapDimensionsTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RemapDimensionsTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RemapDimensionsTransform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'"); - } - arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RemapDimensionsTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:NormalizationTransform_norm_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_set" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_norm_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->norm = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:NormalizationTransform_norm_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_get" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - result = (float) ((arg1)->norm); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - float arg2 ; - int val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_NormalizationTransform",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_NormalizationTransform" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_NormalizationTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_NormalizationTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::NormalizationTransform *)new faiss::NormalizationTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_NormalizationTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_NormalizationTransform__SWIG_2(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_NormalizationTransform__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_NormalizationTransform__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_NormalizationTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::NormalizationTransform::NormalizationTransform(int,float)\n" - " faiss::NormalizationTransform::NormalizationTransform(int)\n" - " faiss::NormalizationTransform::NormalizationTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::NormalizationTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_NormalizationTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_reverse_transform" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::NormalizationTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_NormalizationTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::NormalizationTransform *arg1 = (faiss::NormalizationTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_NormalizationTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_NormalizationTransform" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'"); - } - arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *NormalizationTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__NormalizationTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_CenteringTransform_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:CenteringTransform_mean_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_set" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CenteringTransform_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->mean = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:CenteringTransform_mean_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_get" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - result = (std::vector< float > *)& ((arg1)->mean); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::CenteringTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_CenteringTransform",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CenteringTransform" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::CenteringTransform *)new faiss::CenteringTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_CenteringTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::CenteringTransform *)new faiss::CenteringTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_CenteringTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_CenteringTransform__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_CenteringTransform__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CenteringTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::CenteringTransform::CenteringTransform(int)\n" - " faiss::CenteringTransform::CenteringTransform()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:CenteringTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_train" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::CenteringTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CenteringTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - faiss::VectorTransform::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_reverse_transform" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'"); - } - arg2 = static_cast< faiss::VectorTransform::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_reverse_transform" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::CenteringTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_CenteringTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::CenteringTransform *arg1 = (faiss::CenteringTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_CenteringTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CenteringTransform" "', argument " "1"" of type '" "faiss::CenteringTransform *""'"); - } - arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *CenteringTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__CenteringTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - std::vector< faiss::VectorTransform * > *arg2 = (std::vector< faiss::VectorTransform * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_chain_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_chain_set" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2); - if (arg1) (arg1)->chain = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::VectorTransform * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_chain_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (std::vector< faiss::VectorTransform * > *)& ((arg1)->chain); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexPreTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPreTransform")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexPreTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexPreTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IndexPreTransform" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPreTransform(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexPreTransform__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexPreTransform__SWIG_0(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__VectorTransform, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexPreTransform__SWIG_2(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexPreTransform'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexPreTransform::IndexPreTransform(faiss::Index *)\n" - " faiss::IndexPreTransform::IndexPreTransform()\n" - " faiss::IndexPreTransform::IndexPreTransform(faiss::VectorTransform *,faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_prepend_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_prepend_transform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_prepend_transform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_prepend_transform" "', argument " "2"" of type '" "faiss::VectorTransform *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->prepend_transform(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_train" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add_with_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reset" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_remove_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPreTransform_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexPreTransform_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_range_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexPreTransform_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_apply_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_apply_chain",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_apply_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_apply_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_apply_chain" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::IndexPreTransform const *)arg1)->apply_chain(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPreTransform_reverse_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reverse_chain",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reverse_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reverse_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reverse_chain" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reverse_chain" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPreTransform const *)arg1)->reverse_chain(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPreTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPreTransform *arg1 = (faiss::IndexPreTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPreTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPreTransform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPreTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPreTransform, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlat_xb_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat_xb_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_set" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat_xb_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->xb = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_xb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_xb_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_get" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - result = (std::vector< float > *)& ((arg1)->xb); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - faiss::MetricType arg2 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexFlat",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexFlat" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlat",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_add" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_reset" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexFlat_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_range_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_reconstruct" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_compute_distance_subset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat_compute_distance_subset",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_compute_distance_subset" "', argument " "1"" of type '" "faiss::IndexFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_compute_distance_subset" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_compute_distance_subset" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_compute_distance_subset" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_compute_distance_subset" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat_compute_distance_subset" "', argument " "6"" of type '" "faiss::Index::idx_t const *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat const *)arg1)->compute_distance_subset(arg2,(float const *)arg3,arg4,arg5,(faiss::Index::idx_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_remove_ids" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat *)new faiss::IndexFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlat__SWIG_2(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlat::IndexFlat(faiss::Index::idx_t,faiss::MetricType)\n" - " faiss::IndexFlat::IndexFlat(faiss::Index::idx_t)\n" - " faiss::IndexFlat::IndexFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlat" "', argument " "1"" of type '" "faiss::IndexFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlatIP",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatIP" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatIP *)new faiss::IndexFlatIP(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatIP *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlatIP")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatIP *)new faiss::IndexFlatIP(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatIP(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlatIP__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlatIP__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlatIP'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlatIP::IndexFlatIP(faiss::Index::idx_t)\n" - " faiss::IndexFlatIP::IndexFlatIP()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatIP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatIP *arg1 = (faiss::IndexFlatIP *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatIP",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatIP, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatIP" "', argument " "1"" of type '" "faiss::IndexFlatIP *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatIP * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatIP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatIP, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlatL2",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatL2" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2 *)new faiss::IndexFlatL2(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlatL2")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2 *)new faiss::IndexFlatL2(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlatL2__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlatL2__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlatL2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlatL2::IndexFlatL2(faiss::Index::idx_t)\n" - " faiss::IndexFlatL2::IndexFlatL2()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatL2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2 *arg1 = (faiss::IndexFlatL2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatL2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatL2" "', argument " "1"" of type '" "faiss::IndexFlatL2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatL2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatL2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_shift_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlatL2BaseShift_shift_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_shift_set" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlatL2BaseShift_shift_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->shift = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_shift_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlatL2BaseShift_shift_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_shift_get" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - result = (std::vector< float > *)& ((arg1)->shift); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlatL2BaseShift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - long val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexFlatL2BaseShift *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexFlatL2BaseShift",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlatL2BaseShift" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexFlatL2BaseShift" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_IndexFlatL2BaseShift" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlatL2BaseShift *)new faiss::IndexFlatL2BaseShift(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlatL2BaseShift_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlatL2BaseShift_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlatL2BaseShift_search" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlatL2BaseShift_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlatL2BaseShift_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlatL2BaseShift_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlatL2BaseShift_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlatL2BaseShift_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlatL2BaseShift const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlatL2BaseShift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlatL2BaseShift *arg1 = (faiss::IndexFlatL2BaseShift *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlatL2BaseShift",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlatL2BaseShift" "', argument " "1"" of type '" "faiss::IndexFlatL2BaseShift *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlatL2BaseShift * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlatL2BaseShift_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlatL2BaseShift, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_refine_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::IndexFlat *arg2 = (faiss::IndexFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_refine_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_refine_index_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexRefineFlat_refine_index_set" "', argument " "2"" of type '" "faiss::IndexFlat *""'"); - } - arg2 = reinterpret_cast< faiss::IndexFlat * >(argp2); - if (arg1) (arg1)->refine_index = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_refine_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_refine_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_refine_index_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (faiss::IndexFlat *)& ((arg1)->refine_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_base_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_base_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_base_index_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexRefineFlat_base_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->base_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_base_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_base_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_base_index_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (faiss::Index *) ((arg1)->base_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_own_fields_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_own_fields_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_k_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexRefineFlat_k_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_k_factor_set" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_k_factor_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->k_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_k_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_k_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_k_factor_get" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - result = (float) ((arg1)->k_factor); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexRefineFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexRefineFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexRefineFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexRefineFlat *)new faiss::IndexRefineFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexRefineFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexRefineFlat *)new faiss::IndexRefineFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexRefineFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexRefineFlat__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexRefineFlat__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexRefineFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexRefineFlat::IndexRefineFlat(faiss::Index *)\n" - " faiss::IndexRefineFlat::IndexRefineFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexRefineFlat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_train" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexRefineFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_add" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexRefineFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_reset" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexRefineFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexRefineFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexRefineFlat_search" "', argument " "1"" of type '" "faiss::IndexRefineFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexRefineFlat_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexRefineFlat_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexRefineFlat_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexRefineFlat_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexRefineFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexRefineFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexRefineFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexRefineFlat *arg1 = (faiss::IndexRefineFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexRefineFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexRefineFlat" "', argument " "1"" of type '" "faiss::IndexRefineFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexRefineFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexRefineFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexRefineFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexFlat1D_continuous_update_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat1D_continuous_update_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_continuous_update_set" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_continuous_update_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->continuous_update = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_continuous_update_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_continuous_update_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_continuous_update_get" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - result = (bool) ((arg1)->continuous_update); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_perm_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - std::vector< faiss::Index::idx_t > *arg2 = (std::vector< faiss::Index::idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat1D_perm_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_perm_set" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat1D_perm_set" "', argument " "2"" of type '" "std::vector< faiss::Index::idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index::idx_t > * >(argp2); - if (arg1) (arg1)->perm = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_perm_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index::idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_perm_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_perm_get" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - result = (std::vector< faiss::Index::idx_t > *)& ((arg1)->perm); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool arg1 ; - bool val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexFlat1D *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlat1D",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_bool(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat1D" "', argument " "1"" of type '" "bool""'"); - } - arg1 = static_cast< bool >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat1D *)new faiss::IndexFlat1D(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexFlat1D")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexFlat1D *)new faiss::IndexFlat1D(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexFlat1D(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexFlat1D__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_bool(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexFlat1D__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexFlat1D'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexFlat1D::IndexFlat1D(bool)\n" - " faiss::IndexFlat1D::IndexFlat1D()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_update_permutation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_update_permutation",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_update_permutation" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_permutation(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat1D_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_add" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat1D_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat1D_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_reset" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexFlat1D_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat1D_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat1D_search" "', argument " "1"" of type '" "faiss::IndexFlat1D const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat1D_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat1D_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat1D_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat1D_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat1D_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexFlat1D const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexFlat1D(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexFlat1D *arg1 = (faiss::IndexFlat1D *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexFlat1D",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat1D, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexFlat1D" "', argument " "1"" of type '" "faiss::IndexFlat1D *""'"); - } - arg1 = reinterpret_cast< faiss::IndexFlat1D * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexFlat1D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexFlat1D, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexLSH_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_nbits_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_nbits_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_nbits_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (int) ((arg1)->nbits); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_bytes_per_vec_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_bytes_per_vec_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_bytes_per_vec_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_bytes_per_vec_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->bytes_per_vec = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_bytes_per_vec_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_bytes_per_vec_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_bytes_per_vec_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (int) ((arg1)->bytes_per_vec); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rotate_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_rotate_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rotate_data_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_rotate_data_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->rotate_data = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rotate_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_rotate_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rotate_data_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (bool) ((arg1)->rotate_data); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train_thresholds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_train_thresholds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train_thresholds_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_train_thresholds_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->train_thresholds = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train_thresholds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_train_thresholds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train_thresholds_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (bool) ((arg1)->train_thresholds); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rrot_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::RandomRotationMatrix *arg2 = (faiss::RandomRotationMatrix *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_rrot_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rrot_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_rrot_set" "', argument " "2"" of type '" "faiss::RandomRotationMatrix *""'"); - } - arg2 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp2); - if (arg1) (arg1)->rrot = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_rrot_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomRotationMatrix *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_rrot_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_rrot_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (faiss::RandomRotationMatrix *)& ((arg1)->rrot); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_thresholds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_thresholds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_thresholds_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_thresholds_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->thresholds = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_thresholds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_thresholds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_thresholds_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (std::vector< float > *)& ((arg1)->thresholds); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - std::vector< faiss::IndexLSH::uint8_t > *arg2 = (std::vector< faiss::IndexLSH::uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_codes_set" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_codes_set" "', argument " "2"" of type '" "std::vector< faiss::IndexLSH::uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::IndexLSH::uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::IndexLSH::uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_codes_get" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - result = (std::vector< faiss::IndexLSH::uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - bool arg3 ; - bool arg4 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexLSH",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexLSH" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexLSH" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexLSH",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexLSH" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - int arg2 ; - long val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexLSH",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexLSH" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexLSH" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_apply_preprocess(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_apply_preprocess",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_apply_preprocess" "', argument " "1"" of type '" "faiss::IndexLSH const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_apply_preprocess" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_apply_preprocess" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (float *)((faiss::IndexLSH const *)arg1)->apply_preprocess(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_train" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexLSH_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_add" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexLSH_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_search" "', argument " "1"" of type '" "faiss::IndexLSH const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexLSH_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexLSH_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexLSH_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexLSH_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexLSH_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexLSH const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexLSH_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_reset" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexLSH_transfer_thresholds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - faiss::LinearTransform *arg2 = (faiss::LinearTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexLSH_transfer_thresholds",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexLSH_transfer_thresholds" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexLSH_transfer_thresholds" "', argument " "2"" of type '" "faiss::LinearTransform *""'"); - } - arg2 = reinterpret_cast< faiss::LinearTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->transfer_thresholds(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexLSH(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *arg1 = (faiss::IndexLSH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexLSH",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexLSH" "', argument " "1"" of type '" "faiss::IndexLSH *""'"); - } - arg1 = reinterpret_cast< faiss::IndexLSH * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexLSH *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexLSH")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexLSH *)new faiss::IndexLSH(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexLSH, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexLSH(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexLSH__SWIG_3(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_2(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexLSH__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexLSH'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int,bool,bool)\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int,bool)\n" - " faiss::IndexLSH::IndexLSH(faiss::Index::idx_t,int)\n" - " faiss::IndexLSH::IndexLSH()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexLSH_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexLSH, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_temperature_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_init_temperature_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_temperature_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_init_temperature_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->init_temperature = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_temperature_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_init_temperature_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_temperature_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (double) ((arg1)->init_temperature); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_temperature_decay_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_temperature_decay_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_temperature_decay_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_temperature_decay_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->temperature_decay = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_temperature_decay_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_temperature_decay_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_temperature_decay_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (double) ((arg1)->temperature_decay); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_iter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_n_iter_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_iter_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_n_iter_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_iter = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_iter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_n_iter_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_iter_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->n_iter); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_redo_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_n_redo_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_redo_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_n_redo_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_redo = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_n_redo_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_n_redo_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_n_redo_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->n_redo); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_seed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_seed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_seed_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_seed_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->seed = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_seed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_seed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_seed_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->seed); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_verbose_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_verbose_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_verbose_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (int) ((arg1)->verbose); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_only_bit_flips_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_only_bit_flips_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_only_bit_flips_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_only_bit_flips_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->only_bit_flips = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_only_bit_flips_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_only_bit_flips_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_only_bit_flips_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (bool) ((arg1)->only_bit_flips); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_random_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingParameters_init_random_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_random_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingParameters_init_random_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->init_random = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingParameters_init_random_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingParameters_init_random_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingParameters_init_random_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - result = (bool) ((arg1)->init_random); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SimulatedAnnealingParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_SimulatedAnnealingParameters")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SimulatedAnnealingParameters *)new faiss::SimulatedAnnealingParameters(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SimulatedAnnealingParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingParameters *arg1 = (faiss::SimulatedAnnealingParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SimulatedAnnealingParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SimulatedAnnealingParameters" "', argument " "1"" of type '" "faiss::SimulatedAnnealingParameters *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SimulatedAnnealingParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__SimulatedAnnealingParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PermutationObjective_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PermutationObjective_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_n_set" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PermutationObjective_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PermutationObjective_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_n_get" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_compute_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:PermutationObjective_compute_cost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_compute_cost" "', argument " "1"" of type '" "faiss::PermutationObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PermutationObjective_compute_cost" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::PermutationObjective const *)arg1)->compute_cost((int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PermutationObjective_cost_update(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PermutationObjective_cost_update",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PermutationObjective_cost_update" "', argument " "1"" of type '" "faiss::PermutationObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PermutationObjective_cost_update" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PermutationObjective_cost_update" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "PermutationObjective_cost_update" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::PermutationObjective const *)arg1)->cost_update((int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PermutationObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PermutationObjective",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PermutationObjective" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PermutationObjective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PermutationObjective, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_dis_weight_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight_factor_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_dis_weight_factor_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dis_weight_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_dis_weight_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight_factor_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (double) ((arg1)->dis_weight_factor); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double arg1 ; - double val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_sqr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_double(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ReproduceDistancesObjective_sqr" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)faiss::ReproduceDistancesObjective::sqr(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_dis_weight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_dis_weight",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_dis_weight" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_dis_weight" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->dis_weight(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_source_dis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_source_dis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_source_dis_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_source_dis_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->source_dis = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_source_dis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_source_dis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_source_dis_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (std::vector< double > *)& ((arg1)->source_dis); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_target_dis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double *arg2 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_target_dis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_target_dis_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_target_dis_set" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - if (arg1) (arg1)->target_dis = (double const *)arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_target_dis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_target_dis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_target_dis_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (double *) ((arg1)->target_dis); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_weights_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_weights_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_weights_set" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_weights_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->weights = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_weights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReproduceDistancesObjective_weights_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_weights_get" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - result = (std::vector< double > *)& ((arg1)->weights); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_get_source_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReproduceDistancesObjective_get_source_dis",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReproduceDistancesObjective_get_source_dis" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->get_source_dis(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_compute_cost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_compute_cost",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_compute_cost" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_compute_cost" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->compute_cost((int const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_cost_update(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - int *arg2 = (int *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReproduceDistancesObjective_cost_update",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective const *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "2"" of type '" "int const *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ReproduceDistancesObjective_cost_update" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::ReproduceDistancesObjective const *)arg1)->cost_update((int const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReproduceDistancesObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - double *arg2 = (double *) 0 ; - double *arg3 = (double *) 0 ; - double arg4 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::ReproduceDistancesObjective *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_ReproduceDistancesObjective",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ReproduceDistancesObjective" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ReproduceDistancesObjective" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ReproduceDistancesObjective" "', argument " "3"" of type '" "double const *""'"); - } - arg3 = reinterpret_cast< double * >(argp3); - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ReproduceDistancesObjective" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReproduceDistancesObjective *)new faiss::ReproduceDistancesObjective(arg1,(double const *)arg2,(double const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_compute_mean_stdev(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double *arg1 = (double *) 0 ; - size_t arg2 ; - double *arg3 = (double *) 0 ; - double *arg4 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReproduceDistancesObjective_compute_mean_stdev",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "1"" of type '" "double const *""'"); - } - arg1 = reinterpret_cast< double * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "3"" of type '" "double *""'"); - } - arg3 = reinterpret_cast< double * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReproduceDistancesObjective_compute_mean_stdev" "', argument " "4"" of type '" "double *""'"); - } - arg4 = reinterpret_cast< double * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ReproduceDistancesObjective::compute_mean_stdev((double const *)arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReproduceDistancesObjective_set_affine_target_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - double *arg2 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReproduceDistancesObjective_set_affine_target_dis",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReproduceDistancesObjective_set_affine_target_dis" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReproduceDistancesObjective_set_affine_target_dis" "', argument " "2"" of type '" "double const *""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_affine_target_dis((double const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ReproduceDistancesObjective(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReproduceDistancesObjective *arg1 = (faiss::ReproduceDistancesObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ReproduceDistancesObjective",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReproduceDistancesObjective" "', argument " "1"" of type '" "faiss::ReproduceDistancesObjective *""'"); - } - arg1 = reinterpret_cast< faiss::ReproduceDistancesObjective * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ReproduceDistancesObjective_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ReproduceDistancesObjective, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_obj_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - faiss::PermutationObjective *arg2 = (faiss::PermutationObjective *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_obj_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_obj_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PermutationObjective, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_obj_set" "', argument " "2"" of type '" "faiss::PermutationObjective *""'"); - } - arg2 = reinterpret_cast< faiss::PermutationObjective * >(argp2); - if (arg1) (arg1)->obj = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PermutationObjective *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_obj_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_obj_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (faiss::PermutationObjective *) ((arg1)->obj); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_n_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingOptimizer_n_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_n_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (int) ((arg1)->n); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_logfile_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_logfile_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_logfile_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_logfile_set" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - if (arg1) (arg1)->logfile = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_logfile_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - FILE *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_logfile_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_logfile_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (FILE *) ((arg1)->logfile); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FILE, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SimulatedAnnealingOptimizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PermutationObjective *arg1 = (faiss::PermutationObjective *) 0 ; - faiss::SimulatedAnnealingParameters *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::SimulatedAnnealingOptimizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_SimulatedAnnealingOptimizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PermutationObjective, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "1"" of type '" "faiss::PermutationObjective *""'"); - } - arg1 = reinterpret_cast< faiss::PermutationObjective * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__SimulatedAnnealingParameters, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "2"" of type '" "faiss::SimulatedAnnealingParameters const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SimulatedAnnealingOptimizer" "', argument " "2"" of type '" "faiss::SimulatedAnnealingParameters const &""'"); - } - arg2 = reinterpret_cast< faiss::SimulatedAnnealingParameters * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SimulatedAnnealingOptimizer *)new faiss::SimulatedAnnealingOptimizer(arg1,(faiss::SimulatedAnnealingParameters const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_rnd_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - faiss::RandomGenerator *arg2 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_rnd_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_rnd_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_rnd_set" "', argument " "2"" of type '" "faiss::RandomGenerator *""'"); - } - arg2 = reinterpret_cast< faiss::RandomGenerator * >(argp2); - if (arg1) (arg1)->rnd = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_rnd_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_rnd_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_rnd_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (faiss::RandomGenerator *) ((arg1)->rnd); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_init_cost_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_init_cost_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_init_cost_set" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulatedAnnealingOptimizer_init_cost_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->init_cost = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_init_cost_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:SimulatedAnnealingOptimizer_init_cost_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_init_cost_get" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - result = (double) ((arg1)->init_cost); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_optimize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_optimize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_optimize" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_optimize" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->optimize(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SimulatedAnnealingOptimizer_run_optimization(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:SimulatedAnnealingOptimizer_run_optimization",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulatedAnnealingOptimizer_run_optimization" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SimulatedAnnealingOptimizer_run_optimization" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)(arg1)->run_optimization(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SimulatedAnnealingOptimizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::SimulatedAnnealingOptimizer *arg1 = (faiss::SimulatedAnnealingOptimizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SimulatedAnnealingOptimizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SimulatedAnnealingOptimizer" "', argument " "1"" of type '" "faiss::SimulatedAnnealingOptimizer *""'"); - } - arg1 = reinterpret_cast< faiss::SimulatedAnnealingOptimizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SimulatedAnnealingOptimizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimization_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::PolysemousTraining::Optimization_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_optimization_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimization_type_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_optimization_type_set" "', argument " "2"" of type '" "faiss::PolysemousTraining::Optimization_type_t""'"); - } - arg2 = static_cast< faiss::PolysemousTraining::Optimization_type_t >(val2); - if (arg1) (arg1)->optimization_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimization_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining::Optimization_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_optimization_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimization_type_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (faiss::PolysemousTraining::Optimization_type_t) ((arg1)->optimization_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_ntrain_permutation_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_ntrain_permutation_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_ntrain_permutation_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_ntrain_permutation_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->ntrain_permutation = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_ntrain_permutation_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_ntrain_permutation_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_ntrain_permutation_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (int) ((arg1)->ntrain_permutation); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_dis_weight_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_dis_weight_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_dis_weight_factor_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PolysemousTraining_dis_weight_factor_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->dis_weight_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_dis_weight_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_dis_weight_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_dis_weight_factor_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (double) ((arg1)->dis_weight_factor); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_log_pattern_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_log_pattern_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_log_pattern_set" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_log_pattern_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_log_pattern_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->log_pattern = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_log_pattern_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:PolysemousTraining_log_pattern_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_log_pattern_get" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - result = (std::string *) & ((arg1)->log_pattern); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_PolysemousTraining(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_PolysemousTraining")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::PolysemousTraining *)new faiss::PolysemousTraining(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_pq_for_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PolysemousTraining_optimize_pq_for_hamming",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PolysemousTraining_optimize_pq_for_hamming" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_pq_for_hamming(*arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_ranking(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:PolysemousTraining_optimize_ranking",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_ranking" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PolysemousTraining_optimize_ranking" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_ranking(*arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_PolysemousTraining_optimize_reproduce_distances(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - faiss::ProductQuantizer *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:PolysemousTraining_optimize_reproduce_distances",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "1"" of type '" "faiss::PolysemousTraining const *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__ProductQuantizer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PolysemousTraining_optimize_reproduce_distances" "', argument " "2"" of type '" "faiss::ProductQuantizer &""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::PolysemousTraining const *)arg1)->optimize_reproduce_distances(*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_PolysemousTraining(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::PolysemousTraining *arg1 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_PolysemousTraining",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PolysemousTraining" "', argument " "1"" of type '" "faiss::PolysemousTraining *""'"); - } - arg1 = reinterpret_cast< faiss::PolysemousTraining * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *PolysemousTraining_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PolysemousTraining, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPQ_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_pq_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_pq_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_codes_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_codes_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexPQ",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexPQ" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexPQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQ *)new faiss::IndexPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexPQ__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexPQ__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexPQ__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexPQ::IndexPQ(int,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexPQ::IndexPQ(int,size_t,size_t)\n" - " faiss::IndexPQ::IndexPQ()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_train" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_add" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reset" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPQ_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexPQ_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPQ_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPQ_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_reconstruct" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_remove_ids" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexPQ_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_do_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_do_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_do_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_do_polysemous_training_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->do_polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_do_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_do_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_do_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (bool) ((arg1)->do_polysemous_training); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::PolysemousTraining *arg2 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPQ_polysemous_training_set" "', argument " "2"" of type '" "faiss::PolysemousTraining *""'"); - } - arg2 = reinterpret_cast< faiss::PolysemousTraining * >(argp2); - if (arg1) (arg1)->polysemous_training = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::PolysemousTraining *)& ((arg1)->polysemous_training); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::IndexPQ::Search_type_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_search_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_type_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search_type_set" "', argument " "2"" of type '" "faiss::IndexPQ::Search_type_t""'"); - } - arg2 = static_cast< faiss::IndexPQ::Search_type_t >(val2); - if (arg1) (arg1)->search_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexPQ::Search_type_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_search_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_type_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (faiss::IndexPQ::Search_type_t) ((arg1)->search_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_encode_signs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_encode_signs_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_encode_signs_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_encode_signs_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->encode_signs = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_encode_signs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_encode_signs_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_encode_signs_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (bool) ((arg1)->encode_signs); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQ_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQ_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_search_core_polysemous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_search_core_polysemous",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_search_core_polysemous" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_search_core_polysemous" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_search_core_polysemous" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_search_core_polysemous" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_search_core_polysemous" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_search_core_polysemous" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->search_core_polysemous(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_hamming_distance_histogram(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - long *arg6 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPQ_hamming_distance_histogram",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "5"" of type '" "float const *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPQ_hamming_distance_histogram" "', argument " "6"" of type '" "long *""'"); - } - arg6 = reinterpret_cast< long * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->hamming_distance_histogram(arg2,(float const *)arg3,arg4,(float const *)arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQ_hamming_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - int32_t *arg4 = (int32_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPQ_hamming_distance_table",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQ_hamming_distance_table" "', argument " "1"" of type '" "faiss::IndexPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQ_hamming_distance_table" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPQ_hamming_distance_table" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPQ_hamming_distance_table" "', argument " "4"" of type '" "int32_t *""'"); - } - arg4 = reinterpret_cast< int32_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexPQ const *)arg1)->hamming_distance_table(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQ *arg1 = (faiss::IndexPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPQ" "', argument " "1"" of type '" "faiss::IndexPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexPQStats_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_nq_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_nq_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_ncode_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_ncode_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_ncode_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_ncode_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ncode = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_ncode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_ncode_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_ncode_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->ncode); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_n_hamming_pass_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexPQStats_n_hamming_pass_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_n_hamming_pass_set" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPQStats_n_hamming_pass_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_hamming_pass = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_n_hamming_pass_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_n_hamming_pass_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_n_hamming_pass_get" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - result = (size_t) ((arg1)->n_hamming_pass); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexPQStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexPQStats *)new faiss::IndexPQStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPQStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexPQStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexPQStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPQStats_reset" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexPQStats *arg1 = (faiss::IndexPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPQStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPQStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPQStats" "', argument " "1"" of type '" "faiss::IndexPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexPQStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexPQStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPQStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexPQ_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexPQStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexPQ_stats""' of type '""faiss::IndexPQStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexPQ_stats""' of type '""faiss::IndexPQStats""'"); - } else { - faiss::IndexPQStats * temp; - temp = reinterpret_cast< faiss::IndexPQStats * >(argp); - faiss::indexPQ_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexPQ_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexPQ_stats), SWIGTYPE_p_faiss__IndexPQStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_pq_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiIndexQuantizer_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_pq_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::MultiIndexQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_MultiIndexQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_MultiIndexQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer *)new faiss::MultiIndexQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_train" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MultiIndexQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_search" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MultiIndexQuantizer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MultiIndexQuantizer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "MultiIndexQuantizer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_add" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_reset" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_MultiIndexQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer *)new faiss::MultiIndexQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_MultiIndexQuantizer__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_MultiIndexQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_MultiIndexQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::MultiIndexQuantizer::MultiIndexQuantizer(int,size_t,size_t)\n" - " faiss::MultiIndexQuantizer::MultiIndexQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MultiIndexQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer *arg1 = (faiss::MultiIndexQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MultiIndexQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiIndexQuantizer" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MultiIndexQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MultiIndexQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_assign_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer2_assign_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_assign_indexes_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiIndexQuantizer2_assign_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->assign_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_assign_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer2_assign_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_assign_indexes_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->assign_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MultiIndexQuantizer2_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_own_fields_set" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:MultiIndexQuantizer2_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_own_fields_get" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - size_t arg3 ; - faiss::Index **arg4 = (faiss::Index **) 0 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::MultiIndexQuantizer2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_MultiIndexQuantizer2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer2" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_MultiIndexQuantizer2" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_MultiIndexQuantizer2" "', argument " "4"" of type '" "faiss::Index **""'"); - } - arg4 = reinterpret_cast< faiss::Index ** >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer2 *)new faiss::MultiIndexQuantizer2(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - size_t arg2 ; - faiss::Index *arg3 = (faiss::Index *) 0 ; - faiss::Index *arg4 = (faiss::Index *) 0 ; - int val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::MultiIndexQuantizer2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_MultiIndexQuantizer2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MultiIndexQuantizer2" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MultiIndexQuantizer2" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_MultiIndexQuantizer2" "', argument " "3"" of type '" "faiss::Index *""'"); - } - arg3 = reinterpret_cast< faiss::Index * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_MultiIndexQuantizer2" "', argument " "4"" of type '" "faiss::Index *""'"); - } - arg4 = reinterpret_cast< faiss::Index * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MultiIndexQuantizer2 *)new faiss::MultiIndexQuantizer2(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MultiIndexQuantizer2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_MultiIndexQuantizer2__SWIG_1(self, args); - } - } - } - } - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_MultiIndexQuantizer2__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_MultiIndexQuantizer2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::MultiIndexQuantizer2::MultiIndexQuantizer2(int,size_t,size_t,faiss::Index **)\n" - " faiss::MultiIndexQuantizer2::MultiIndexQuantizer2(int,size_t,faiss::Index *,faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:MultiIndexQuantizer2_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_train" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer2_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MultiIndexQuantizer2_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MultiIndexQuantizer2_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiIndexQuantizer2_search" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 const *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiIndexQuantizer2_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MultiIndexQuantizer2_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MultiIndexQuantizer2_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MultiIndexQuantizer2_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "MultiIndexQuantizer2_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::MultiIndexQuantizer2 const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MultiIndexQuantizer2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MultiIndexQuantizer2 *arg1 = (faiss::MultiIndexQuantizer2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MultiIndexQuantizer2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiIndexQuantizer2" "', argument " "1"" of type '" "faiss::MultiIndexQuantizer2 *""'"); - } - arg1 = reinterpret_cast< faiss::MultiIndexQuantizer2 * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MultiIndexQuantizer2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MultiIndexQuantizer2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_InvertedLists_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_nlist_set" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_nlist_get" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_code_size_set" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_code_size_get" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_list_size" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::InvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_codes" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::InvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_ids" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::InvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_release_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_release_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_release_codes" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_release_codes" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->release_codes((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_release_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::InvertedLists::idx_t *arg2 = (faiss::InvertedLists::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:InvertedLists_release_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_release_ids" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_release_ids" "', argument " "2"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->release_ids((faiss::InvertedLists::idx_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_single_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::InvertedLists::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_get_single_id",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_single_id" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_single_id" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_get_single_id" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t)((faiss::InvertedLists const *)arg1)->get_single_id(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_get_single_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_get_single_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_get_single_code" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_get_single_code" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_get_single_code" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::InvertedLists const *)arg1)->get_single_code(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_prefetch_lists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - long *arg2 = (long *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_prefetch_lists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_prefetch_lists" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_prefetch_lists" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_prefetch_lists" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->prefetch_lists((long const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_add_entry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - faiss::InvertedLists::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:InvertedLists_add_entry",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_add_entry" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_add_entry" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_add_entry" "', argument " "3"" of type '" "faiss::InvertedLists::idx_t""'"); - } - arg3 = static_cast< faiss::InvertedLists::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "InvertedLists_add_entry" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entry(arg2,arg3,(uint8_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:InvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_add_entries" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "InvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_update_entry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t arg4 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:InvertedLists_update_entry",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_update_entry" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_update_entry" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_update_entry" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "InvertedLists_update_entry" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t""'"); - } - arg4 = static_cast< faiss::InvertedLists::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_update_entry" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entry(arg2,arg3,arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:InvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_update_entries" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "InvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "InvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "InvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_resize" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_reset" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:InvertedLists_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_merge_from" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedLists_merge_from" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "InvertedLists_merge_from" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InvertedLists" "', argument " "1"" of type '" "faiss::InvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_imbalance_factor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_imbalance_factor",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_imbalance_factor" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::InvertedLists const *)arg1)->imbalance_factor(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InvertedLists_print_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:InvertedLists_print_stats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedLists_print_stats" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::InvertedLists const *)arg1)->print_stats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__InvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - std::vector< std::vector< uint8_t > > *arg2 = (std::vector< std::vector< uint8_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_codes_set" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ArrayInvertedLists_codes_set" "', argument " "2"" of type '" "std::vector< std::vector< uint8_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< uint8_t > > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< uint8_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ArrayInvertedLists_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_codes_get" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - result = (std::vector< std::vector< uint8_t > > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - std::vector< std::vector< faiss::InvertedLists::idx_t > > *arg2 = (std::vector< std::vector< faiss::InvertedLists::idx_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_ids_set" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ArrayInvertedLists_ids_set" "', argument " "2"" of type '" "std::vector< std::vector< faiss::InvertedLists::idx_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< faiss::InvertedLists::idx_t > > * >(argp2); - if (arg1) (arg1)->ids = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< faiss::InvertedLists::idx_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ArrayInvertedLists_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_ids_get" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - result = (std::vector< std::vector< faiss::InvertedLists::idx_t > > *)& ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ArrayInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ArrayInvertedLists",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ArrayInvertedLists" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ArrayInvertedLists" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ArrayInvertedLists *)new faiss::ArrayInvertedLists(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_list_size" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ArrayInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ArrayInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ArrayInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::ArrayInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::ArrayInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ArrayInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ArrayInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ArrayInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ArrayInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ArrayInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ArrayInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ArrayInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ArrayInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ArrayInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ArrayInvertedLists_resize" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ArrayInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ArrayInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ArrayInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ArrayInvertedLists *arg1 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ArrayInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ArrayInvertedLists" "', argument " "1"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ArrayInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_ils_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - std::vector< faiss::InvertedLists const * > *arg2 = (std::vector< faiss::InvertedLists const * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_ils_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_ils_set" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_ils_set" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists const * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::InvertedLists const * > * >(argp2); - if (arg1) (arg1)->ils = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_ils_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::InvertedLists const * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ConcatenatedInvertedLists_ils_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_ils_get" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - result = (std::vector< faiss::InvertedLists const * > *)& ((arg1)->ils); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ConcatenatedInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::InvertedLists **arg2 = (faiss::InvertedLists **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ConcatenatedInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ConcatenatedInvertedLists",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ConcatenatedInvertedLists" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ConcatenatedInvertedLists" "', argument " "2"" of type '" "faiss::InvertedLists const **""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists ** >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ConcatenatedInvertedLists *)new faiss::ConcatenatedInvertedLists(arg1,(faiss::InvertedLists const **)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_list_size" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ConcatenatedInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_release_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_release_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_release_codes" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_release_codes" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ConcatenatedInvertedLists const *)arg1)->release_codes((uint8_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_release_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - faiss::InvertedLists::idx_t *arg2 = (faiss::InvertedLists::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ConcatenatedInvertedLists_release_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_release_ids" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ConcatenatedInvertedLists_release_ids" "', argument " "2"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ConcatenatedInvertedLists const *)arg1)->release_ids((faiss::InvertedLists::idx_t const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_single_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::InvertedLists::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_get_single_id",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_get_single_id" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t)((faiss::ConcatenatedInvertedLists const *)arg1)->get_single_id(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_get_single_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_get_single_code",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_get_single_code" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::ConcatenatedInvertedLists const *)arg1)->get_single_code(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ConcatenatedInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ConcatenatedInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ConcatenatedInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ConcatenatedInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ConcatenatedInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ConcatenatedInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ConcatenatedInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ConcatenatedInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ConcatenatedInvertedLists *arg1 = (faiss::ConcatenatedInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ConcatenatedInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ConcatenatedInvertedLists" "', argument " "1"" of type '" "faiss::ConcatenatedInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::ConcatenatedInvertedLists * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ConcatenatedInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ConcatenatedInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_quantizer_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_quantizer_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->quantizer = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_quantizer_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::Index *) ((arg1)->quantizer); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_nlist_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_nlist_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_trains_alone_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_quantizer_trains_alone_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_trains_alone_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_quantizer_trains_alone_set" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - if (arg1) (arg1)->quantizer_trains_alone = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_quantizer_trains_alone_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_quantizer_trains_alone_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_quantizer_trains_alone_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (char) ((arg1)->quantizer_trains_alone); - resultobj = SWIG_From_char(static_cast< char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_own_fields_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_own_fields_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_cp_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_cp_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_clustering_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Level1Quantizer_clustering_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_clustering_index_set" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Level1Quantizer_clustering_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->clustering_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_clustering_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Level1Quantizer_clustering_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_clustering_index_get" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - result = (faiss::Index *) ((arg1)->clustering_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Level1Quantizer_train_q1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - bool arg4 ; - faiss::MetricType arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Level1Quantizer_train_q1",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Level1Quantizer_train_q1" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Level1Quantizer_train_q1" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Level1Quantizer_train_q1" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Level1Quantizer_train_q1" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Level1Quantizer_train_q1" "', argument " "5"" of type '" "faiss::MetricType""'"); - } - arg5 = static_cast< faiss::MetricType >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_q1(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Level1Quantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Level1Quantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Level1Quantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Level1Quantizer *)new faiss::Level1Quantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Level1Quantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Level1Quantizer *)new faiss::Level1Quantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Level1Quantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Level1Quantizer__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Level1Quantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Level1Quantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Level1Quantizer::Level1Quantizer(faiss::Index *,size_t)\n" - " faiss::Level1Quantizer::Level1Quantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Level1Quantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Level1Quantizer *arg1 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Level1Quantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Level1Quantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Level1Quantizer" "', argument " "1"" of type '" "faiss::Level1Quantizer *""'"); - } - arg1 = reinterpret_cast< faiss::Level1Quantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Level1Quantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Level1Quantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFSearchParameters_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_nprobe_set" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFSearchParameters_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFSearchParameters_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_nprobe_get" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFSearchParameters_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_max_codes_set" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFSearchParameters_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFSearchParameters_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFSearchParameters_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFSearchParameters_max_codes_get" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IVFSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *arg1 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IVFSearchParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVFSearchParameters" "', argument " "1"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFSearchParameters * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IVFSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFSearchParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IVFSearchParameters")) SWIG_fail; - result = (faiss::IVFSearchParameters *)new faiss::IVFSearchParameters(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IVFSearchParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IVFSearchParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVF_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_invlists_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_invlists_set" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - if (arg1) (arg1)->invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_invlists_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (faiss::InvertedLists *) ((arg1)->invlists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_own_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_own_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_own_invlists_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_own_invlists_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_own_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_own_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_own_invlists_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (bool) ((arg1)->own_invlists); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_code_size_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_code_size_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_nprobe_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_nprobe_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_max_codes_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_max_codes_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_maintain_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_maintain_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_maintain_direct_map_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_maintain_direct_map_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->maintain_direct_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_maintain_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_maintain_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_maintain_direct_map_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (bool) ((arg1)->maintain_direct_map); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_direct_map_set" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_direct_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->direct_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_direct_map_get" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - result = (std::vector< long > *)& ((arg1)->direct_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reset" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_train" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_add" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_train_residual" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVF_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVF_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVF_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVF::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVF_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_range_search" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVF const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_get_InvertedListScanner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVF const *)arg1)->get_InvertedListScanner(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_InvertedListScanner(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_get_InvertedListScanner__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_get_InvertedListScanner__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_get_InvertedListScanner'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::get_InvertedListScanner(bool) const\n" - " faiss::IndexIVF::get_InvertedListScanner() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVF_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexIVF_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVF_search_and_reconstruct" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVF_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVF_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_check_compatible_for_merge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_check_compatible_for_merge",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "2"" of type '" "faiss::IndexIVF const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_check_compatible_for_merge" "', argument " "2"" of type '" "faiss::IndexIVF const &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->check_compatible_for_merge((faiss::IndexIVF const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - faiss::Index::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_merge_from" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_merge_from" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_copy_subset_to(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - int arg3 ; - long arg4 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - long val4 ; - int ecode4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVF_copy_subset_to",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_copy_subset_to" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_copy_subset_to" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVF_copy_subset_to" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_copy_subset_to" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVF_copy_subset_to" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IndexIVF_copy_subset_to" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVF const *)arg1)->copy_subset_to(*arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVF",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVF" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_get_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_get_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_get_list_size" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_get_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexIVF const *)arg1)->get_list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_make_direct_map",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVF_make_direct_map" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_make_direct_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_make_direct_map(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_make_direct_map__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_make_direct_map__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_make_direct_map'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::make_direct_map(bool)\n" - " faiss::IndexIVF::make_direct_map()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVF_replace_invlists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVF_replace_invlists" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVF_replace_invlists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVF_replace_invlists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVF_replace_invlists__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVF_replace_invlists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVF_replace_invlists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVF::replace_invlists(faiss::InvertedLists *,bool)\n" - " faiss::IndexIVF::replace_invlists(faiss::InvertedLists *)\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIVF_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVF, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nq_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nq_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nlist_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nlist_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_ndis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_ndis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_ndis_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_ndis_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ndis = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_ndis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_ndis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_ndis_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->ndis); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nheap_updates_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_nheap_updates_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nheap_updates_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_nheap_updates_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nheap_updates = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_nheap_updates_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_nheap_updates_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_nheap_updates_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (size_t) ((arg1)->nheap_updates); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_quantization_time_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_quantization_time_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_quantization_time_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_quantization_time_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->quantization_time = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_quantization_time_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_quantization_time_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_quantization_time_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (double) ((arg1)->quantization_time); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_search_time_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFStats_search_time_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_search_time_set" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFStats_search_time_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->search_time = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_search_time_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_search_time_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_search_time_get" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - result = (double) ((arg1)->search_time); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFStats *)new faiss::IndexIVFStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFStats_reset" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFStats *arg1 = (faiss::IndexIVFStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFStats" "', argument " "1"" of type '" "faiss::IndexIVFStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexIVF_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexIVFStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexIVF_stats""' of type '""faiss::IndexIVFStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexIVF_stats""' of type '""faiss::IndexIVFStats""'"); - } else { - faiss::IndexIVFStats * temp; - temp = reinterpret_cast< faiss::IndexIVFStats * >(argp); - faiss::indexIVF_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexIVF_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexIVF_stats), SWIGTYPE_p_faiss__IndexIVFStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_check_compatible_for_merge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:check_compatible_for_merge",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "check_compatible_for_merge" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "check_compatible_for_merge" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::check_compatible_for_merge((faiss::Index const *)arg1,(faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:extract_index_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "extract_index_ivf" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)faiss::ivflib::extract_index_ivf((faiss::Index const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:extract_index_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "extract_index_ivf" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)faiss::ivflib::extract_index_ivf(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_extract_index_ivf(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_extract_index_ivf__SWIG_0(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_extract_index_ivf__SWIG_1(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'extract_index_ivf'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ivflib::extract_index_ivf(faiss::Index const *)\n" - " faiss::ivflib::extract_index_ivf(faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_merge_into(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:merge_into",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "merge_into" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "merge_into" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "merge_into" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::merge_into(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_centroid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - float *arg2 = (float *) 0 ; - int arg3 ; - faiss::ivflib::idx_t *arg4 = (faiss::ivflib::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:search_centroid",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_centroid" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "search_centroid" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "search_centroid" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "search_centroid" "', argument " "4"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::ivflib::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_centroid(arg1,(float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_and_return_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - long arg4 ; - float *arg5 = (float *) 0 ; - faiss::ivflib::idx_t *arg6 = (faiss::ivflib::idx_t *) 0 ; - faiss::ivflib::idx_t *arg7 = (faiss::ivflib::idx_t *) 0 ; - faiss::ivflib::idx_t *arg8 = (faiss::ivflib::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:search_and_return_centroids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_and_return_centroids" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "search_and_return_centroids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "search_and_return_centroids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "search_and_return_centroids" "', argument " "4"" of type '" "long""'"); - } - arg4 = static_cast< long >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "search_and_return_centroids" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "search_and_return_centroids" "', argument " "6"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::ivflib::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "search_and_return_centroids" "', argument " "7"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg7 = reinterpret_cast< faiss::ivflib::idx_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "search_and_return_centroids" "', argument " "8"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::ivflib::idx_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_and_return_centroids(arg1,arg2,(float const *)arg3,arg4,arg5,arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_index_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_index_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_ils_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::ArrayInvertedLists *arg2 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_ils_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_ils_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ArrayInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_ils_set" "', argument " "2"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp2); - if (arg1) (arg1)->ils = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_ils_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_ils_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_ils_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (faiss::ArrayInvertedLists *) ((arg1)->ils); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_n_slice_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_n_slice_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_n_slice_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlidingIndexWindow_n_slice_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_slice = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_n_slice_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_n_slice_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_n_slice_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (int) ((arg1)->n_slice); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_nlist_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SlidingIndexWindow_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_nlist_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_sizes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - std::vector< std::vector< size_t > > *arg2 = (std::vector< std::vector< size_t > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SlidingIndexWindow_sizes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_sizes_set" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_sizes_set" "', argument " "2"" of type '" "std::vector< std::vector< size_t > > *""'"); - } - arg2 = reinterpret_cast< std::vector< std::vector< size_t > > * >(argp2); - if (arg1) (arg1)->sizes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_sizes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< std::vector< size_t > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SlidingIndexWindow_sizes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_sizes_get" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - result = (std::vector< std::vector< size_t > > *)& ((arg1)->sizes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SlidingIndexWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ivflib::SlidingIndexWindow *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_SlidingIndexWindow",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SlidingIndexWindow" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ivflib::SlidingIndexWindow *)new faiss::ivflib::SlidingIndexWindow(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SlidingIndexWindow_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:SlidingIndexWindow_step",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SlidingIndexWindow_step" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SlidingIndexWindow_step" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SlidingIndexWindow_step" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->step((faiss::Index const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SlidingIndexWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ivflib::SlidingIndexWindow *arg1 = (faiss::ivflib::SlidingIndexWindow *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SlidingIndexWindow",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SlidingIndexWindow" "', argument " "1"" of type '" "faiss::ivflib::SlidingIndexWindow *""'"); - } - arg1 = reinterpret_cast< faiss::ivflib::SlidingIndexWindow * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SlidingIndexWindow_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_get_invlist_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - long arg2 ; - long arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ArrayInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:get_invlist_range",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_invlist_range" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_invlist_range" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "get_invlist_range" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ArrayInvertedLists *)faiss::ivflib::get_invlist_range((faiss::Index const *)arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_set_invlist_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - long arg2 ; - long arg3 ; - faiss::ArrayInvertedLists *arg4 = (faiss::ArrayInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:set_invlist_range",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_invlist_range" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "set_invlist_range" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "set_invlist_range" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_faiss__ArrayInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "set_invlist_range" "', argument " "4"" of type '" "faiss::ArrayInvertedLists *""'"); - } - arg4 = reinterpret_cast< faiss::ArrayInvertedLists * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::set_invlist_range(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_search_with_parameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::ivflib::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::ivflib::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::ivflib::idx_t *arg6 = (faiss::ivflib::idx_t *) 0 ; - faiss::IVFSearchParameters *arg7 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:search_with_parameters",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_with_parameters" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "search_with_parameters" "', argument " "2"" of type '" "faiss::ivflib::idx_t""'"); - } - arg2 = static_cast< faiss::ivflib::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "search_with_parameters" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "search_with_parameters" "', argument " "4"" of type '" "faiss::ivflib::idx_t""'"); - } - arg4 = static_cast< faiss::ivflib::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "search_with_parameters" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "search_with_parameters" "', argument " "6"" of type '" "faiss::ivflib::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::ivflib::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "search_with_parameters" "', argument " "7"" of type '" "faiss::IVFSearchParameters *""'"); - } - arg7 = reinterpret_cast< faiss::IVFSearchParameters * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::ivflib::search_with_parameters((faiss::Index const *)arg1,arg2,(float const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_qtype_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_qtype_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_qtype_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_qtype_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - if (arg1) (arg1)->qtype = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_qtype_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer::QuantizerType result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_qtype_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_qtype_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer::QuantizerType) ((arg1)->qtype); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::ScalarQuantizer::RangeStat arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_rangestat_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_rangestat_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer::RangeStat""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::RangeStat >(val2); - if (arg1) (arg1)->rangestat = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer::RangeStat result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_rangestat_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer::RangeStat) ((arg1)->rangestat); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_arg_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_rangestat_arg_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_arg_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_rangestat_arg_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->rangestat_arg = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_rangestat_arg_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_rangestat_arg_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_rangestat_arg_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (float) ((arg1)->rangestat_arg); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_d_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_d_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_trained_set" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_trained_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->trained = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_trained_get" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - result = (std::vector< float > *)& ((arg1)->trained); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - size_t val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ScalarQuantizer",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ScalarQuantizer" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ScalarQuantizer *)new faiss::ScalarQuantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ScalarQuantizer *)new faiss::ScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_ScalarQuantizer__SWIG_1(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ScalarQuantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ScalarQuantizer::ScalarQuantizer(size_t,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::ScalarQuantizer::ScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ScalarQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_train" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_train" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_compute_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - float *arg2 = (float *) 0 ; - uint8_t *arg3 = (uint8_t *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ScalarQuantizer_compute_codes",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_compute_codes" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_compute_codes" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_compute_codes" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ScalarQuantizer_compute_codes" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ScalarQuantizer const *)arg1)->compute_codes((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_decode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - float *arg3 = (float *) 0 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ScalarQuantizer_decode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_decode" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ScalarQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ScalarQuantizer_decode" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ScalarQuantizer_decode" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ScalarQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::SQDistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ScalarQuantizer_get_distance_computer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SQDistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SQDistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::SQDistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ScalarQuantizer_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::ScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::SQDistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__SQDistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ScalarQuantizer_get_distance_computer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ScalarQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ScalarQuantizer_get_distance_computer__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ScalarQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ScalarQuantizer_get_distance_computer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ScalarQuantizer_get_distance_computer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ScalarQuantizer::get_distance_computer(faiss::MetricType) const\n" - " faiss::ScalarQuantizer::get_distance_computer() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_ScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ScalarQuantizer *arg1 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ScalarQuantizer" "', argument " "1"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::ScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_sq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::ScalarQuantizer *arg2 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_sq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_sq_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexScalarQuantizer_sq_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ScalarQuantizer * >(argp2); - if (arg1) (arg1)->sq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_sq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_sq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_sq_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer *)& ((arg1)->sq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_codes_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexScalarQuantizer_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_codes_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexScalarQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - faiss::MetricType arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexScalarQuantizer",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexScalarQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexScalarQuantizer" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexScalarQuantizer",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexScalarQuantizer" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexScalarQuantizer" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexScalarQuantizer *)new faiss::IndexScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexScalarQuantizer__SWIG_2(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexScalarQuantizer__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexScalarQuantizer__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer(int,faiss::ScalarQuantizer::QuantizerType,faiss::MetricType)\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer(int,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::IndexScalarQuantizer::IndexScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_train" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_add" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexScalarQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_search" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexScalarQuantizer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexScalarQuantizer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexScalarQuantizer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reset" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexScalarQuantizer_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexScalarQuantizer_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexScalarQuantizer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexScalarQuantizer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexScalarQuantizer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexScalarQuantizer_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexScalarQuantizer_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexScalarQuantizer_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexScalarQuantizer const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexScalarQuantizer *arg1 = (faiss::IndexScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexScalarQuantizer" "', argument " "1"" of type '" "faiss::IndexScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_sq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::ScalarQuantizer *arg2 = (faiss::ScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_sq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_sq_set" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFScalarQuantizer_sq_set" "', argument " "2"" of type '" "faiss::ScalarQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ScalarQuantizer * >(argp2); - if (arg1) (arg1)->sq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_sq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFScalarQuantizer_sq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_sq_get" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - result = (faiss::ScalarQuantizer *)& ((arg1)->sq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_by_residual_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_by_residual_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_by_residual_set" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_by_residual_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->by_residual = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_by_residual_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFScalarQuantizer_by_residual_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_by_residual_get" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - result = (bool) ((arg1)->by_residual); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::ScalarQuantizer::QuantizerType arg4 ; - faiss::MetricType arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_IndexIVFScalarQuantizer",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "4"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg4 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "5"" of type '" "faiss::MetricType""'"); - } - arg5 = static_cast< faiss::MetricType >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::ScalarQuantizer::QuantizerType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFScalarQuantizer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFScalarQuantizer" "', argument " "4"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg4 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFScalarQuantizer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFScalarQuantizer *)new faiss::IndexIVFScalarQuantizer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFScalarQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_2(self, args); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFScalarQuantizer__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFScalarQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer(faiss::Index *,size_t,size_t,faiss::ScalarQuantizer::QuantizerType,faiss::MetricType)\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer(faiss::Index *,size_t,size_t,faiss::ScalarQuantizer::QuantizerType)\n" - " faiss::IndexIVFScalarQuantizer::IndexIVFScalarQuantizer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFScalarQuantizer_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFScalarQuantizer_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFScalarQuantizer_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFScalarQuantizer const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFScalarQuantizer_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFScalarQuantizer_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFScalarQuantizer const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFScalarQuantizer_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFScalarQuantizer_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFScalarQuantizer_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFScalarQuantizer const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFScalarQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFScalarQuantizer *arg1 = (faiss::IndexIVFScalarQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFScalarQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFScalarQuantizer" "', argument " "1"" of type '" "faiss::IndexIVFScalarQuantizer *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFScalarQuantizer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFScalarQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFScalarQuantizer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HNSW_assign_probas_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_assign_probas_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_assign_probas_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_assign_probas_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->assign_probas = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_assign_probas_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_assign_probas_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_assign_probas_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< double > *)& ((arg1)->assign_probas); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nneighbor_per_level_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_cum_nneighbor_per_level_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nneighbor_per_level_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_cum_nneighbor_per_level_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->cum_nneighbor_per_level = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nneighbor_per_level_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_cum_nneighbor_per_level_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nneighbor_per_level_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< int > *)& ((arg1)->cum_nneighbor_per_level); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_levels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< int > *arg2 = (std::vector< int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_levels_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_levels_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_levels_set" "', argument " "2"" of type '" "std::vector< int > *""'"); - } - arg2 = reinterpret_cast< std::vector< int > * >(argp2); - if (arg1) (arg1)->levels = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_levels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< int > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_levels_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_levels_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< int > *)& ((arg1)->levels); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_offsets_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< size_t > *arg2 = (std::vector< size_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_offsets_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_offsets_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_offsets_set" "', argument " "2"" of type '" "std::vector< size_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< size_t > * >(argp2); - if (arg1) (arg1)->offsets = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_offsets_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< size_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_offsets_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_offsets_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< size_t > *)& ((arg1)->offsets); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - std::vector< faiss::HNSW::storage_idx_t > *arg2 = (std::vector< faiss::HNSW::storage_idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_neighbors_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbors_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_neighbors_set" "', argument " "2"" of type '" "std::vector< faiss::HNSW::storage_idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::HNSW::storage_idx_t > * >(argp2); - if (arg1) (arg1)->neighbors = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::HNSW::storage_idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_neighbors_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbors_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (std::vector< faiss::HNSW::storage_idx_t > *)& ((arg1)->neighbors); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_entry_point_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::storage_idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_entry_point_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_entry_point_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_entry_point_set" "', argument " "2"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg2 = static_cast< faiss::HNSW::storage_idx_t >(val2); - if (arg1) (arg1)->entry_point = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_entry_point_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW::storage_idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_entry_point_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_entry_point_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (faiss::HNSW::storage_idx_t) ((arg1)->entry_point); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_rng_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::RandomGenerator *arg2 = (faiss::RandomGenerator *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_rng_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_rng_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_rng_set" "', argument " "2"" of type '" "faiss::RandomGenerator *""'"); - } - arg2 = reinterpret_cast< faiss::RandomGenerator * >(argp2); - if (arg1) (arg1)->rng = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_rng_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RandomGenerator *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_rng_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_rng_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (faiss::RandomGenerator *)& ((arg1)->rng); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_max_level_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_max_level_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_max_level_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_max_level_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->max_level = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_max_level_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_max_level_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_max_level_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->max_level); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efConstruction_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_efConstruction_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efConstruction_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_efConstruction_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->efConstruction = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efConstruction_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_efConstruction_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efConstruction_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->efConstruction); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efSearch_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_efSearch_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efSearch_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_efSearch_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->efSearch = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_efSearch_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_efSearch_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_efSearch_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->efSearch); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_check_relative_distance_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_check_relative_distance_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_check_relative_distance_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_check_relative_distance_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->check_relative_distance = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_check_relative_distance_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_check_relative_distance_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_check_relative_distance_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (bool) ((arg1)->check_relative_distance); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_upper_beam_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_upper_beam_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_upper_beam_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_upper_beam_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->upper_beam = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_upper_beam_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_upper_beam_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_upper_beam_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (int) ((arg1)->upper_beam); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_bounded_queue_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_search_bounded_queue_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_bounded_queue_set" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_search_bounded_queue_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->search_bounded_queue = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_bounded_queue_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_search_bounded_queue_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_bounded_queue_get" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - result = (bool) ((arg1)->search_bounded_queue); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_set_default_probas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_set_default_probas",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_set_default_probas" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_set_default_probas" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_set_default_probas" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_default_probas(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_set_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_set_nb_neighbors",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_set_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_set_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_set_nb_neighbors" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_nb_neighbors(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_nb_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->nb_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_cum_nb_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_cum_nb_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_cum_nb_neighbors" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_cum_nb_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->cum_nb_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_neighbor_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::idx_t arg2 ; - int arg3 ; - size_t *arg4 = (size_t *) 0 ; - size_t *arg5 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:HNSW_neighbor_range",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_neighbor_range" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_neighbor_range" "', argument " "2"" of type '" "faiss::HNSW::idx_t""'"); - } - arg2 = static_cast< faiss::HNSW::idx_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_neighbor_range" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_neighbor_range" "', argument " "4"" of type '" "size_t *""'"); - } - arg4 = reinterpret_cast< size_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_neighbor_range" "', argument " "5"" of type '" "size_t *""'"); - } - arg5 = reinterpret_cast< size_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->neighbor_range(arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_HNSW",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSW *)new faiss::HNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HNSW")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSW *)new faiss::HNSW(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSW(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_HNSW__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_HNSW__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HNSW'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::HNSW(int)\n" - " faiss::HNSW::HNSW()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_random_level(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_random_level",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_random_level" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->random_level(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_fill_with_random_links(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_fill_with_random_links",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_fill_with_random_links" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_fill_with_random_links" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->fill_with_random_links(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_add_links_starting_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - faiss::HNSW::storage_idx_t arg3 ; - faiss::HNSW::storage_idx_t arg4 ; - float arg5 ; - int arg6 ; - omp_lock_t *arg7 = (omp_lock_t *) 0 ; - faiss::VisitedTable *arg8 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - float val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:HNSW_add_links_starting_from",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_add_links_starting_from" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_add_links_starting_from" "', argument " "3"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg3 = static_cast< faiss::HNSW::storage_idx_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_add_links_starting_from" "', argument " "4"" of type '" "faiss::HNSW::storage_idx_t""'"); - } - arg4 = static_cast< faiss::HNSW::storage_idx_t >(val4); - ecode5 = SWIG_AsVal_float(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "HNSW_add_links_starting_from" "', argument " "5"" of type '" "float""'"); - } - arg5 = static_cast< float >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "HNSW_add_links_starting_from" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_omp_lock_t, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_add_links_starting_from" "', argument " "7"" of type '" "omp_lock_t *""'"); - } - arg7 = reinterpret_cast< omp_lock_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "HNSW_add_links_starting_from" "', argument " "8"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp8) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_links_starting_from" "', argument " "8"" of type '" "faiss::VisitedTable &""'"); - } - arg8 = reinterpret_cast< faiss::VisitedTable * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_links_starting_from(*arg2,arg3,arg4,arg5,arg6,arg7,*arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_add_with_locks(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - int arg4 ; - std::vector< omp_lock_t > *arg5 = 0 ; - faiss::VisitedTable *arg6 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:HNSW_add_with_locks",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_add_with_locks" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_add_with_locks" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_add_with_locks" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_std__vectorT_omp_lock_t_t, 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_add_with_locks" "', argument " "5"" of type '" "std::vector< omp_lock_t > &""'"); - } - if (!argp5) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "5"" of type '" "std::vector< omp_lock_t > &""'"); - } - arg5 = reinterpret_cast< std::vector< omp_lock_t > * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_add_with_locks" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - arg6 = reinterpret_cast< faiss::VisitedTable * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_locks(*arg2,arg3,arg4,*arg5,*arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::HNSW::MinimaxHeap *arg6 = 0 ; - faiss::VisitedTable *arg7 = 0 ; - int arg8 ; - int arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - int val8 ; - int ecode8 = 0 ; - int val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:HNSW_search_from_candidates",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidates" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search_from_candidates" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search_from_candidates" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidates" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - arg6 = reinterpret_cast< faiss::HNSW::MinimaxHeap * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp7) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - arg7 = reinterpret_cast< faiss::VisitedTable * >(argp7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "HNSW_search_from_candidates" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "HNSW_search_from_candidates" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->search_from_candidates(*arg2,arg3,arg4,arg5,*arg6,*arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::HNSW::MinimaxHeap *arg6 = 0 ; - faiss::VisitedTable *arg7 = 0 ; - int arg8 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - int val8 ; - int ecode8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:HNSW_search_from_candidates",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidates" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search_from_candidates" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search_from_candidates" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidates" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "6"" of type '" "faiss::HNSW::MinimaxHeap &""'"); - } - arg6 = reinterpret_cast< faiss::HNSW::MinimaxHeap * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp7) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "7"" of type '" "faiss::VisitedTable &""'"); - } - arg7 = reinterpret_cast< faiss::VisitedTable * >(argp7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "HNSW_search_from_candidates" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::HNSW const *)arg1)->search_from_candidates(*arg2,arg3,arg4,arg5,*arg6,*arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidates(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[10] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 9) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 8) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__DistanceComputer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_faiss__VisitedTable, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_search_from_candidates__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__DistanceComputer, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HNSW__MinimaxHeap, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_faiss__VisitedTable, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[7], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_search_from_candidates__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'HNSW_search_from_candidates'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::search_from_candidates(faiss::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int,int) const\n" - " faiss::HNSW::search_from_candidates(faiss::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search_from_candidate_unbounded(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::HNSW::Node *arg2 = 0 ; - faiss::DistanceComputer *arg3 = 0 ; - int arg4 ; - faiss::VisitedTable *arg5 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - std::priority_queue< faiss::HNSW::Node > result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:HNSW_search_from_candidate_unbounded",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__pairT_float_int_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); - } - arg2 = reinterpret_cast< faiss::HNSW::Node * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "3"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "3"" of type '" "faiss::DistanceComputer &""'"); - } - arg3 = reinterpret_cast< faiss::DistanceComputer * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search_from_candidate_unbounded" "', argument " "5"" of type '" "faiss::VisitedTable *""'"); - } - arg5 = reinterpret_cast< faiss::VisitedTable * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::HNSW const *)arg1)->search_from_candidate_unbounded((faiss::HNSW::Node const &)*arg2,*arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj((new std::priority_queue< faiss::HNSW::Node >(static_cast< const std::priority_queue< faiss::HNSW::Node >& >(result))), SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - faiss::DistanceComputer *arg2 = 0 ; - int arg3 ; - faiss::HNSW::idx_t *arg4 = (faiss::HNSW::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - faiss::VisitedTable *arg6 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:HNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_search" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::DistanceComputer &""'"); - } - arg2 = reinterpret_cast< faiss::DistanceComputer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_search" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "HNSW_search" "', argument " "4"" of type '" "faiss::HNSW::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::HNSW::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "HNSW_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_faiss__VisitedTable, 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "HNSW_search" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - if (!argp6) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search" "', argument " "6"" of type '" "faiss::VisitedTable &""'"); - } - arg6 = reinterpret_cast< faiss::VisitedTable * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->search(*arg2,arg3,arg4,arg5,*arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_reset" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_clear_neighbor_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_clear_neighbor_tables",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_clear_neighbor_tables" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_clear_neighbor_tables" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->clear_neighbor_tables(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_print_neighbor_stats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_print_neighbor_stats",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_print_neighbor_stats" "', argument " "1"" of type '" "faiss::HNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_print_neighbor_stats" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::HNSW const *)arg1)->print_neighbor_stats(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:HNSW_prepare_level_tab",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_prepare_level_tab" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_prepare_level_tab" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HNSW_prepare_level_tab" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->prepare_level_tab(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSW_prepare_level_tab",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_prepare_level_tab" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSW_prepare_level_tab" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->prepare_level_tab(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSW_prepare_level_tab(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_prepare_level_tab__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_HNSW_prepare_level_tab__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'HNSW_prepare_level_tab'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HNSW::prepare_level_tab(size_t,bool)\n" - " faiss::HNSW::prepare_level_tab(size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_HNSW_shrink_neighbor_list(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = 0 ; - std::priority_queue< faiss::HNSW::NodeDistFarther > *arg2 = 0 ; - std::vector< faiss::HNSW::NodeDistFarther > *arg3 = 0 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:HNSW_shrink_neighbor_list",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__DistanceComputer, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::DistanceComputer &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::DistanceComputer &""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_shrink_neighbor_list" "', argument " "2"" of type '" "std::priority_queue< faiss::HNSW::NodeDistFarther > &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "2"" of type '" "std::priority_queue< faiss::HNSW::NodeDistFarther > &""'"); - } - arg2 = reinterpret_cast< std::priority_queue< faiss::HNSW::NodeDistFarther > * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t, 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "HNSW_shrink_neighbor_list" "', argument " "3"" of type '" "std::vector< faiss::HNSW::NodeDistFarther > &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "3"" of type '" "std::vector< faiss::HNSW::NodeDistFarther > &""'"); - } - arg3 = reinterpret_cast< std::vector< faiss::HNSW::NodeDistFarther > * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_shrink_neighbor_list" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::HNSW::shrink_neighbor_list(*arg1,*arg2,*arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSW *arg1 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HNSW" "', argument " "1"" of type '" "faiss::HNSW *""'"); - } - arg1 = reinterpret_cast< faiss::HNSW * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VisitedTable_visited_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_visited_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visited_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VisitedTable_visited_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->visited = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visited_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_visited_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visited_get" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->visited); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_visno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visno_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_visno_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->visno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_visno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_visno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_visno_get" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - result = (int) ((arg1)->visno); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VisitedTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VisitedTable *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_VisitedTable",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VisitedTable" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VisitedTable *)new faiss::VisitedTable(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VisitedTable, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_set" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:VisitedTable_get",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_get" "', argument " "1"" of type '" "faiss::VisitedTable const *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VisitedTable_get" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)((faiss::VisitedTable const *)arg1)->get(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VisitedTable_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VisitedTable_advance",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisitedTable_advance" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->advance(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VisitedTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VisitedTable *arg1 = (faiss::VisitedTable *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VisitedTable",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VisitedTable, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VisitedTable" "', argument " "1"" of type '" "faiss::VisitedTable *""'"); - } - arg1 = reinterpret_cast< faiss::VisitedTable * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VisitedTable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VisitedTable, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_HNSWStats_n1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n1_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n1_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n1_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n2_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n2_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n2_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n2); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_n3_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n3_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_n3_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n3 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_n3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_n3_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_n3_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->n3); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_ndis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_ndis_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_ndis_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_ndis_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ndis = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_ndis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_ndis_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_ndis_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->ndis); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_nreorder_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_nreorder_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_nreorder_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_nreorder_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nreorder = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_nreorder_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_nreorder_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_nreorder_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (size_t) ((arg1)->nreorder); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_view_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:HNSWStats_view_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_view_set" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HNSWStats_view_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->view = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_view_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_view_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_view_get" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - result = (bool) ((arg1)->view); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_HNSWStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_HNSWStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::HNSWStats *)new faiss::HNSWStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSWStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_HNSWStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:HNSWStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSWStats_reset" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_HNSWStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HNSWStats *arg1 = (faiss::HNSWStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_HNSWStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HNSWStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HNSWStats" "', argument " "1"" of type '" "faiss::HNSWStats *""'"); - } - arg1 = reinterpret_cast< faiss::HNSWStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *HNSWStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HNSWStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_hnsw_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__HNSWStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::hnsw_stats""' of type '""faiss::HNSWStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::hnsw_stats""' of type '""faiss::HNSWStats""'"); - } else { - faiss::HNSWStats * temp; - temp = reinterpret_cast< faiss::HNSWStats * >(argp); - faiss::hnsw_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_hnsw_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::hnsw_stats), SWIGTYPE_p_faiss__HNSWStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_index_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (faiss::IndexHNSW *) &(faiss::IndexHNSW const &) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_M_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_M_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_M_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->M = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_M_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_M_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->M); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_nsq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_nsq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_nsq_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_nsq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nsq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_nsq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_nsq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_nsq_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->nsq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_code_size_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_code_size_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_reorder_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_k_reorder_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_reorder_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_k_reorder_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->k_reorder = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_k_reorder_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_k_reorder_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_k_reorder_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (int) ((arg1)->k_reorder); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codebook_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_codebook_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codebook_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_codebook_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->codebook = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codebook_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_codebook_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codebook_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (std::vector< float > *)& ((arg1)->codebook); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codes_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_codes_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_ntotal_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_ntotal_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_ntotal_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->ntotal); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_d_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_d_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_dsub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ReconstructFromNeighbors_dsub_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_dsub_set" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_dsub_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->dsub = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_dsub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ReconstructFromNeighbors_dsub_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_dsub_get" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - result = (size_t) ((arg1)->dsub); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_ReconstructFromNeighbors",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ReconstructFromNeighbors" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ReconstructFromNeighbors" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_ReconstructFromNeighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ReconstructFromNeighbors" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_ReconstructFromNeighbors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_faiss__IndexHNSW, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::IndexHNSW const &""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ReconstructFromNeighbors *)new faiss::ReconstructFromNeighbors((faiss::IndexHNSW const &)*arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ReconstructFromNeighbors(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_ReconstructFromNeighbors__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ReconstructFromNeighbors'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &,size_t,size_t)\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &,size_t)\n" - " faiss::ReconstructFromNeighbors::ReconstructFromNeighbors(faiss::IndexHNSW const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_add_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReconstructFromNeighbors_add_codes",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_add_codes" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_codes(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_compute_distances(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - size_t arg2 ; - faiss::ReconstructFromNeighbors::idx_t *arg3 = (faiss::ReconstructFromNeighbors::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ReconstructFromNeighbors_compute_distances",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::ReconstructFromNeighbors::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ReconstructFromNeighbors_compute_distances" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ReconstructFromNeighbors const *)arg1)->compute_distances(arg2,(faiss::ReconstructFromNeighbors::idx_t const *)arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_estimate_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - float *arg2 = (float *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_estimate_code",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg3 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_estimate_code" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->estimate_code((float const *)arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_reconstruct",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_reconstruct" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->reconstruct(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ReconstructFromNeighbors_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "3"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg3 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReconstructFromNeighbors_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ReconstructFromNeighbors_get_neighbor_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - faiss::ReconstructFromNeighbors::storage_idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ReconstructFromNeighbors_get_neighbor_table",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors const *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors::storage_idx_t""'"); - } - arg2 = static_cast< faiss::ReconstructFromNeighbors::storage_idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReconstructFromNeighbors_get_neighbor_table" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ReconstructFromNeighbors const *)arg1)->get_neighbor_table(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ReconstructFromNeighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ReconstructFromNeighbors *arg1 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ReconstructFromNeighbors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReconstructFromNeighbors" "', argument " "1"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg1 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ReconstructFromNeighbors_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexHNSW_hnsw_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::HNSW *arg2 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_hnsw_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_hnsw_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_hnsw_set" "', argument " "2"" of type '" "faiss::HNSW *""'"); - } - arg2 = reinterpret_cast< faiss::HNSW * >(argp2); - if (arg1) (arg1)->hnsw = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_hnsw_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_hnsw_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_hnsw_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::HNSW *)& ((arg1)->hnsw); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_own_fields_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_own_fields_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_storage_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_storage_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_storage_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->storage = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_storage_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_storage_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::Index *) ((arg1)->storage); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct_from_neighbors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::ReconstructFromNeighbors *arg2 = (faiss::ReconstructFromNeighbors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_reconstruct_from_neighbors_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct_from_neighbors_set" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ReconstructFromNeighbors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexHNSW_reconstruct_from_neighbors_set" "', argument " "2"" of type '" "faiss::ReconstructFromNeighbors *""'"); - } - arg2 = reinterpret_cast< faiss::ReconstructFromNeighbors * >(argp2); - if (arg1) (arg1)->reconstruct_from_neighbors = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct_from_neighbors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ReconstructFromNeighbors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reconstruct_from_neighbors_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct_from_neighbors_get" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - result = (faiss::ReconstructFromNeighbors *) ((arg1)->reconstruct_from_neighbors); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ReconstructFromNeighbors, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSW" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSW const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_add" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_train" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexHNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSW_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reconstruct" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reset" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_shrink_level_0_neighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexHNSW_shrink_level_0_neighbors",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_shrink_level_0_neighbors" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_shrink_level_0_neighbors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->shrink_level_0_neighbors(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - int arg9 ; - int arg10 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - int val9 ; - int ecode9 = 0 ; - int val10 ; - int ecode10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexHNSW_search_level_0" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - ecode10 = SWIG_AsVal_int(obj9, &val10); - if (!SWIG_IsOK(ecode10)) { - SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "IndexHNSW_search_level_0" "', argument " "10"" of type '" "int""'"); - } - arg10 = static_cast< int >(val10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - int arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - int val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_int(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexHNSW_search_level_0" "', argument " "9"" of type '" "int""'"); - } - arg9 = static_cast< int >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::IndexHNSW::storage_idx_t *arg5 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:IndexHNSW_search_level_0",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_search_level_0" "', argument " "1"" of type '" "faiss::IndexHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_search_level_0" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_search_level_0" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW_search_level_0" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW_search_level_0" "', argument " "5"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW_search_level_0" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexHNSW_search_level_0" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexHNSW_search_level_0" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW const *)arg1)->search_level_0(arg2,(float const *)arg3,arg4,(faiss::IndexHNSW::storage_idx_t const *)arg5,(float const *)arg6,arg7,arg8); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_search_level_0(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 8) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_2(self, args); - } - } - } - } - } - } - } - } - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexHNSW, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[9], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexHNSW_search_level_0__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexHNSW_search_level_0'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *,int,int) const\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *,int) const\n" - " faiss::IndexHNSW::search_level_0(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::IndexHNSW::storage_idx_t const *,float const *,float *,faiss::Index::idx_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_init_level_0_from_knngraph(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexHNSW_init_level_0_from_knngraph",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexHNSW_init_level_0_from_knngraph" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init_level_0_from_knngraph(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_init_level_0_from_entry_points(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - int arg2 ; - faiss::IndexHNSW::storage_idx_t *arg3 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - faiss::IndexHNSW::storage_idx_t *arg4 = (faiss::IndexHNSW::storage_idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexHNSW_init_level_0_from_entry_points",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "3"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexHNSW_init_level_0_from_entry_points" "', argument " "4"" of type '" "faiss::IndexHNSW::storage_idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexHNSW::storage_idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->init_level_0_from_entry_points(arg2,(faiss::IndexHNSW::storage_idx_t const *)arg3,(faiss::IndexHNSW::storage_idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_reorder_links(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_reorder_links",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_reorder_links" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reorder_links(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW_link_singletons(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW *arg1 = (faiss::IndexHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW_link_singletons",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW_link_singletons" "', argument " "1"" of type '" "faiss::IndexHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->link_singletons(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWFlat *)new faiss::IndexHNSWFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexHNSWFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexHNSWFlat",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWFlat" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWFlat" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWFlat *)new faiss::IndexHNSWFlat(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWFlat__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWFlat__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWFlat::IndexHNSWFlat()\n" - " faiss::IndexHNSWFlat::IndexHNSWFlat(int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWFlat_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *arg1 = (faiss::IndexHNSWFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWFlat_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWFlat_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWFlat const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWFlat *arg1 = (faiss::IndexHNSWFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWFlat" "', argument " "1"" of type '" "faiss::IndexHNSWFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWPQ *)new faiss::IndexHNSWPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexHNSWPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexHNSWPQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWPQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWPQ" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSWPQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWPQ *)new faiss::IndexHNSWPQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWPQ__SWIG_0(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWPQ__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWPQ::IndexHNSWPQ()\n" - " faiss::IndexHNSWPQ::IndexHNSWPQ(int,int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWPQ_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexHNSWPQ_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWPQ_train" "', argument " "1"" of type '" "faiss::IndexHNSWPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSWPQ_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSWPQ_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWPQ_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWPQ_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWPQ_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWPQ const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWPQ *arg1 = (faiss::IndexHNSWPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWPQ" "', argument " "1"" of type '" "faiss::IndexHNSWPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSWSQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWSQ *)new faiss::IndexHNSWSQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - faiss::ScalarQuantizer::QuantizerType arg2 ; - int arg3 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexHNSWSQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexHNSWSQ",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexHNSWSQ" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSWSQ" "', argument " "2"" of type '" "faiss::ScalarQuantizer::QuantizerType""'"); - } - arg2 = static_cast< faiss::ScalarQuantizer::QuantizerType >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSWSQ" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSWSQ *)new faiss::IndexHNSWSQ(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSWSQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSWSQ__SWIG_0(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSWSQ__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSWSQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSWSQ::IndexHNSWSQ()\n" - " faiss::IndexHNSWSQ::IndexHNSWSQ(int,faiss::ScalarQuantizer::QuantizerType,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSWSQ_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *arg1 = (faiss::IndexHNSWSQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSWSQ_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWSQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSWSQ_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSWSQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWSQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSWSQ const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSWSQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSWSQ *arg1 = (faiss::IndexHNSWSQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSWSQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSWSQ" "', argument " "1"" of type '" "faiss::IndexHNSWSQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSWSQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSWSQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSWSQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexHNSW2Level")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSW2Level *)new faiss::IndexHNSW2Level(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexHNSW2Level *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexHNSW2Level",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexHNSW2Level" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexHNSW2Level" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexHNSW2Level" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexHNSW2Level" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexHNSW2Level *)new faiss::IndexHNSW2Level(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexHNSW2Level(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexHNSW2Level__SWIG_0(self, args); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexHNSW2Level__SWIG_1(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexHNSW2Level'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexHNSW2Level::IndexHNSW2Level()\n" - " faiss::IndexHNSW2Level::IndexHNSW2Level(faiss::Index *,size_t,int,int)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW2Level_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexHNSW2Level const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexHNSW2Level const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_flip_to_ivf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexHNSW2Level_flip_to_ivf",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_flip_to_ivf" "', argument " "1"" of type '" "faiss::IndexHNSW2Level *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->flip_to_ivf(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexHNSW2Level_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexHNSW2Level_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexHNSW2Level_search" "', argument " "1"" of type '" "faiss::IndexHNSW2Level const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexHNSW2Level_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexHNSW2Level_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexHNSW2Level_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexHNSW2Level_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexHNSW2Level_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexHNSW2Level const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexHNSW2Level(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexHNSW2Level *arg1 = (faiss::IndexHNSW2Level *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexHNSW2Level",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexHNSW2Level" "', argument " "1"" of type '" "faiss::IndexHNSW2Level *""'"); - } - arg1 = reinterpret_cast< faiss::IndexHNSW2Level * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexHNSW2Level_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexHNSW2Level, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFFlat",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlat" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFFlat" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexIVFFlat",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlat" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlat" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_add_core(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlat_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_add_core" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlat_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlat_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlat_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlat const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlat_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFFlat const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_update_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - int arg2 ; - faiss::Index::idx_t *arg3 = (faiss::Index::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_update_vectors",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_update_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_update_vectors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlat_update_vectors" "', argument " "3"" of type '" "faiss::Index::idx_t *""'"); - } - arg3 = reinterpret_cast< faiss::Index::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_update_vectors" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_vectors(arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlat_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlat_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlat_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlat const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlat *)new faiss::IndexIVFFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFFlat__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlat__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlat__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlat::IndexIVFFlat(faiss::Index *,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexIVFFlat::IndexIVFFlat(faiss::Index *,size_t,size_t)\n" - " faiss::IndexIVFFlat::IndexIVFFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFFlat" "', argument " "1"" of type '" "faiss::IndexIVFFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_instances_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlatDedup_instances_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_multimapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "2"" of type '" "std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFFlatDedup_instances_set" "', argument " "2"" of type '" "std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } else { - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > * temp = reinterpret_cast< std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->instances = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_instances_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFFlatDedup_instances_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_instances_get" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - result = ((arg1)->instances); - resultobj = SWIG_NewPointerObj((new std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >(static_cast< const std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t >& >(result))), SWIGTYPE_p_std__unordered_multimapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_IndexIVFFlatDedup",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlatDedup" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlatDedup" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFFlatDedup" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexIVFFlatDedup",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFFlatDedup" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFFlatDedup" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFFlatDedup_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_train" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVFFlatDedup_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVFFlatDedup_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFFlatDedup_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFFlatDedup_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFFlatDedup_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFFlatDedup_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlatDedup::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVFFlatDedup::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFFlatDedup_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFFlatDedup_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFFlatDedup_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFFlatDedup_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_update_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - int arg2 ; - faiss::Index::idx_t *arg3 = (faiss::Index::idx_t *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_update_vectors",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "3"" of type '" "faiss::Index::idx_t *""'"); - } - arg3 = reinterpret_cast< faiss::Index::idx_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_update_vectors" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_vectors(arg2,arg3,(float const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFFlatDedup_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFFlatDedup_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFFlatDedup_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFFlatDedup const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFFlatDedup")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFFlatDedup *)new faiss::IndexIVFFlatDedup(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFFlatDedup(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFFlatDedup__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlatDedup__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFFlatDedup__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFFlatDedup'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup(faiss::Index *,size_t,size_t,faiss::MetricType)\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup(faiss::Index *,size_t,size_t)\n" - " faiss::IndexIVFFlatDedup::IndexIVFFlatDedup()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFFlatDedup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFFlatDedup *arg1 = (faiss::IndexIVFFlatDedup *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFFlatDedup",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFFlatDedup" "', argument " "1"" of type '" "faiss::IndexIVFFlatDedup *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFFlatDedup * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFFlatDedup_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFFlatDedup, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_lists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::vector< faiss::OnDiskInvertedLists::List > *arg2 = (std::vector< faiss::OnDiskInvertedLists::List > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_lists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_lists_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_lists_set" "', argument " "2"" of type '" "std::vector< faiss::OnDiskInvertedLists::List > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OnDiskInvertedLists::List > * >(argp2); - if (arg1) (arg1)->lists = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_lists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OnDiskInvertedLists::List > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_lists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_lists_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::vector< faiss::OnDiskInvertedLists::List > *)& ((arg1)->lists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_slots_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::list< faiss::OnDiskInvertedLists::Slot > *arg2 = (std::list< faiss::OnDiskInvertedLists::Slot > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_slots_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_slots_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_slots_set" "', argument " "2"" of type '" "std::list< faiss::OnDiskInvertedLists::Slot > *""'"); - } - arg2 = reinterpret_cast< std::list< faiss::OnDiskInvertedLists::Slot > * >(argp2); - if (arg1) (arg1)->slots = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_slots_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::list< faiss::OnDiskInvertedLists::Slot > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_slots_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_slots_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::list< faiss::OnDiskInvertedLists::Slot > *)& ((arg1)->slots); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_filename_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_filename_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_filename_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_filename_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OnDiskInvertedLists_filename_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->filename = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_filename_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_filename_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_filename_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (std::string *) & ((arg1)->filename); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_totsize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_totsize_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_totsize_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_totsize_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->totsize = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_totsize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_totsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_totsize_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (size_t) ((arg1)->totsize); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_ptr_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_ptr_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_ptr_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_ptr_set" "', argument " "2"" of type '" "uint8_t *""'"); - } - arg2 = reinterpret_cast< uint8_t * >(argp2); - if (arg1) (arg1)->ptr = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_ptr_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_ptr_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_ptr_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (uint8_t *) ((arg1)->ptr); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_read_only_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_read_only_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_read_only_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_read_only_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->read_only = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_read_only_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_read_only_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_read_only_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (bool) ((arg1)->read_only); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - char *arg3 = (char *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::OnDiskInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_OnDiskInvertedLists",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OnDiskInvertedLists" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OnDiskInvertedLists" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_OnDiskInvertedLists" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OnDiskInvertedLists *)new faiss::OnDiskInvertedLists(arg1,arg2,(char const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_NEW | 0 ); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_list_size" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::OnDiskInvertedLists const *)arg1)->list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_get_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - uint8_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_get_codes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_get_codes" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_get_codes" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (uint8_t *)((faiss::OnDiskInvertedLists const *)arg1)->get_codes(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_get_ids" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists::idx_t *)((faiss::OnDiskInvertedLists const *)arg1)->get_ids(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_add_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::InvertedLists::idx_t *arg4 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:OnDiskInvertedLists_add_entries",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "4"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "OnDiskInvertedLists_add_entries" "', argument " "5"" of type '" "uint8_t const *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->add_entries(arg2,arg3,(faiss::InvertedLists::idx_t const *)arg4,(uint8_t const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_update_entries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - faiss::InvertedLists::idx_t *arg5 = (faiss::InvertedLists::idx_t *) 0 ; - uint8_t *arg6 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:OnDiskInvertedLists_update_entries",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "5"" of type '" "faiss::InvertedLists::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::InvertedLists::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "OnDiskInvertedLists_update_entries" "', argument " "6"" of type '" "uint8_t const *""'"); - } - arg6 = reinterpret_cast< uint8_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_entries(arg2,arg3,arg4,(faiss::InvertedLists::idx_t const *)arg5,(uint8_t const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_resize" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_resize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_resize" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::InvertedLists **arg2 = (faiss::InvertedLists **) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "2"" of type '" "faiss::InvertedLists const **""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists ** >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_merge_from" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->merge_from((faiss::InvertedLists const **)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_prefetch_lists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - long *arg2 = (long *) 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_prefetch_lists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "2"" of type '" "long const *""'"); - } - arg2 = reinterpret_cast< long * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_prefetch_lists" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OnDiskInvertedLists const *)arg1)->prefetch_lists((long const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OnDiskInvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OnDiskInvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OnDiskInvertedLists" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_locks_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::LockLevels *arg2 = (faiss::LockLevels *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_locks_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_locks_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__LockLevels, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_locks_set" "', argument " "2"" of type '" "faiss::LockLevels *""'"); - } - arg2 = reinterpret_cast< faiss::LockLevels * >(argp2); - if (arg1) (arg1)->locks = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_locks_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::LockLevels *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_locks_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_locks_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (faiss::LockLevels *) ((arg1)->locks); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LockLevels, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_pf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - faiss::OnDiskInvertedLists::OngoingPrefetch *arg2 = (faiss::OnDiskInvertedLists::OngoingPrefetch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_pf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_pf_set" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OnDiskInvertedLists_pf_set" "', argument " "2"" of type '" "faiss::OnDiskInvertedLists::OngoingPrefetch *""'"); - } - arg2 = reinterpret_cast< faiss::OnDiskInvertedLists::OngoingPrefetch * >(argp2); - if (arg1) (arg1)->pf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_pf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::OnDiskInvertedLists::OngoingPrefetch *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_pf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_pf_get" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - result = (faiss::OnDiskInvertedLists::OngoingPrefetch *) ((arg1)->pf); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_do_mmap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OnDiskInvertedLists_do_mmap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_do_mmap" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->do_mmap(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_update_totsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_update_totsize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_update_totsize" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_update_totsize" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->update_totsize(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_resize_locked(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_resize_locked",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_resize_locked" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->resize_locked(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_allocate_slot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OnDiskInvertedLists_allocate_slot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_allocate_slot" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_allocate_slot" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)(arg1)->allocate_slot(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OnDiskInvertedLists_free_slot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *arg1 = (faiss::OnDiskInvertedLists *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OnDiskInvertedLists_free_slot",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OnDiskInvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "1"" of type '" "faiss::OnDiskInvertedLists *""'"); - } - arg1 = reinterpret_cast< faiss::OnDiskInvertedLists * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OnDiskInvertedLists_free_slot" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->free_slot(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OnDiskInvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OnDiskInvertedLists")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OnDiskInvertedLists *)new faiss::OnDiskInvertedLists(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OnDiskInvertedLists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_OnDiskInvertedLists__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_OnDiskInvertedLists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_OnDiskInvertedLists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OnDiskInvertedLists::OnDiskInvertedLists(size_t,size_t,char const *)\n" - " faiss::OnDiskInvertedLists::OnDiskInvertedLists()\n"); - return 0; -} - - -SWIGINTERN PyObject *OnDiskInvertedLists_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OnDiskInvertedLists, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_scan_table_threshold_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFPQSearchParameters_scan_table_threshold_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_scan_table_threshold_set" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFPQSearchParameters_scan_table_threshold_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->scan_table_threshold = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_scan_table_threshold_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFPQSearchParameters_scan_table_threshold_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_scan_table_threshold_get" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - result = (size_t) ((arg1)->scan_table_threshold); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IVFPQSearchParameters_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IVFPQSearchParameters_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IVFPQSearchParameters_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IVFPQSearchParameters_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVFPQSearchParameters_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IVFPQSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *arg1 = (faiss::IVFPQSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IVFPQSearchParameters",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVFPQSearchParameters" "', argument " "1"" of type '" "faiss::IVFPQSearchParameters *""'"); - } - arg1 = reinterpret_cast< faiss::IVFPQSearchParameters * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IVFPQSearchParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IVFPQSearchParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IVFPQSearchParameters")) SWIG_fail; - result = (faiss::IVFPQSearchParameters *)new faiss::IVFPQSearchParameters(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IVFPQSearchParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IVFPQSearchParameters, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_by_residual_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_by_residual_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_by_residual_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_by_residual_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->by_residual = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_by_residual_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_by_residual_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_by_residual_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (bool) ((arg1)->by_residual); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_pq_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_pq_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_do_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_do_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_do_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_do_polysemous_training_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->do_polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_do_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_do_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_do_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (bool) ((arg1)->do_polysemous_training); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_training_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::PolysemousTraining *arg2 = (faiss::PolysemousTraining *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_polysemous_training_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_training_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__PolysemousTraining, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_polysemous_training_set" "', argument " "2"" of type '" "faiss::PolysemousTraining *""'"); - } - arg2 = reinterpret_cast< faiss::PolysemousTraining * >(argp2); - if (arg1) (arg1)->polysemous_training = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_training_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::PolysemousTraining *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_polysemous_training_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_training_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (faiss::PolysemousTraining *) ((arg1)->polysemous_training); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PolysemousTraining, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_scan_table_threshold_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_scan_table_threshold_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_scan_table_threshold_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_scan_table_threshold_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->scan_table_threshold = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_scan_table_threshold_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_scan_table_threshold_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_scan_table_threshold_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (size_t) ((arg1)->scan_table_threshold); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_ht_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_polysemous_ht_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_ht_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_polysemous_ht_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->polysemous_ht = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_polysemous_ht_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_polysemous_ht_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_polysemous_ht_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (int) ((arg1)->polysemous_ht); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_use_precomputed_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_use_precomputed_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_use_precomputed_table_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_use_precomputed_table_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->use_precomputed_table = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_use_precomputed_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_use_precomputed_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_use_precomputed_table_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (int) ((arg1)->use_precomputed_table); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN int Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set(PyObject *_val) { - { - size_t val; - int res = SWIG_AsVal_size_t(_val, &val); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::IndexIVFPQ::precomputed_table_max_bytes""' of type '""size_t""'"); - } - faiss::IndexIVFPQ::precomputed_table_max_bytes = static_cast< size_t >(val); - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_size_t(static_cast< size_t >(faiss::IndexIVFPQ::precomputed_table_max_bytes)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_max_bytes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(args)) { - return Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get(); -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_max_bytes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - int res; - PyObject *value; - - if (!PyArg_ParseTuple(args,(char *)"O:set",&value)) return NULL; - res = Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set(value); - return !res ? SWIG_Py_Void() : NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_precomputed_table_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precomputed_table_set" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_precomputed_table_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->precomputed_table = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precomputed_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_precomputed_table_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precomputed_table_get" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - result = (std::vector< float > *)& ((arg1)->precomputed_table); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - faiss::IndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_IndexIVFPQ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFPQ" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFPQ" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFPQ" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFPQ" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFPQ" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQ *)new faiss::IndexIVFPQ(arg1,arg2,arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_add_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_with_ids__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_with_ids__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_add_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *,long const *)\n" - " faiss::IndexIVFPQ::add_with_ids(faiss::Index::idx_t,float const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_vectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t *arg4 = (faiss::Index::idx_t *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_encode_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "4"" of type '" "faiss::Index::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_vectors" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_vectors(arg2,(float const *)arg3,(faiss::Index::idx_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - float *arg5 = (float *) 0 ; - long *arg6 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 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 * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVFPQ_add_core_o",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_core_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_core_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_core_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_core_o" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_add_core_o" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQ_add_core_o" "', argument " "6"" of type '" "long const *""'"); - } - arg6 = reinterpret_cast< long * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core_o(arg2,(float const *)arg3,(long const *)arg4,arg5,(long const *)arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_add_core_o",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_add_core_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_add_core_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_add_core_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_add_core_o" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_add_core_o" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core_o(arg2,(float const *)arg3,(long const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_add_core_o(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_core_o__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_add_core_o__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_add_core_o'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::add_core_o(faiss::Index::idx_t,float const *,long const *,float *,long const *)\n" - " faiss::IndexIVFPQ::add_core_o(faiss::Index::idx_t,float const *,long const *,float *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_train_residual_o(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_train_residual_o",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_train_residual_o" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual_o(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_find_duplicates(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - faiss::Index::idx_t *arg2 = (faiss::Index::idx_t *) 0 ; - size_t *arg3 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQ_find_duplicates",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "2"" of type '" "faiss::Index::idx_t *""'"); - } - arg2 = reinterpret_cast< faiss::Index::idx_t * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_find_duplicates" "', argument " "3"" of type '" "size_t *""'"); - } - arg3 = reinterpret_cast< size_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexIVFPQ const *)arg1)->find_duplicates(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - long arg2 ; - float *arg3 = (float *) 0 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQ_encode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode(arg2,(float const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - bool arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - bool val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIVFPQ_encode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - ecode6 = SWIG_AsVal_bool(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "6"" of type '" "bool""'"); - } - arg6 = static_cast< bool >(val6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_multiple(arg2,arg3,(float const *)arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - float *arg4 = (float *) 0 ; - uint8_t *arg5 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_encode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "3"" of type '" "long *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_encode_multiple" "', argument " "5"" of type '" "uint8_t *""'"); - } - arg5 = reinterpret_cast< uint8_t * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->encode_multiple(arg2,arg3,(float const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_encode_multiple(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQ_encode_multiple__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQ, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFPQ_encode_multiple__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQ_encode_multiple'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::encode_multiple(size_t,long *,float const *,uint8_t *,bool) const\n" - " faiss::IndexIVFPQ::encode_multiple(size_t,long *,float const *,uint8_t *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_decode_multiple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - uint8_t *arg4 = (uint8_t *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQ_decode_multiple",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "4"" of type '" "uint8_t const *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQ_decode_multiple" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQ const *)arg1)->decode_multiple(arg2,(long const *)arg3,(uint8_t const *)arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_get_InvertedListScanner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQ_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexIVFPQ const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQ_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedListScanner *)((faiss::IndexIVFPQ const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQ_precompute_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQ_precompute_table",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQ_precompute_table" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->precompute_table(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQ")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQ *)new faiss::IndexIVFPQ(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQ(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFPQ__SWIG_1(self, args); - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFPQ__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFPQ'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQ::IndexIVFPQ(faiss::Index *,size_t,size_t,size_t,size_t)\n" - " faiss::IndexIVFPQ::IndexIVFPQ()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQ *arg1 = (faiss::IndexIVFPQ *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQ",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQ" "', argument " "1"" of type '" "faiss::IndexIVFPQ *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQ * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQ_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQ, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_nrefine_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_nrefine_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_nrefine_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_nrefine_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nrefine = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_nrefine_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_nrefine_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_nrefine_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->nrefine); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_n_hamming_pass_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_n_hamming_pass_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_n_hamming_pass_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_n_hamming_pass_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_hamming_pass = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_n_hamming_pass_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_n_hamming_pass_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_n_hamming_pass_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->n_hamming_pass); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_search_cycles_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_search_cycles_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_search_cycles_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_search_cycles_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->search_cycles = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_search_cycles_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_search_cycles_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_search_cycles_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->search_cycles); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_refine_cycles_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQStats_refine_cycles_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_refine_cycles_set" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQStats_refine_cycles_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->refine_cycles = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_refine_cycles_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_refine_cycles_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_refine_cycles_get" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - result = (size_t) ((arg1)->refine_cycles); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQStats")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQStats *)new faiss::IndexIVFPQStats(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQStats_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQStats_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQStats_reset" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQStats *arg1 = (faiss::IndexIVFPQStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQStats" "', argument " "1"" of type '" "faiss::IndexIVFPQStats *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_indexIVFPQ_stats_set(PyObject *_val) { - { - void *argp = 0; - int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_faiss__IndexIVFPQStats, 0 | 0); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::indexIVFPQ_stats""' of type '""faiss::IndexIVFPQStats""'"); - } - if (!argp) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""faiss::indexIVFPQ_stats""' of type '""faiss::IndexIVFPQStats""'"); - } else { - faiss::IndexIVFPQStats * temp; - temp = reinterpret_cast< faiss::IndexIVFPQStats * >(argp); - faiss::indexIVFPQ_stats = *temp; - if (SWIG_IsNewObj(res)) delete temp; - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_indexIVFPQ_stats_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(&faiss::indexIVFPQ_stats), SWIGTYPE_p_faiss__IndexIVFPQStats, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_refine_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_pq_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_refine_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->refine_pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_refine_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_pq_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->refine_pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_refine_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_codes_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_refine_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->refine_codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_refine_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_refine_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_refine_codes_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->refine_codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_k_factor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_k_factor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_k_factor_set" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_k_factor_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->k_factor = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_k_factor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_k_factor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_k_factor_get" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - result = (float) ((arg1)->k_factor); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - size_t arg3 ; - size_t arg4 ; - size_t arg5 ; - size_t arg6 ; - size_t arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - size_t val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - faiss::IndexIVFPQR *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_IndexIVFPQR",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIVFPQR" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexIVFPQR" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexIVFPQR" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_IndexIVFPQR" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_IndexIVFPQR" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_IndexIVFPQR" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_size_t(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_IndexIVFPQR" "', argument " "7"" of type '" "size_t""'"); - } - arg7 = static_cast< size_t >(val7); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQR *)new faiss::IndexIVFPQR(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIVFPQR_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_reset" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIVFPQR_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_remove_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFPQR_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_train_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQR_train_residual",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_train_residual" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_train_residual" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_train_residual" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train_residual(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIVFPQR_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_core" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_add_core",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_add_core" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_add_core" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_add_core" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_add_core(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_add_core__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_add_core__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQR_add_core'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::add_core(faiss::Index::idx_t,float const *,long const *,long const *)\n" - " faiss::IndexIVFPQR::add_core(faiss::Index::idx_t,float const *,long const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - long arg2 ; - long arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIVFPQR_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIVFPQR_reconstruct_from_offset" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::IndexIVF *arg2 = 0 ; - faiss::Index::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIVFPQR_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_merge_from" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIVFPQR_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIVFPQR_merge_from" "', argument " "2"" of type '" "faiss::IndexIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexIVFPQR_merge_from" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexIVFPQR_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - faiss::Index::idx_t *arg5 = (faiss::Index::idx_t *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - faiss::Index::idx_t *arg8 = (faiss::Index::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexIVFPQR_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "1"" of type '" "faiss::IndexIVFPQR const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "5"" of type '" "faiss::Index::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::Index::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "6"" of type '" "float const *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "8"" of type '" "faiss::Index::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::Index::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexIVFPQR_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIVFPQR const *)arg1)->search_preassigned(arg2,(float const *)arg3,arg4,(faiss::Index::idx_t const *)arg5,(float const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIVFPQR_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexIVFPQR_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexIVFPQR, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexIVFPQR_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexIVFPQR_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexIVFPQR::search_preassigned(faiss::Index::idx_t,float const *,faiss::Index::idx_t,faiss::Index::idx_t const *,float const *,float *,faiss::Index::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIVFPQR")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVFPQR *)new faiss::IndexIVFPQR(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIVFPQR(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIVFPQR__SWIG_1(self, args); - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexIVFPQR__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIVFPQR'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIVFPQR::IndexIVFPQR(faiss::Index *,size_t,size_t,size_t,size_t,size_t,size_t)\n" - " faiss::IndexIVFPQR::IndexIVFPQR()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIVFPQR(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIVFPQR *arg1 = (faiss::IndexIVFPQR *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIVFPQR",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIVFPQR" "', argument " "1"" of type '" "faiss::IndexIVFPQR *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIVFPQR * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexIVFPQR_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIVFPQR, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Index2Layer_q1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Level1Quantizer *arg2 = (faiss::Level1Quantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_q1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_q1_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_q1_set" "', argument " "2"" of type '" "faiss::Level1Quantizer *""'"); - } - arg2 = reinterpret_cast< faiss::Level1Quantizer * >(argp2); - if (arg1) (arg1)->q1 = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_q1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Level1Quantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_q1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_q1_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (faiss::Level1Quantizer *)& ((arg1)->q1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Level1Quantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::ProductQuantizer *arg2 = (faiss::ProductQuantizer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_pq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_pq_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'"); - } - arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2); - if (arg1) (arg1)->pq = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_pq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_pq_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (faiss::ProductQuantizer *)& ((arg1)->pq); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_codes_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_codes_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->codes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_codes_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->codes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_1_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_1_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_1_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size_1 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_1_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_1_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size_1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_2_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_2_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size_2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_2_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size_2); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_set" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_code_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_code_size_get" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - result = (size_t) ((arg1)->code_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - faiss::MetricType arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Index2Layer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Index2Layer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Index2Layer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Index2Layer" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Index2Layer" "', argument " "4"" of type '" "faiss::MetricType""'"); - } - arg4 = static_cast< faiss::MetricType >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(arg1,arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - size_t arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_Index2Layer",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Index2Layer" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Index2Layer" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Index2Layer" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Index2Layer")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index2Layer *)new faiss::Index2Layer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Index2Layer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[5] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 4) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Index2Layer__SWIG_2(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Index2Layer__SWIG_1(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Index2Layer__SWIG_0(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Index2Layer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::Index2Layer::Index2Layer(faiss::Index *,size_t,int,faiss::MetricType)\n" - " faiss::Index2Layer::Index2Layer(faiss::Index *,size_t,int)\n" - " faiss::Index2Layer::Index2Layer()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_Index2Layer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Index2Layer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Index2Layer" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_train" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_add" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Index2Layer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_search" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index2Layer_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index2Layer_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index2Layer_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - faiss::Index::idx_t arg3 ; - float *arg4 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Index2Layer_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reconstruct_n" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Index2Layer_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'"); - } - arg3 = static_cast< faiss::Index::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index2Layer_reconstruct_n" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Index2Layer_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reconstruct" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index2Layer_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index2Layer_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Index2Layer_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_reset" "', argument " "1"" of type '" "faiss::Index2Layer *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Index2Layer_transfer_to_IVFPQ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index2Layer *arg1 = (faiss::Index2Layer *) 0 ; - faiss::IndexIVFPQ *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Index2Layer_transfer_to_IVFPQ",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index2Layer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "1"" of type '" "faiss::Index2Layer const *""'"); - } - arg1 = reinterpret_cast< faiss::Index2Layer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexIVFPQ, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Index2Layer_transfer_to_IVFPQ" "', argument " "2"" of type '" "faiss::IndexIVFPQ &""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVFPQ * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::Index2Layer const *)arg1)->transfer_to_IVFPQ(*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Index2Layer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Index2Layer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinary_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_d_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_d_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_d_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (int) ((arg1)->d); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_code_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_code_size_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_code_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->code_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_code_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_code_size_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (int) ((arg1)->code_size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_ntotal_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_ntotal_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_ntotal_set" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - if (arg1) (arg1)->ntotal = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_ntotal_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_ntotal_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (faiss::IndexBinary::idx_t) ((arg1)->ntotal); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_verbose_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_verbose_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_verbose_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (bool) ((arg1)->verbose); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_is_trained_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_is_trained_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_is_trained_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_trained = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_is_trained_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_is_trained_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (bool) ((arg1)->is_trained); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_metric_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::MetricType arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_metric_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_metric_type_set" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_metric_type_set" "', argument " "2"" of type '" "faiss::MetricType""'"); - } - arg2 = static_cast< faiss::MetricType >(val2); - if (arg1) (arg1)->metric_type = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_metric_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::MetricType result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_metric_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_metric_type_get" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - result = (faiss::MetricType) ((arg1)->metric_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinary" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_train" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_add" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_add_with_ids" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_add_with_ids" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_add_with_ids" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(uint8_t const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinary_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_search" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinary_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - int arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinary_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_range_search" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_range_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_range_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_range_search" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->range_search(arg2,(uint8_t const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t *arg4 = (faiss::IndexBinary::idx_t *) 0 ; - faiss::IndexBinary::idx_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinary_assign",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_assign" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_assign" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_assign" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_assign" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IndexBinary_assign" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg5 = static_cast< faiss::IndexBinary::idx_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(uint8_t const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t *arg4 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_assign",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_assign" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_assign" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_assign" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_assign" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->assign(arg2,(uint8_t const *)arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_assign(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinary_assign__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinary_assign__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinary_assign'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinary::assign(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t *,faiss::IndexBinary::idx_t)\n" - " faiss::IndexBinary::assign(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reset" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinary_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinary_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinary_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinary_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - faiss::IndexBinary::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinary_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_reconstruct_n" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinary_reconstruct_n" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinary_reconstruct_n" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - uint8_t *arg7 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexBinary_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinary_search_and_reconstruct" "', argument " "7"" of type '" "uint8_t *""'"); - } - arg7 = reinterpret_cast< uint8_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->search_and_reconstruct(arg2,(uint8_t const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinary_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinary_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinary_display" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinary const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinary_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinary, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_xb_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_xb_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_xb_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFlat_xb_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->xb = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_xb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_xb_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_xb_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->xb); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_use_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_use_heap_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_use_heap_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_use_heap_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->use_heap = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_use_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_use_heap_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_use_heap_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (bool) ((arg1)->use_heap); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_query_batch_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_query_batch_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_query_batch_size_set" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_query_batch_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->query_batch_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_query_batch_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_query_batch_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_query_batch_size_get" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - result = (size_t) ((arg1)->query_batch_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryFlat",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryFlat" "', argument " "1"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg1 = static_cast< faiss::IndexBinary::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFlat *)new faiss::IndexBinaryFlat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFlat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_add" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFlat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_reset" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_search" "', argument " "1"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryFlat_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryFlat_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryFlat_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFlat const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFlat_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryFlat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFlat_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFlat const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFlat_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFlat_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFlat_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryFlat_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryFlat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFlat *)new faiss::IndexBinaryFlat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFlat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryFlat__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryFlat__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryFlat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryFlat::IndexBinaryFlat(faiss::IndexBinary::idx_t)\n" - " faiss::IndexBinaryFlat::IndexBinaryFlat()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryFlat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFlat *arg1 = (faiss::IndexBinaryFlat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryFlat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryFlat" "', argument " "1"" of type '" "faiss::IndexBinaryFlat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFlat * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryFlat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryFlat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_invlists_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_invlists_set" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - if (arg1) (arg1)->invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_invlists_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::InvertedLists *) ((arg1)->invlists); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_invlists_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_own_invlists_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_invlists_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_own_invlists_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_invlists = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_invlists_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_own_invlists_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_invlists_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->own_invlists); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nprobe_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_nprobe_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nprobe_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_nprobe_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nprobe = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nprobe_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_nprobe_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nprobe_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->nprobe); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_max_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_max_codes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_max_codes_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_max_codes_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->max_codes = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_max_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_max_codes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_max_codes_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->max_codes); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_use_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_use_heap_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_use_heap_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_use_heap_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->use_heap = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_use_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_use_heap_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_use_heap_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->use_heap); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_maintain_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_maintain_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_maintain_direct_map_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_maintain_direct_map_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->maintain_direct_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_maintain_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_maintain_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_maintain_direct_map_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->maintain_direct_map); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_direct_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_direct_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_direct_map_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_direct_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->direct_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_direct_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_direct_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_direct_map_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (std::vector< long > *)& ((arg1)->direct_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_quantizer_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_quantizer_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_quantizer_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_quantizer_set" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - if (arg1) (arg1)->quantizer = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_quantizer_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_quantizer_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_quantizer_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::IndexBinary *) ((arg1)->quantizer); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nlist_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_nlist_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nlist_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_nlist_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nlist = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_nlist_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_nlist_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_nlist_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (size_t) ((arg1)->nlist); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::ClusteringParameters *arg2 = (faiss::ClusteringParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_cp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_cp_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'"); - } - arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2); - if (arg1) (arg1)->cp = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ClusteringParameters *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_cp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_cp_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::ClusteringParameters *)& ((arg1)->cp); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_clustering_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_clustering_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_clustering_index_set" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_clustering_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->clustering_index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_clustering_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_clustering_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_clustering_index_get" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - result = (faiss::Index *) ((arg1)->clustering_index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexBinaryIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexBinaryIVF",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryIVF" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryIVF" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexBinaryIVF" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryIVF *)new faiss::IndexBinaryIVF(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryIVF")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryIVF *)new faiss::IndexBinaryIVF(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryIVF(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryIVF__SWIG_1(self, args); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryIVF__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryIVF'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::IndexBinaryIVF(faiss::IndexBinary *,size_t,size_t)\n" - " faiss::IndexBinaryIVF::IndexBinaryIVF()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryIVF",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryIVF" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reset" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_train" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(uint8_t const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_add_core(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexBinaryIVF_add_core",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_add_core" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_add_core" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_add_core" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_add_core" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_add_core" "', argument " "5"" of type '" "long const *""'"); - } - arg5 = reinterpret_cast< long * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_core(arg2,(uint8_t const *)arg3,(long const *)arg4,(long const *)arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - faiss::IndexBinary::idx_t *arg5 = (faiss::IndexBinary::idx_t *) 0 ; - int32_t *arg6 = (int32_t *) 0 ; - int32_t *arg7 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg8 = (faiss::IndexBinary::idx_t *) 0 ; - bool arg9 ; - faiss::IVFSearchParameters *arg10 = (faiss::IVFSearchParameters *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - void *argp10 = 0 ; - int res10 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - PyObject * obj9 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:IndexBinaryIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "6"" of type '" "int32_t const *""'"); - } - arg6 = reinterpret_cast< int32_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "8"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_faiss__IVFSearchParameters, 0 | 0 ); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "10"" of type '" "faiss::IVFSearchParameters const *""'"); - } - arg10 = reinterpret_cast< faiss::IVFSearchParameters * >(argp10); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_preassigned(arg2,(uint8_t const *)arg3,arg4,(faiss::IndexBinary::idx_t const *)arg5,(int32_t const *)arg6,arg7,arg8,arg9,(faiss::IVFSearchParameters const *)arg10); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - faiss::IndexBinary::idx_t *arg5 = (faiss::IndexBinary::idx_t *) 0 ; - int32_t *arg6 = (int32_t *) 0 ; - int32_t *arg7 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg8 = (faiss::IndexBinary::idx_t *) 0 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:IndexBinaryIVF_search_preassigned",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "5"" of type '" "faiss::IndexBinary::idx_t const *""'"); - } - arg5 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "6"" of type '" "int32_t const *""'"); - } - arg6 = reinterpret_cast< int32_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "7"" of type '" "int32_t *""'"); - } - arg7 = reinterpret_cast< int32_t * >(argp7); - res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "8"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg8 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "IndexBinaryIVF_search_preassigned" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_preassigned(arg2,(uint8_t const *)arg3,arg4,(faiss::IndexBinary::idx_t const *)arg5,(int32_t const *)arg6,arg7,arg8,arg9); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_preassigned(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[11] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 10) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 9) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_search_preassigned__SWIG_1(self, args); - } - } - } - } - } - } - } - } - } - } - if (argc == 10) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[8], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[9], &vptr, SWIGTYPE_p_faiss__IVFSearchParameters, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_search_preassigned__SWIG_0(self, args); - } - } - } - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_search_preassigned'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::search_preassigned(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t,faiss::IndexBinary::idx_t const *,int32_t const *,int32_t *,faiss::IndexBinary::idx_t *,bool,faiss::IVFSearchParameters const *) const\n" - " faiss::IndexBinaryIVF::search_preassigned(faiss::IndexBinary::idx_t,uint8_t const *,faiss::IndexBinary::idx_t,faiss::IndexBinary::idx_t const *,int32_t const *,int32_t *,faiss::IndexBinary::idx_t *,bool) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::BinaryInvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_get_InvertedListScanner",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::BinaryInvertedListScanner *)((faiss::IndexBinaryIVF const *)arg1)->get_InvertedListScanner(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BinaryInvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::BinaryInvertedListScanner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_get_InvertedListScanner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_InvertedListScanner" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::BinaryInvertedListScanner *)((faiss::IndexBinaryIVF const *)arg1)->get_InvertedListScanner(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BinaryInvertedListScanner, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_InvertedListScanner(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_get_InvertedListScanner__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_get_InvertedListScanner'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::get_InvertedListScanner(bool) const\n" - " faiss::IndexBinaryIVF::get_InvertedListScanner() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryIVF_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - faiss::IndexBinary::idx_t arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_reconstruct_n" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct_n(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - uint8_t *arg7 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexBinaryIVF_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexBinaryIVF_search_and_reconstruct" "', argument " "7"" of type '" "uint8_t *""'"); - } - arg7 = reinterpret_cast< uint8_t * >(argp7); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->search_and_reconstruct(arg2,(uint8_t const *)arg3,arg4,arg5,arg6,arg7); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_reconstruct_from_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - long arg2 ; - long arg3 ; - uint8_t *arg4 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_reconstruct_from_offset",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "3"" of type '" "long""'"); - } - arg3 = static_cast< long >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryIVF_reconstruct_from_offset" "', argument " "4"" of type '" "uint8_t *""'"); - } - arg4 = reinterpret_cast< uint8_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryIVF const *)arg1)->reconstruct_from_offset(arg2,arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_remove_ids" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryIVF_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_merge_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::IndexBinaryIVF *arg2 = 0 ; - faiss::IndexBinary::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_merge_from",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_merge_from" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IndexBinaryIVF, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexBinaryIVF &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryIVF_merge_from" "', argument " "2"" of type '" "faiss::IndexBinaryIVF &""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_merge_from" "', argument " "3"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg3 = static_cast< faiss::IndexBinary::idx_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->merge_from(*arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_get_list_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_get_list_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_get_list_size" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_get_list_size" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::IndexBinaryIVF const *)arg1)->get_list_size(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_make_direct_map",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_make_direct_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_make_direct_map" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->make_direct_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_make_direct_map(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_make_direct_map__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_make_direct_map__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_make_direct_map'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::make_direct_map(bool)\n" - " faiss::IndexBinaryIVF::make_direct_map()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryIVF_replace_invlists",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ; - faiss::InvertedLists *arg2 = (faiss::InvertedLists *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryIVF_replace_invlists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryIVF, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "1"" of type '" "faiss::IndexBinaryIVF *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryIVF_replace_invlists" "', argument " "2"" of type '" "faiss::InvertedLists *""'"); - } - arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->replace_invlists(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryIVF_replace_invlists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_IndexBinaryIVF_replace_invlists__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinaryIVF, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__InvertedLists, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryIVF_replace_invlists__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryIVF_replace_invlists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryIVF::replace_invlists(faiss::InvertedLists *,bool)\n" - " faiss::IndexBinaryIVF::replace_invlists(faiss::InvertedLists *)\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexBinaryIVF_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryIVF, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFromFloat_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_index_set" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryFromFloat_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_index_get" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryFromFloat_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryFromFloat")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFromFloat *)new faiss::IndexBinaryFromFloat(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryFromFloat *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryFromFloat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryFromFloat" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryFromFloat *)new faiss::IndexBinaryFromFloat(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryFromFloat(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryFromFloat__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexBinaryFromFloat__SWIG_1(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryFromFloat'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryFromFloat::IndexBinaryFromFloat()\n" - " faiss::IndexBinaryFromFloat::IndexBinaryFromFloat(faiss::Index *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryFromFloat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryFromFloat",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryFromFloat" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFromFloat_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_add" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryFromFloat_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_reset" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryFromFloat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_search" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryFromFloat_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryFromFloat_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryFromFloat_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryFromFloat const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryFromFloat_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryFromFloat *arg1 = (faiss::IndexBinaryFromFloat *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryFromFloat_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryFromFloat, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryFromFloat_train" "', argument " "1"" of type '" "faiss::IndexBinaryFromFloat *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryFromFloat * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryFromFloat_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryFromFloat_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryFromFloat_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryFromFloat, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_hnsw_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::HNSW *arg2 = (faiss::HNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_hnsw_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_hnsw_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryHNSW_hnsw_set" "', argument " "2"" of type '" "faiss::HNSW *""'"); - } - arg2 = reinterpret_cast< faiss::HNSW * >(argp2); - if (arg1) (arg1)->hnsw = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_hnsw_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_hnsw_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_hnsw_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (faiss::HNSW *)& ((arg1)->hnsw); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_own_fields_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_own_fields_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryHNSW_storage_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_storage_set" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryHNSW_storage_set" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - if (arg1) (arg1)->storage = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_storage_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_storage_get" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - result = (faiss::IndexBinary *) ((arg1)->storage); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryHNSW")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryHNSW",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryHNSW" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryHNSW",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryHNSW",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryHNSW" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinaryHNSW *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinaryHNSW *)new faiss::IndexBinaryHNSW(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryHNSW(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexBinaryHNSW__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_4(self, args); - } - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_3(self, args); - } - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryHNSW__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryHNSW'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW()\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(int,int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(faiss::IndexBinary *,int)\n" - " faiss::IndexBinaryHNSW::IndexBinaryHNSW(faiss::IndexBinary *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryHNSW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryHNSW",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryHNSW" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_get_distance_computer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::DistanceComputer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_get_distance_computer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_get_distance_computer" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::DistanceComputer *)((faiss::IndexBinaryHNSW const *)arg1)->get_distance_computer(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_add" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_add" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_add" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_train" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_train" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_train" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(uint8_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - faiss::IndexBinary::idx_t arg4 ; - int32_t *arg5 = (int32_t *) 0 ; - faiss::IndexBinary::idx_t *arg6 = (faiss::IndexBinary::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryHNSW_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_search" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_search" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_search" "', argument " "3"" of type '" "uint8_t const *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryHNSW_search" "', argument " "4"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg4 = static_cast< faiss::IndexBinary::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryHNSW_search" "', argument " "5"" of type '" "int32_t *""'"); - } - arg5 = reinterpret_cast< int32_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryHNSW_search" "', argument " "6"" of type '" "faiss::IndexBinary::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexBinary::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryHNSW const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - faiss::IndexBinary::idx_t arg2 ; - uint8_t *arg3 = (uint8_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryHNSW_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "2"" of type '" "faiss::IndexBinary::idx_t""'"); - } - arg2 = static_cast< faiss::IndexBinary::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryHNSW_reconstruct" "', argument " "3"" of type '" "uint8_t *""'"); - } - arg3 = reinterpret_cast< uint8_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexBinaryHNSW const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryHNSW_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinaryHNSW *arg1 = (faiss::IndexBinaryHNSW *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryHNSW_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinaryHNSW, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryHNSW_reset" "', argument " "1"" of type '" "faiss::IndexBinaryHNSW *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinaryHNSW * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryHNSW_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexBinaryHNSW, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexShards_shard_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_shard_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexShards_shard_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->shard_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_shard_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_shard_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->shard_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_successive_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_successive_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_successive_ids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->successive_ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_successive_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_successive_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->successive_ids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - bool arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexShards",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexShards" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexShards",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexShardsTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexShards",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::Index > *)new faiss::IndexShardsTemplate< faiss::Index >(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexShards(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexShards__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexShards'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t,bool,bool)\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t,bool)\n" - " faiss::IndexShardsTemplate< faiss::Index >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::Index >::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add_shard(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_add_shard",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_shard" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexShards_add_shard" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_shard(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_sync_with_shard_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_sync_with_shard_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_sync_with_shard_indexes" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_shard_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexShards_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_at" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexShards_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_add" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_add" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t *arg4 = (faiss::IndexShardsTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexShards_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_with_ids" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_add_with_ids" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_add_with_ids" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexShards_add_with_ids" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3,(faiss::IndexShardsTemplate< faiss::Index >::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg4 ; - faiss::IndexShardsTemplate< faiss::Index >::distance_t *arg5 = (faiss::IndexShardsTemplate< faiss::Index >::distance_t *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t *arg6 = (faiss::IndexShardsTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexShards_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_search" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_search" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_search" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexShards_search" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexShards_search" "', argument " "5"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexShards_search" "', argument " "6"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexShardsTemplate< faiss::Index > const *)arg1)->search(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - faiss::IndexShardsTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexShards_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_train" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexShards_train" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexShards_train" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexShardsTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexShards_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexShards_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_reset" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexShards(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::Index > *arg1 = (faiss::IndexShardsTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexShards",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexShards_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_shard_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - std::vector< faiss::IndexBinary * > *arg2 = (std::vector< faiss::IndexBinary * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_shard_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_shard_indexes_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryShards_shard_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::IndexBinary * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::IndexBinary * > * >(argp2); - if (arg1) (arg1)->shard_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_shard_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::IndexBinary * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_shard_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_shard_indexes_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (std::vector< faiss::IndexBinary * > *)& ((arg1)->shard_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_own_fields_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_own_fields_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_threaded_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_threaded_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_successive_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_successive_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_successive_ids_set" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_successive_ids_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->successive_ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_successive_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_successive_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_successive_ids_get" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->successive_ids); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - bool arg2 ; - bool arg3 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_IndexBinaryShards",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_IndexBinaryShards" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1,arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexBinaryShards",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexBinaryShards" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexBinaryShards",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg1 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexShardsTemplate< faiss::IndexBinary > *)new faiss::IndexShardsTemplate< faiss::IndexBinary >(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexBinaryShards(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexBinaryShards__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexBinaryShards'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t,bool,bool)\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t,bool)\n" - " faiss::IndexShardsTemplate< faiss::IndexBinary >::IndexShardsTemplate(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add_shard(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_add_shard",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add_shard" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryShards_add_shard" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_shard(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_sync_with_shard_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_sync_with_shard_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_sync_with_shard_indexes" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_shard_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryShards_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_at" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryShards_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_add" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_add" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *arg4 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryShards_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexBinaryShards_add_with_ids" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3,(faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg4 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *arg5 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *arg6 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryShards_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_search" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_search" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_search" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryShards_search" "', argument " "4"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryShards_search" "', argument " "5"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryShards_search" "', argument " "6"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexShardsTemplate< faiss::IndexBinary > const *)arg1)->search(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryShards_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_train" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryShards_train" "', argument " "2"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryShards_train" "', argument " "3"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryShards_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryShards_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryShards_reset" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryShards(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexShardsTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexShardsTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryShards",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryShards" "', argument " "1"" of type '" "faiss::IndexShardsTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexShardsTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexBinaryShards_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexReplicas")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexReplicasTemplate< faiss::Index > *)new faiss::IndexReplicasTemplate< faiss::Index >(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexReplicas",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexReplicas" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_addIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_addIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_addIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_addIndex" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->addIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_removeIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_removeIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_removeIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_removeIndex" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->removeIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_runOnIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - SwigValueWrapper< std::function< void (faiss::Index *) > > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_runOnIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_runOnIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::Index *) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::Index *) >""'"); - } else { - std::function< void (faiss::Index *) > * temp = reinterpret_cast< std::function< void (faiss::Index *) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->runOnIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_reset" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_train" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_train" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_train" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_add" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_add" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_add" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg4 ; - faiss::IndexReplicasTemplate< faiss::Index >::distance_t *arg5 = (faiss::IndexReplicasTemplate< faiss::Index >::distance_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t *arg6 = (faiss::IndexReplicasTemplate< faiss::Index >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexReplicas_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_search" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_search" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_search" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexReplicas_search" "', argument " "4"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexReplicas_search" "', argument " "5"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexReplicas_search" "', argument " "6"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->search(arg2,(faiss::IndexReplicasTemplate< faiss::Index >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - faiss::IndexReplicasTemplate< faiss::Index >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::Index >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::Index >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexReplicas_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_reconstruct" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_reconstruct" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::Index >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexReplicas_reconstruct" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::Index >::component_t *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_own_fields_set" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_own_fields_get" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexReplicas_count",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_count" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->count(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::Index > *arg1 = (faiss::IndexReplicasTemplate< faiss::Index > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::Index > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::Index > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)((faiss::IndexReplicasTemplate< faiss::Index > const *)arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexReplicas_at(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexReplicas_at__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexReplicas_at__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexReplicas_at'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexReplicasTemplate< faiss::Index >::at(int)\n" - " faiss::IndexReplicasTemplate< faiss::Index >::at(int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexReplicas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_IndexBinaryReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexBinaryReplicas")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *)new faiss::IndexReplicasTemplate< faiss::IndexBinary >(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexBinaryReplicas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexBinaryReplicas",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexBinaryReplicas" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_addIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_addIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_addIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_addIndex" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->addIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_removeIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexBinary *arg2 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_removeIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_removeIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_removeIndex" "', argument " "2"" of type '" "faiss::IndexBinary *""'"); - } - arg2 = reinterpret_cast< faiss::IndexBinary * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->removeIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_runOnIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - SwigValueWrapper< std::function< void (faiss::IndexBinary *) > > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_runOnIndex",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__functionT_void_ffaiss__IndexBinary_pF_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::IndexBinary *) >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexBinaryReplicas_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::IndexBinary *) >""'"); - } else { - std::function< void (faiss::IndexBinary *) > * temp = reinterpret_cast< std::function< void (faiss::IndexBinary *) > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->runOnIndex(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_reset" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_train" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_train" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_train" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_add" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_add" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_add" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg4 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *arg5 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *arg6 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexBinaryReplicas_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_search" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_search" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_search" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryReplicas_search" "', argument " "4"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg4 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexBinaryReplicas_search" "', argument " "5"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *""'"); - } - arg5 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexBinaryReplicas_search" "', argument " "6"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->search(arg2,(faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t arg2 ; - faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *arg3 = (faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexBinaryReplicas_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "2"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t""'"); - } - arg2 = static_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexBinaryReplicas_reconstruct" "', argument " "3"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *""'"); - } - arg3 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_own_fields_set" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_own_fields_get" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryReplicas_count",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_count" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->count(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)(arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexReplicasTemplate< faiss::IndexBinary > *arg1 = (faiss::IndexReplicasTemplate< faiss::IndexBinary > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexBinaryReplicas_at",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexBinaryReplicas_at" "', argument " "1"" of type '" "faiss::IndexReplicasTemplate< faiss::IndexBinary > const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexReplicasTemplate< faiss::IndexBinary > * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexBinaryReplicas_at" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)((faiss::IndexReplicasTemplate< faiss::IndexBinary > const *)arg1)->at(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexBinaryReplicas_at(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryReplicas_at__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_IndexBinaryReplicas_at__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IndexBinaryReplicas_at'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexReplicasTemplate< faiss::IndexBinary >::at(int)\n" - " faiss::IndexReplicasTemplate< faiss::IndexBinary >::at(int) const\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexBinaryReplicas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIDMap_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_index_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_index_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_index_set" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - if (arg1) (arg1)->index = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_index_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_index_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (faiss::Index *) ((arg1)->index); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_own_fields_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_own_fields_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_id_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - std::vector< long > *arg2 = (std::vector< long > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_id_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_id_map_set" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_id_map_set" "', argument " "2"" of type '" "std::vector< long > *""'"); - } - arg2 = reinterpret_cast< std::vector< long > * >(argp2); - if (arg1) (arg1)->id_map = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_id_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< long > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_id_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_id_map_get" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - result = (std::vector< long > *)& ((arg1)->id_map); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIDMap *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexIDMap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIDMap" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap *)new faiss::IndexIDMap(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIDMap_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIDMap_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_add" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexIDMap_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_search" "', argument " "1"" of type '" "faiss::IndexIDMap const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIDMap_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIDMap_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexIDMap_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_train" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_reset" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_remove_ids" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - float arg4 ; - faiss::RangeSearchResult *arg5 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexIDMap_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap_range_search" "', argument " "1"" of type '" "faiss::IndexIDMap const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap_range_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexIDMap_range_search" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexIDMap_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); - } - arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIDMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *arg1 = (faiss::IndexIDMap *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIDMap",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIDMap" "', argument " "1"" of type '" "faiss::IndexIDMap *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIDMap")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap *)new faiss::IndexIDMap(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIDMap__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexIDMap__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIDMap'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIDMap::IndexIDMap(faiss::Index *)\n" - " faiss::IndexIDMap::IndexIDMap()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIDMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIDMap, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexIDMap2_rev_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap2_rev_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_rev_map_set" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_mapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap2_rev_map_set" "', argument " "2"" of type '" "std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap2_rev_map_set" "', argument " "2"" of type '" "std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >""'"); - } else { - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > * temp = reinterpret_cast< std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->rev_map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_rev_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap2_rev_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_rev_map_get" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - result = ((arg1)->rev_map); - resultobj = SWIG_NewPointerObj((new std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >(static_cast< const std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t >& >(result))), SWIGTYPE_p_std__unordered_mapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexIDMap2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexIDMap2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexIDMap2" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap2 *)new faiss::IndexIDMap2(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_construct_rev_map(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexIDMap2_construct_rev_map",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_construct_rev_map" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->construct_rev_map(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexIDMap2_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_add_with_ids" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap2_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap2_add_with_ids" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexIDMap2_add_with_ids" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::IDSelector *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexIDMap2_remove_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_remove_ids" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexIDMap2_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexIDMap2_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexIDMap2_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexIDMap2_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexIDMap2_reconstruct" "', argument " "1"" of type '" "faiss::IndexIDMap2 const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexIDMap2_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexIDMap2_reconstruct" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexIDMap2 const *)arg1)->reconstruct(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexIDMap2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *arg1 = (faiss::IndexIDMap2 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexIDMap2",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexIDMap2" "', argument " "1"" of type '" "faiss::IndexIDMap2 *""'"); - } - arg1 = reinterpret_cast< faiss::IndexIDMap2 * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexIDMap2 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_IndexIDMap2")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIDMap2 *)new faiss::IndexIDMap2(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIDMap2, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexIDMap2(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_IndexIDMap2__SWIG_1(self, args); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_IndexIDMap2__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexIDMap2'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexIDMap2::IndexIDMap2(faiss::Index *)\n" - " faiss::IndexIDMap2::IndexIDMap2()\n"); - return 0; -} - - -SWIGINTERN PyObject *IndexIDMap2_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexIDMap2, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_own_fields_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_own_fields_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_own_fields_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->own_fields = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_own_fields_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_own_fields_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (bool) ((arg1)->own_fields); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_threaded_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_threaded_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_threaded_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_threaded_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->threaded = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_threaded_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_threaded_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_threaded_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (bool) ((arg1)->threaded); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sub_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - std::vector< faiss::Index * > *arg2 = (std::vector< faiss::Index * > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_sub_indexes_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sub_indexes_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexSplitVectors_sub_indexes_set" "', argument " "2"" of type '" "std::vector< faiss::Index * > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::Index * > * >(argp2); - if (arg1) (arg1)->sub_indexes = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sub_indexes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::Index * > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sub_indexes_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sub_indexes_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (std::vector< faiss::Index * > *)& ((arg1)->sub_indexes); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__Index_p_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sum_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_sum_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sum_d_set" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_sum_d_set" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - if (arg1) (arg1)->sum_d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sum_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sum_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sum_d_get" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - result = (faiss::Index::idx_t) ((arg1)->sum_d); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexSplitVectors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexSplitVectors",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexSplitVectors" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexSplitVectors" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexSplitVectors *)new faiss::IndexSplitVectors(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexSplitVectors *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_IndexSplitVectors",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexSplitVectors" "', argument " "1"" of type '" "faiss::Index::idx_t""'"); - } - arg1 = static_cast< faiss::Index::idx_t >(val1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexSplitVectors *)new faiss::IndexSplitVectors(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IndexSplitVectors(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexSplitVectors__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_IndexSplitVectors__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexSplitVectors'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::IndexSplitVectors::IndexSplitVectors(faiss::Index::idx_t,bool)\n" - " faiss::IndexSplitVectors::IndexSplitVectors(faiss::Index::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_add_sub_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IndexSplitVectors_add_sub_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_add_sub_index" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexSplitVectors_add_sub_index" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add_sub_index(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_sync_with_sub_indexes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_sync_with_sub_indexes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_sync_with_sub_indexes" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->sync_with_sub_indexes(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexSplitVectors_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_add" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_add" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->add(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - faiss::Index::idx_t arg4 ; - float *arg5 = (float *) 0 ; - faiss::Index::idx_t *arg6 = (faiss::Index::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexSplitVectors_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_search" "', argument " "1"" of type '" "faiss::IndexSplitVectors const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_search" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexSplitVectors_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'"); - } - arg4 = static_cast< faiss::Index::idx_t >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexSplitVectors_search" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexSplitVectors_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); - } - arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::IndexSplitVectors const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - faiss::Index::idx_t arg2 ; - float *arg3 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IndexSplitVectors_train",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_train" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexSplitVectors_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'"); - } - arg2 = static_cast< faiss::Index::idx_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexSplitVectors_train" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->train(arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IndexSplitVectors_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IndexSplitVectors_reset",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexSplitVectors_reset" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->reset(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IndexSplitVectors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexSplitVectors *arg1 = (faiss::IndexSplitVectors *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexSplitVectors",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexSplitVectors" "', argument " "1"" of type '" "faiss::IndexSplitVectors *""'"); - } - arg1 = reinterpret_cast< faiss::IndexSplitVectors * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IndexSplitVectors_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexSplitVectors, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_downcast_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_index" "', argument " "1"" of type '" "faiss::Index *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)downcast_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_downcast_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)downcast_VectorTransform(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,0); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_downcast_IndexBinary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:downcast_IndexBinary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "downcast_IndexBinary" "', argument " "1"" of type '" "faiss::IndexBinary *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)downcast_IndexBinary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,0); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index((faiss::Index const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_index'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_index(faiss::Index const *,char const *)\n" - " faiss::write_index(faiss::Index const *,FILE *)\n" - " faiss::write_index(faiss::Index const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - FILE *arg2 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "FILE *""'"); - } - arg2 = reinterpret_cast< FILE * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IndexBinary *arg1 = (faiss::IndexBinary *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexBinary, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_index_binary" "', argument " "1"" of type '" "faiss::IndexBinary const *""'"); - } - arg1 = reinterpret_cast< faiss::IndexBinary * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_index_binary" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_index_binary((faiss::IndexBinary const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_index_binary(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IndexBinary, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_index_binary__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_index_binary'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_index_binary(faiss::IndexBinary const *,char const *)\n" - " faiss::write_index_binary(faiss::IndexBinary const *,FILE *)\n" - " faiss::write_index_binary(faiss::IndexBinary const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN int Swig_var_IO_FLAG_MMAP_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_MMAP is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_MMAP_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_MMAP)); - return pyobj; -} - - -SWIGINTERN int Swig_var_IO_FLAG_READ_ONLY_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_READ_ONLY is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_READ_ONLY_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_READ_ONLY)); - return pyobj; -} - - -SWIGINTERN int Swig_var_IO_FLAG_ONDISK_SAME_DIR_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable IO_FLAG_ONDISK_SAME_DIR is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_IO_FLAG_ONDISK_SAME_DIR_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_int(static_cast< int >(faiss::IO_FLAG_ONDISK_SAME_DIR)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index((char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::read_index(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_3(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_5(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_4(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_index'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_index(char const *,int)\n" - " faiss::read_index(char const *)\n" - " faiss::read_index(FILE *,int)\n" - " faiss::read_index(FILE *)\n" - " faiss::read_index(faiss::IOReader *,int)\n" - " faiss::read_index(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary((char const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "FILE *""'"); - } - arg1 = reinterpret_cast< FILE * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_index_binary",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_index_binary" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_index_binary",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_index_binary" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::read_index_binary(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_index_binary(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_3(self, args); - } - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_5(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_index_binary__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_4(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FILE, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_index_binary__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_index_binary'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_index_binary(char const *,int)\n" - " faiss::read_index_binary(char const *)\n" - " faiss::read_index_binary(FILE *,int)\n" - " faiss::read_index_binary(FILE *)\n" - " faiss::read_index_binary(faiss::IOReader *,int)\n" - " faiss::read_index_binary(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorTransform *arg1 = (faiss::VectorTransform *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_VectorTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform const *""'"); - } - arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_VectorTransform" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_VectorTransform((faiss::VectorTransform const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_VectorTransform",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_VectorTransform" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)faiss::read_VectorTransform((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_ProductQuantizer" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)faiss::read_ProductQuantizer((char const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_OWN | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::ProductQuantizer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_ProductQuantizer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_ProductQuantizer" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ProductQuantizer *)faiss::read_ProductQuantizer(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[2] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_ProductQuantizer__SWIG_1(self, args); - } - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_ProductQuantizer__SWIG_0(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_ProductQuantizer(char const *)\n" - " faiss::read_ProductQuantizer(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_ProductQuantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_ProductQuantizer" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_ProductQuantizer((faiss::ProductQuantizer const *)arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ProductQuantizer *arg1 = (faiss::ProductQuantizer *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_ProductQuantizer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'"); - } - arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_ProductQuantizer" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_ProductQuantizer((faiss::ProductQuantizer const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_write_ProductQuantizer(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__IOWriter, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_ProductQuantizer__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_write_ProductQuantizer__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'write_ProductQuantizer'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::write_ProductQuantizer(faiss::ProductQuantizer const *,char const *)\n" - " faiss::write_ProductQuantizer(faiss::ProductQuantizer const *,faiss::IOWriter *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_write_InvertedLists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InvertedLists *arg1 = (faiss::InvertedLists *) 0 ; - faiss::IOWriter *arg2 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:write_InvertedLists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "write_InvertedLists" "', argument " "1"" of type '" "faiss::InvertedLists const *""'"); - } - arg1 = reinterpret_cast< faiss::InvertedLists * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "write_InvertedLists" "', argument " "2"" of type '" "faiss::IOWriter *""'"); - } - arg2 = reinterpret_cast< faiss::IOWriter * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - faiss::write_InvertedLists((faiss::InvertedLists const *)arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:read_InvertedLists",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_InvertedLists" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_InvertedLists" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists *)faiss::read_InvertedLists(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::InvertedLists *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:read_InvertedLists",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_InvertedLists" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::InvertedLists *)faiss::read_InvertedLists(arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_read_InvertedLists(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_read_InvertedLists__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__IOReader, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_read_InvertedLists__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'read_InvertedLists'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::read_InvertedLists(faiss::IOReader *,int)\n" - " faiss::read_InvertedLists(faiss::IOReader *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_clone_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Index *arg1 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:clone_index",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "clone_index" "', argument " "1"" of type '" "faiss::Index const *""'"); - } - arg1 = reinterpret_cast< faiss::Index * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::clone_index((faiss::Index const *)arg1); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::VectorTransform *arg2 = (faiss::VectorTransform *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::VectorTransform *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_VectorTransform",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_VectorTransform" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_VectorTransform" "', argument " "2"" of type '" "faiss::VectorTransform const *""'"); - } - arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::VectorTransform *)(arg1)->clone_VectorTransform((faiss::VectorTransform const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__CenteringTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__VectorTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_Index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_Index",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_Index" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_Index" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)(arg1)->clone_Index((faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,0); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Cloner_clone_IndexIVF(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - faiss::IndexIVF *arg2 = (faiss::IndexIVF *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexIVF *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Cloner_clone_IndexIVF",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cloner_clone_IndexIVF" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cloner_clone_IndexIVF" "', argument " "2"" of type '" "faiss::IndexIVF const *""'"); - } - arg2 = reinterpret_cast< faiss::IndexIVF * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexIVF *)(arg1)->clone_IndexIVF((faiss::IndexIVF const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexIVF, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Cloner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *arg1 = (faiss::Cloner *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Cloner",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Cloner, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Cloner" "', argument " "1"" of type '" "faiss::Cloner *""'"); - } - arg1 = reinterpret_cast< faiss::Cloner * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Cloner(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::Cloner *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Cloner")) SWIG_fail; - result = (faiss::Cloner *)new faiss::Cloner(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Cloner, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Cloner_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Cloner, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nq_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_nq_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nq_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->nq); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nnn_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_nnn_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nnn_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_nnn_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->nnn = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_nnn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_nnn_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_nnn_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->nnn); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_nnn_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_nnn_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_nnn_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_gt_nnn_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->gt_nnn = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_nnn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_nnn_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_nnn_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->gt_nnn); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_D_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - std::vector< float > *arg2 = (std::vector< float > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_D_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_D_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_gt_D_set" "', argument " "2"" of type '" "std::vector< float > *""'"); - } - arg2 = reinterpret_cast< std::vector< float > * >(argp2); - if (arg1) (arg1)->gt_D = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_D_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< float > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_D_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_D_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (std::vector< float > *)& ((arg1)->gt_D); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_I_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - std::vector< faiss::AutoTuneCriterion::idx_t > *arg2 = (std::vector< faiss::AutoTuneCriterion::idx_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:AutoTuneCriterion_gt_I_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_I_set" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_gt_I_set" "', argument " "2"" of type '" "std::vector< faiss::AutoTuneCriterion::idx_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::AutoTuneCriterion::idx_t > * >(argp2); - if (arg1) (arg1)->gt_I = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_gt_I_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::AutoTuneCriterion::idx_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:AutoTuneCriterion_gt_I_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_gt_I_get" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - result = (std::vector< faiss::AutoTuneCriterion::idx_t > *)& ((arg1)->gt_I); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_set_groundtruth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - int arg2 ; - float *arg3 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg4 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:AutoTuneCriterion_set_groundtruth",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "AutoTuneCriterion_set_groundtruth" "', argument " "4"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg4 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp4); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->set_groundtruth(arg2,(float const *)arg3,(faiss::AutoTuneCriterion::idx_t const *)arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_AutoTuneCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:AutoTuneCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoTuneCriterion_evaluate" "', argument " "1"" of type '" "faiss::AutoTuneCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoTuneCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "AutoTuneCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::AutoTuneCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_AutoTuneCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion *arg1 = (faiss::AutoTuneCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_AutoTuneCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__AutoTuneCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_AutoTuneCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *AutoTuneCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__AutoTuneCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_R_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OneRecallAtRCriterion_R_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_R_set" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OneRecallAtRCriterion_R_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->R = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_R_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:OneRecallAtRCriterion_R_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_R_get" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->R); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OneRecallAtRCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion::idx_t arg1 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::OneRecallAtRCriterion *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_OneRecallAtRCriterion",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OneRecallAtRCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg1 = static_cast< faiss::AutoTuneCriterion::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OneRecallAtRCriterion" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OneRecallAtRCriterion *)new faiss::OneRecallAtRCriterion(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OneRecallAtRCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OneRecallAtRCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OneRecallAtRCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::OneRecallAtRCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OneRecallAtRCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OneRecallAtRCriterion *arg1 = (faiss::OneRecallAtRCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OneRecallAtRCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OneRecallAtRCriterion" "', argument " "1"" of type '" "faiss::OneRecallAtRCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::OneRecallAtRCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OneRecallAtRCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OneRecallAtRCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_R_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IntersectionCriterion_R_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_R_set" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntersectionCriterion_R_set" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - if (arg1) (arg1)->R = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_R_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::AutoTuneCriterion::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IntersectionCriterion_R_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_R_get" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - result = (faiss::AutoTuneCriterion::idx_t) ((arg1)->R); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IntersectionCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::AutoTuneCriterion::idx_t arg1 ; - faiss::AutoTuneCriterion::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IntersectionCriterion *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IntersectionCriterion",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IntersectionCriterion" "', argument " "1"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg1 = static_cast< faiss::AutoTuneCriterion::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IntersectionCriterion" "', argument " "2"" of type '" "faiss::AutoTuneCriterion::idx_t""'"); - } - arg2 = static_cast< faiss::AutoTuneCriterion::idx_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IntersectionCriterion *)new faiss::IntersectionCriterion(arg1,arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IntersectionCriterion_evaluate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - float *arg2 = (float *) 0 ; - faiss::AutoTuneCriterion::idx_t *arg3 = (faiss::AutoTuneCriterion::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:IntersectionCriterion_evaluate",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntersectionCriterion_evaluate" "', argument " "1"" of type '" "faiss::IntersectionCriterion const *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntersectionCriterion_evaluate" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IntersectionCriterion_evaluate" "', argument " "3"" of type '" "faiss::AutoTuneCriterion::idx_t const *""'"); - } - arg3 = reinterpret_cast< faiss::AutoTuneCriterion::idx_t * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::IntersectionCriterion const *)arg1)->evaluate((float const *)arg2,(faiss::AutoTuneCriterion::idx_t const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IntersectionCriterion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IntersectionCriterion *arg1 = (faiss::IntersectionCriterion *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IntersectionCriterion",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntersectionCriterion" "', argument " "1"" of type '" "faiss::IntersectionCriterion *""'"); - } - arg1 = reinterpret_cast< faiss::IntersectionCriterion * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IntersectionCriterion_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IntersectionCriterion, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OperatingPoint_perf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_perf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_perf_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_perf_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->perf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_perf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_perf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_perf_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (double) ((arg1)->perf); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_t_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_t_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_t_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_t_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->t = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_t_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_t_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_t_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (double) ((arg1)->t); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_key_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_key_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_key_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoint_key_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoint_key_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->key = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_key_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_key_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_key_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (std::string *) & ((arg1)->key); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_cno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoint_cno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_cno_set" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoint_cno_set" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - if (arg1) (arg1)->cno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoint_cno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoint_cno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoint_cno_get" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - result = (long) ((arg1)->cno); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OperatingPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPoint")) SWIG_fail; - result = (faiss::OperatingPoint *)new faiss::OperatingPoint(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoint *arg1 = (faiss::OperatingPoint *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPoint",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPoint" "', argument " "1"" of type '" "faiss::OperatingPoint *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoint * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OperatingPoint, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_pts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_all_pts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_pts_set" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_all_pts_set" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - if (arg1) (arg1)->all_pts = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_pts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_all_pts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_pts_get" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - result = (std::vector< faiss::OperatingPoint > *)& ((arg1)->all_pts); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_pts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - std::vector< faiss::OperatingPoint > *arg2 = (std::vector< faiss::OperatingPoint > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_optimal_pts_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_pts_set" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_optimal_pts_set" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2); - if (arg1) (arg1)->optimal_pts = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_pts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::OperatingPoint > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_optimal_pts_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_pts_get" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - result = (std::vector< faiss::OperatingPoint > *)& ((arg1)->optimal_pts); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_OperatingPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_OperatingPoints")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::OperatingPoints *)new faiss::OperatingPoints(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoints, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - faiss::OperatingPoints *arg2 = 0 ; - std::string *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:OperatingPoints_merge_with",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_merge_with" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoints, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - arg2 = reinterpret_cast< faiss::OperatingPoints * >(argp2); - { - std::string *ptr = (std::string *)0; - res3 = SWIG_AsPtr_std_string(obj2, &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OperatingPoints_merge_with" "', argument " "3"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "3"" of type '" "std::string const &""'"); - } - arg3 = ptr; - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->merge_with((faiss::OperatingPoints const &)*arg2,(std::string const &)*arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - if (SWIG_IsNewObj(res3)) delete arg3; - return resultobj; -fail: - if (SWIG_IsNewObj(res3)) delete arg3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - faiss::OperatingPoints *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_merge_with",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_merge_with" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoints, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_merge_with" "', argument " "2"" of type '" "faiss::OperatingPoints const &""'"); - } - arg2 = reinterpret_cast< faiss::OperatingPoints * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (int)(arg1)->merge_with((faiss::OperatingPoints const &)*arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_merge_with(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_merge_with__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_merge_with__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_merge_with'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::merge_with(faiss::OperatingPoints const &,std::string const &)\n" - " faiss::OperatingPoints::merge_with(faiss::OperatingPoints const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_clear" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->clear(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - double arg3 ; - std::string *arg4 = 0 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - int res4 = SWIG_OLDOBJ ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:OperatingPoints_add",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_add" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_add" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OperatingPoints_add" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - { - std::string *ptr = (std::string *)0; - res4 = SWIG_AsPtr_std_string(obj3, &ptr); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - arg4 = ptr; - } - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "OperatingPoints_add" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)(arg1)->add(arg2,arg3,(std::string const &)*arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (SWIG_IsNewObj(res4)) delete arg4; - return resultobj; -fail: - if (SWIG_IsNewObj(res4)) delete arg4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - double arg3 ; - std::string *arg4 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - double val3 ; - int ecode3 = 0 ; - int res4 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:OperatingPoints_add",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_add" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_add" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - ecode3 = SWIG_AsVal_double(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OperatingPoints_add" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - { - std::string *ptr = (std::string *)0; - res4 = SWIG_AsPtr_std_string(obj3, &ptr); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPoints_add" "', argument " "4"" of type '" "std::string const &""'"); - } - arg4 = ptr; - } - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)(arg1)->add(arg2,arg3,(std::string const &)*arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (SWIG_IsNewObj(res4)) delete arg4; - return resultobj; -fail: - if (SWIG_IsNewObj(res4)) delete arg4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_add(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[6] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 5) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(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_AsPtr_std_string(argv[3], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_add__SWIG_1(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(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_AsPtr_std_string(argv[3], (std::string**)(0)); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_OperatingPoints_add__SWIG_0(self, args); - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_add'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::add(double,double,std::string const &,size_t)\n" - " faiss::OperatingPoints::add(double,double,std::string const &)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_t_for_perf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_t_for_perf",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_t_for_perf" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_t_for_perf" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (double)((faiss::OperatingPoints const *)arg1)->t_for_perf(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_display",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_display" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPoints_display" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->display(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:OperatingPoints_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_display" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_display(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_OperatingPoints_display__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__OperatingPoints, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_OperatingPoints_display__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'OperatingPoints_display'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::OperatingPoints::display(bool) const\n" - " faiss::OperatingPoints::display() const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_all_to_gnuplot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_all_to_gnuplot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_all_to_gnuplot" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_all_to_gnuplot" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->all_to_gnuplot((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_OperatingPoints_optimal_to_gnuplot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPoints_optimal_to_gnuplot",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPoints_optimal_to_gnuplot" "', argument " "1"" of type '" "faiss::OperatingPoints const *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPoints_optimal_to_gnuplot" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::OperatingPoints const *)arg1)->optimal_to_gnuplot((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_OperatingPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::OperatingPoints *arg1 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPoints",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OperatingPoints, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPoints" "', argument " "1"" of type '" "faiss::OperatingPoints *""'"); - } - arg1 = reinterpret_cast< faiss::OperatingPoints * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *OperatingPoints_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OperatingPoints, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ParameterRange_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterRange_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_name_set" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterRange_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterRange_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterRange_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_name_get" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_values_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - std::vector< double > *arg2 = (std::vector< double > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterRange_values_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_values_set" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterRange_values_set" "', argument " "2"" of type '" "std::vector< double > *""'"); - } - arg2 = reinterpret_cast< std::vector< double > * >(argp2); - if (arg1) (arg1)->values = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterRange_values_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< double > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterRange_values_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterRange_values_get" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - result = (std::vector< double > *)& ((arg1)->values); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ParameterRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ParameterRange")) SWIG_fail; - result = (faiss::ParameterRange *)new faiss::ParameterRange(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterRange, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ParameterRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterRange *arg1 = (faiss::ParameterRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ParameterRange",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterRange, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ParameterRange" "', argument " "1"" of type '" "faiss::ParameterRange *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterRange * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ParameterRange_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ParameterRange, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ParameterSpace_parameter_ranges_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - std::vector< faiss::ParameterRange > *arg2 = (std::vector< faiss::ParameterRange > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_parameter_ranges_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_parameter_ranges_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_parameter_ranges_set" "', argument " "2"" of type '" "std::vector< faiss::ParameterRange > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::ParameterRange > * >(argp2); - if (arg1) (arg1)->parameter_ranges = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_parameter_ranges_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::ParameterRange > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_parameter_ranges_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_parameter_ranges_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (std::vector< faiss::ParameterRange > *)& ((arg1)->parameter_ranges); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_verbose_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_verbose_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_verbose_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->verbose = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_verbose_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_verbose_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (int) ((arg1)->verbose); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_experiments_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_n_experiments_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_experiments_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_n_experiments_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->n_experiments = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_experiments_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_n_experiments_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_experiments_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (int) ((arg1)->n_experiments); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_batchsize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_batchsize_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_batchsize_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_batchsize_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->batchsize = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_batchsize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_batchsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_batchsize_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (size_t) ((arg1)->batchsize); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_thread_over_batches_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_thread_over_batches_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_thread_over_batches_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_thread_over_batches_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->thread_over_batches = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_thread_over_batches_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_thread_over_batches_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_thread_over_batches_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (bool) ((arg1)->thread_over_batches); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_min_test_duration_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_min_test_duration_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_min_test_duration_set" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_min_test_duration_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->min_test_duration = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_min_test_duration_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_min_test_duration_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_min_test_duration_get" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - result = (double) ((arg1)->min_test_duration); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ParameterSpace")) SWIG_fail; - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ParameterSpace *)new faiss::ParameterSpace(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterSpace, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_n_combinations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_n_combinations",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_n_combinations" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (size_t)((faiss::ParameterSpace const *)arg1)->n_combinations(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_combination_ge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_combination_ge",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_combination_ge" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_combination_ge" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_combination_ge" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (bool)((faiss::ParameterSpace const *)arg1)->combination_ge(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_combination_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - std::string result; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_combination_name",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_combination_name" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_combination_name" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = ((faiss::ParameterSpace const *)arg1)->combination_name(arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ParameterSpace_display",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_display" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->display(); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_add_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::ParameterRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_add_range",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_add_range" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_add_range" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::ParameterRange *) &(arg1)->add_range((char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ParameterRange, 0 | 0 ); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_initialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ParameterSpace_initialize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_initialize" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_initialize" "', argument " "2"" of type '" "faiss::Index const *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->initialize((faiss::Index const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_set_index_parameters",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameters" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameters" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_set_index_parameters" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameters(arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:ParameterSpace_set_index_parameters",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameters" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameters" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_set_index_parameters" "', argument " "3"" of type '" "char const *""'"); - } - arg3 = reinterpret_cast< char * >(buf3); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameters(arg2,(char const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return resultobj; -fail: - if (alloc3 == SWIG_NEWOBJ) delete[] buf3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameters(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ParameterSpace, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_ParameterSpace_set_index_parameters__SWIG_0(self, args); - } - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ParameterSpace, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_ParameterSpace_set_index_parameters__SWIG_1(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ParameterSpace_set_index_parameters'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::ParameterSpace::set_index_parameters(faiss::Index *,size_t) const\n" - " faiss::ParameterSpace::set_index_parameters(faiss::Index *,char const *) const\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_set_index_parameter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - std::string *arg3 = 0 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - double val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:ParameterSpace_set_index_parameter",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_set_index_parameter" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_set_index_parameter" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - { - std::string *ptr = (std::string *)0; - res3 = SWIG_AsPtr_std_string(obj2, &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_set_index_parameter" "', argument " "3"" of type '" "std::string const &""'"); - } - arg3 = ptr; - } - ecode4 = SWIG_AsVal_double(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ParameterSpace_set_index_parameter" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->set_index_parameter(arg2,(std::string const &)*arg3,arg4); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res3)) delete arg3; - return resultobj; -fail: - if (SWIG_IsNewObj(res3)) delete arg3; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_update_bounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - size_t arg2 ; - faiss::OperatingPoint *arg3 = 0 ; - double *arg4 = (double *) 0 ; - double *arg5 = (double *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:ParameterSpace_update_bounds",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_update_bounds" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ParameterSpace_update_bounds" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__OperatingPoint, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ParameterSpace_update_bounds" "', argument " "3"" of type '" "faiss::OperatingPoint const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_update_bounds" "', argument " "3"" of type '" "faiss::OperatingPoint const &""'"); - } - arg3 = reinterpret_cast< faiss::OperatingPoint * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ParameterSpace_update_bounds" "', argument " "4"" of type '" "double *""'"); - } - arg4 = reinterpret_cast< double * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ParameterSpace_update_bounds" "', argument " "5"" of type '" "double *""'"); - } - arg5 = reinterpret_cast< double * >(argp5); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->update_bounds(arg2,(faiss::OperatingPoint const &)*arg3,arg4,arg5); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ParameterSpace_explore(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - faiss::Index *arg2 = (faiss::Index *) 0 ; - size_t arg3 ; - float *arg4 = (float *) 0 ; - faiss::AutoTuneCriterion *arg5 = 0 ; - faiss::OperatingPoints *arg6 = (faiss::OperatingPoints *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ParameterSpace_explore",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParameterSpace_explore" "', argument " "1"" of type '" "faiss::ParameterSpace const *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ParameterSpace_explore" "', argument " "2"" of type '" "faiss::Index *""'"); - } - arg2 = reinterpret_cast< faiss::Index * >(argp2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ParameterSpace_explore" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ParameterSpace_explore" "', argument " "4"" of type '" "float const *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_faiss__AutoTuneCriterion, 0 | 0); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ParameterSpace_explore" "', argument " "5"" of type '" "faiss::AutoTuneCriterion const &""'"); - } - if (!argp5) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ParameterSpace_explore" "', argument " "5"" of type '" "faiss::AutoTuneCriterion const &""'"); - } - arg5 = reinterpret_cast< faiss::AutoTuneCriterion * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__OperatingPoints, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ParameterSpace_explore" "', argument " "6"" of type '" "faiss::OperatingPoints *""'"); - } - arg6 = reinterpret_cast< faiss::OperatingPoints * >(argp6); - { - Py_BEGIN_ALLOW_THREADS - try { - ((faiss::ParameterSpace const *)arg1)->explore(arg2,arg3,(float const *)arg4,(faiss::AutoTuneCriterion const &)*arg5,arg6); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ParameterSpace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::ParameterSpace *arg1 = (faiss::ParameterSpace *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ParameterSpace",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ParameterSpace, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ParameterSpace" "', argument " "1"" of type '" "faiss::ParameterSpace *""'"); - } - arg1 = reinterpret_cast< faiss::ParameterSpace * >(argp1); - { - Py_BEGIN_ALLOW_THREADS - try { - delete arg1; - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ParameterSpace_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ParameterSpace, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_index_factory__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - faiss::MetricType arg3 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:index_factory",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "index_factory" "', argument " "3"" of type '" "faiss::MetricType""'"); - } - arg3 = static_cast< faiss::MetricType >(val3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::index_factory(arg1,(char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_factory__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::Index *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:index_factory",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::Index *)faiss::index_factory(arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_index_factory(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_index_factory__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_index_factory__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'index_factory'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::index_factory(int,char const *,faiss::MetricType)\n" - " faiss::index_factory(int,char const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_index_binary_factory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char *arg2 = (char *) 0 ; - int val1 ; - int ecode1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IndexBinary *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:index_binary_factory",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "index_binary_factory" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "index_binary_factory" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::IndexBinary *)faiss::index_binary_factory(arg1,(char const *)arg2); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - { - /*@SWIG:swigfaiss.swig,465,DOWNCAST2@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - - - - // default for non-recognized classes - /*@SWIG:swigfaiss.swig,459,DOWNCAST@*/ - if (dynamic_cast (result)) { - resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinary,SWIG_POINTER_OWN); - } else - /*@SWIG@*/ - if (result == NULL) - { - resultobj = SWIG_Py_Void(); - - // Lua does not need a push for nil - } else { - assert(false); - } - - - - } - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MatrixStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t arg2 ; - float *arg3 = (float *) 0 ; - size_t val1 ; - int ecode1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - faiss::MatrixStats *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:new_MatrixStats",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_MatrixStats" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_MatrixStats" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_MatrixStats" "', argument " "3"" of type '" "float const *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - { - Py_BEGIN_ALLOW_THREADS - try { - result = (faiss::MatrixStats *)new faiss::MatrixStats(arg1,arg2,(float const *)arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__MatrixStats, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_comments_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_comments_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_comments_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_comments_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatrixStats_comments_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->comments = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_comments_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_comments_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_comments_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::string *) & ((arg1)->comments); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_d_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_d_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_d_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->d = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_d_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_d_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->d); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_collision_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_collision_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_collision_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_collision_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_collision = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_collision_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_collision_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_collision_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n_collision); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_valid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n_valid_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_valid_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n_valid_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n_valid = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n_valid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n_valid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n_valid_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n_valid); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_n0_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n0_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_n0_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->n0 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_n0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_n0_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_n0_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->n0); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_min_norm2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_min_norm2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_min_norm2_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_min_norm2_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->min_norm2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_min_norm2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_min_norm2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_min_norm2_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (double) ((arg1)->min_norm2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_max_norm2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_max_norm2_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_max_norm2_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_max_norm2_set" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - if (arg1) (arg1)->max_norm2 = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_max_norm2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - double result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_max_norm2_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_max_norm2_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (double) ((arg1)->max_norm2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_per_dim_stats_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::vector< faiss::MatrixStats::PerDimStats > *arg2 = (std::vector< faiss::MatrixStats::PerDimStats > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_per_dim_stats_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_per_dim_stats_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_per_dim_stats_set" "', argument " "2"" of type '" "std::vector< faiss::MatrixStats::PerDimStats > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::MatrixStats::PerDimStats > * >(argp2); - if (arg1) (arg1)->per_dim_stats = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_per_dim_stats_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::MatrixStats::PerDimStats > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_per_dim_stats_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_per_dim_stats_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::vector< faiss::MatrixStats::PerDimStats > *)& ((arg1)->per_dim_stats); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_occurrences_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *arg2 = (std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_occurrences_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_occurrences_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_occurrences_set" "', argument " "2"" of type '" "std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *""'"); - } - arg2 = reinterpret_cast< std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > * >(argp2); - if (arg1) (arg1)->occurrences = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_occurrences_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_occurrences_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_occurrences_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *)& ((arg1)->occurrences); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_buf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_buf_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_buf_set" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - if (arg1->buf) delete[] arg1->buf; - if (arg2) { - size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1; - arg1->buf = (char *)reinterpret_cast< char* >(memcpy(new char[size], reinterpret_cast< const char * >(arg2), sizeof(char)*(size))); - } else { - arg1->buf = 0; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_buf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_buf_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (char *) ((arg1)->buf); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_nbuf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_nbuf_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_nbuf_set" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatrixStats_nbuf_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nbuf = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_nbuf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:MatrixStats_nbuf_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_nbuf_get" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - result = (size_t) ((arg1)->nbuf); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_do_comment__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - char *arg2 = (char *) 0 ; - void *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MatrixStats_do_comment",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatrixStats_do_comment" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatrixStats_do_comment" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - { - Py_BEGIN_ALLOW_THREADS - try { - (arg1)->do_comment((char const *)arg2,arg3); - } catch(faiss::FaissException & e) { - PyEval_RestoreThread(_save); - - if (PyErr_Occurred()) { - // some previous code already set the error type. - } else { - PyErr_SetString(PyExc_RuntimeError, e.what()); - } - SWIG_fail; - } - Py_END_ALLOW_THREADS - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MatrixStats_do_comment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj; - PyObject *varargs; - PyObject *newargs; - - newargs = PyTuple_GetSlice(args,0,2); - varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)); - resultobj = _wrap_MatrixStats_do_comment__varargs__(NULL,newargs,varargs); - Py_XDECREF(newargs); - Py_XDECREF(varargs); - return resultobj; -} - - -SWIGINTERN PyObject *_wrap_delete_MatrixStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::MatrixStats *arg1 = (faiss::MatrixStats *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MatrixStats",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__MatrixStats, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MatrixStats" "', argument " "1"" of type '" "faiss::MatrixStats *""'"); - } - arg1 = reinterpret_cast< faiss::MatrixStats * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MatrixStats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__MatrixStats, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_swig_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:swig_ptr",&obj0)) SWIG_fail; - arg1 = obj0; - result = (PyObject *)swig_ptr(arg1); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float *arg1 = (float *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "float *""'"); - } - arg1 = reinterpret_cast< float * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned char *arg1 = (unsigned char *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "unsigned char *""'"); - } - arg1 = reinterpret_cast< unsigned char * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned long *arg1 = (unsigned long *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "unsigned long *""'"); - } - arg1 = reinterpret_cast< unsigned long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long *arg1 = (long *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:rev_swig_ptr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rev_swig_ptr" "', argument " "1"" of type '" "long *""'"); - } - arg1 = reinterpret_cast< long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rev_swig_ptr" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (PyObject *)rev_swig_ptr(arg1,arg2); - resultobj = result; - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_rev_swig_ptr(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_1(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_2(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_3(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_rev_swig_ptr__SWIG_4(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'rev_swig_ptr'.\n" - " Possible C/C++ prototypes are:\n" - " rev_swig_ptr(float *,size_t)\n" - " rev_swig_ptr(int *,size_t)\n" - " rev_swig_ptr(unsigned char *,size_t)\n" - " rev_swig_ptr(unsigned long *,size_t)\n" - " rev_swig_ptr(long *,size_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< float,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< float,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_minheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< float,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_minheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< float,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_minheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_minheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *,faiss::HeapArray< faiss::CMin< float,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMin< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_minheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_minheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< float,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMin< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_minheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_minheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< float,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMin< float,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_float_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_float_minheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMin< float,long > > *)new faiss::HeapArray< faiss::CMin< float,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_float_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< float,long > > *arg1 = (faiss::HeapArray< faiss::CMin< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_float_minheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_float_minheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< float,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *float_minheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMin< int,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< int,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_minheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMin< int,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_minheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_minheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMin< int,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMin< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_minheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_minheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *,faiss::HeapArray< faiss::CMin< int,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMin< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMin< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_minheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_minheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMin< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMin< int,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMin< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_minheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_minheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMin< int,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMin< int,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_int_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_int_minheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMin< int,long > > *)new faiss::HeapArray< faiss::CMin< int,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_int_minheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMin< int,long > > *arg1 = (faiss::HeapArray< faiss::CMin< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_int_minheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_int_minheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMin< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMin< int,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *int_minheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< float,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< float,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:float_maxheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< float,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "float_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_maxheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< float,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< float,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_float_maxheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'float_maxheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *,faiss::HeapArray< faiss::CMax< float,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMax< float,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< float,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:float_maxheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_float_maxheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< float,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< float,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMax< float,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:float_maxheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "float_maxheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< float,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMax< float,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_float_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_float_maxheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMax< float,long > > *)new faiss::HeapArray< faiss::CMax< float,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_float_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< float,long > > *arg1 = (faiss::HeapArray< faiss::CMax< float,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_float_maxheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_float_maxheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< float,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< float,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *float_maxheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_nh_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_nh_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_nh_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_nh_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nh = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_nh_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_nh_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_nh_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (size_t) ((arg1)->nh); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_k_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_k_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_k_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->k = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_k_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_k_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (size_t) ((arg1)->k); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_ids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_ids_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_ids_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_ids_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp2); - if (arg1) (arg1)->ids = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_ids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_ids_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_ids_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) ((arg1)->ids); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_val_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_val_set" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_val_set" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp2); - if (arg1) (arg1)->val = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_val_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_val_get" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - result = (faiss::HeapArray< faiss::CMax< int,long > >::T *) ((arg1)->val); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_get_val(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_get_val",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_get_val" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_get_val" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< int,long > >::T *)(arg1)->get_val(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_get_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:int_maxheap_array_t_get_ids",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_get_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_get_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (faiss::HeapArray< faiss::CMax< int,long > >::TI *)(arg1)->get_ids(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_heapify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_heapify",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_heapify" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - (arg1)->heapify(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - size_t arg5 ; - long arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - long val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - ecode6 = SWIG_AsVal_long(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn" "', argument " "6"" of type '" "long""'"); - } - arg6 = static_cast< long >(val6); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - size_t arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - size_t val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - ecode5 = SWIG_AsVal_size_t(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn" "', argument " "5"" of type '" "size_t""'"); - } - arg5 = static_cast< size_t >(val5); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - long val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - ecode4 = SWIG_AsVal_long(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "int_maxheap_array_t_addn" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI""'"); - } - arg4 = static_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI >(val4); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_addn",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - (arg1)->addn(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[7] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 6) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_3(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_2(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_maxheap_array_t_addn'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI,size_t)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - long arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - long val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - ecode7 = SWIG_AsVal_long(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "7"" of type '" "long""'"); - } - arg7 = static_cast< long >(val7); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - size_t arg6 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - size_t val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - ecode6 = SWIG_AsVal_size_t(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "6"" of type '" "size_t""'"); - } - arg6 = static_cast< size_t >(val6); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5,arg6); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - long arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - long val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg4 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "4"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI const *""'"); - } - arg4 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp4); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3,(faiss::HeapArray< faiss::CMax< int,long > >::TI const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - size_t arg2 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_addn_with_ids",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_addn_with_ids" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T const *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp3); - (arg1)->addn_with_ids(arg2,(faiss::HeapArray< faiss::CMax< int,long > >::T const *)arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_addn_with_ids(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[8] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 7) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_4(self, args); - } - } - } - } - if (argc == 4) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_3(self, args); - } - } - } - } - } - if (argc == 5) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_2(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_1(self, args); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_long(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_long(argv[6], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_int_maxheap_array_t_addn_with_ids__SWIG_0(self, args); - } - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'int_maxheap_array_t_addn_with_ids'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long,size_t,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long,size_t)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *,long)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *,faiss::HeapArray< faiss::CMax< int,long > >::TI const *)\n" - " faiss::HeapArray< faiss::CMax< int,long > >::addn_with_ids(size_t,faiss::HeapArray< faiss::CMax< int,long > >::T const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_reorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:int_maxheap_array_t_reorder",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_reorder" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - (arg1)->reorder(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_int_maxheap_array_t_per_line_extrema(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::T *arg2 = (faiss::HeapArray< faiss::CMax< int,long > >::T *) 0 ; - faiss::HeapArray< faiss::CMax< int,long > >::TI *arg3 = (faiss::HeapArray< faiss::CMax< int,long > >::TI *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:int_maxheap_array_t_per_line_extrema",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > const *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "2"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::T *""'"); - } - arg2 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::T * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "int_maxheap_array_t_per_line_extrema" "', argument " "3"" of type '" "faiss::HeapArray< faiss::CMax< int,long > >::TI *""'"); - } - arg3 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > >::TI * >(argp3); - ((faiss::HeapArray< faiss::CMax< int,long > > const *)arg1)->per_line_extrema(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_int_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_int_maxheap_array_t")) SWIG_fail; - result = (faiss::HeapArray< faiss::CMax< int,long > > *)new faiss::HeapArray< faiss::CMax< int,long > >(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_int_maxheap_array_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::HeapArray< faiss::CMax< int,long > > *arg1 = (faiss::HeapArray< faiss::CMax< int,long > > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_int_maxheap_array_t",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_int_maxheap_array_t" "', argument " "1"" of type '" "faiss::HeapArray< faiss::CMax< int,long > > *""'"); - } - arg1 = reinterpret_cast< faiss::HeapArray< faiss::CMax< int,long > > * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *int_maxheap_array_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_omp_set_num_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:omp_set_num_threads",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "omp_set_num_threads" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - omp_set_num_threads(arg1); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_omp_get_max_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int result; - - if (!PyArg_ParseTuple(args,(char *)":omp_get_max_threads")) SWIG_fail; - result = (int)omp_get_max_threads(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_memcpy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - int res1 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - void *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:memcpy",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "memcpy" "', argument " "1"" of type '" "void *""'"); - } - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "memcpy" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "memcpy" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (void *)memcpy(arg1,(void const *)arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_float_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_float_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_float_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (float *)cast_integer_to_float_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_long_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_long_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_long_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (long *)cast_integer_to_long_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_cast_integer_to_int_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:cast_integer_to_int_ptr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cast_integer_to_int_ptr" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (int *)cast_integer_to_int_ptr(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_nq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_nq_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_nq_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchResult_nq_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nq = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_nq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_nq_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_nq_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t) ((arg1)->nq); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_lims_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t *arg2 = (size_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_lims_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_lims_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_lims_set" "', argument " "2"" of type '" "size_t *""'"); - } - arg2 = reinterpret_cast< size_t * >(argp2); - if (arg1) (arg1)->lims = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_lims_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_lims_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_lims_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t *) ((arg1)->lims); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_labels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - faiss::RangeSearchResult::idx_t *arg2 = (faiss::RangeSearchResult::idx_t *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_labels_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_labels_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_labels_set" "', argument " "2"" of type '" "faiss::RangeSearchResult::idx_t *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchResult::idx_t * >(argp2); - if (arg1) (arg1)->labels = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_labels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult::idx_t *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_labels_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_labels_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (faiss::RangeSearchResult::idx_t *) ((arg1)->labels); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_distances_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - float *arg2 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_distances_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_distances_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchResult_distances_set" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - if (arg1) (arg1)->distances = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_distances_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - float *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_distances_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_distances_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (float *) ((arg1)->distances); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_buffer_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchResult_buffer_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_buffer_size_set" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchResult_buffer_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->buffer_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_buffer_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_buffer_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_buffer_size_get" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (size_t) ((arg1)->buffer_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult::idx_t arg1 ; - bool arg2 ; - long val1 ; - int ecode1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_RangeSearchResult",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult::idx_t""'"); - } - arg1 = static_cast< faiss::RangeSearchResult::idx_t >(val1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangeSearchResult" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - result = (faiss::RangeSearchResult *)new faiss::RangeSearchResult(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult::idx_t arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RangeSearchResult",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult::idx_t""'"); - } - arg1 = static_cast< faiss::RangeSearchResult::idx_t >(val1); - result = (faiss::RangeSearchResult *)new faiss::RangeSearchResult(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchResult(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangeSearchResult__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_long(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangeSearchResult__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RangeSearchResult'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RangeSearchResult::RangeSearchResult(faiss::RangeSearchResult::idx_t,bool)\n" - " faiss::RangeSearchResult::RangeSearchResult(faiss::RangeSearchResult::idx_t)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchResult_do_allocation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchResult_do_allocation",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchResult_do_allocation" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - (arg1)->do_allocation(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeSearchResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeSearchResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeSearchResult" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeSearchResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeSearchResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelector_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector *arg1 = (faiss::IDSelector *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelector_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelector, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelector_is_member" "', argument " "1"" of type '" "faiss::IDSelector const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelector * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelector_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelector const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector *arg1 = (faiss::IDSelector *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelector",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelector, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelector" "', argument " "1"" of type '" "faiss::IDSelector *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelector * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelector, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imin_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_imin_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imin_set" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_imin_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->imin = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imin_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorRange_imin_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imin_get" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->imin); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imax_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_imax_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imax_set" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_imax_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->imax = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_imax_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorRange_imax_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_imax_get" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->imax); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IDSelectorRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelector::idx_t arg1 ; - faiss::IDSelector::idx_t arg2 ; - long val1 ; - int ecode1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IDSelectorRange *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IDSelectorRange",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IDSelectorRange" "', argument " "1"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg1 = static_cast< faiss::IDSelector::idx_t >(val1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IDSelectorRange" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (faiss::IDSelectorRange *)new faiss::IDSelectorRange(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IDSelectorRange, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorRange_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorRange_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorRange_is_member" "', argument " "1"" of type '" "faiss::IDSelectorRange const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorRange_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelectorRange const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelectorRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorRange *arg1 = (faiss::IDSelectorRange *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelectorRange",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorRange, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelectorRange" "', argument " "1"" of type '" "faiss::IDSelectorRange *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorRange * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelectorRange_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelectorRange, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_nbits_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_nbits_set" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_nbits_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->nbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorBatch_nbits_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_nbits_get" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - result = (int) ((arg1)->nbits); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_mask_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_mask_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_mask_set" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_mask_set" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - if (arg1) (arg1)->mask = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_mask_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::IDSelector::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:IDSelectorBatch_mask_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_mask_get" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - result = (faiss::IDSelector::idx_t) ((arg1)->mask); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_IDSelectorBatch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - long arg1 ; - faiss::IDSelector::idx_t *arg2 = (faiss::IDSelector::idx_t *) 0 ; - long val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::IDSelectorBatch *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_IDSelectorBatch",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IDSelectorBatch" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IDSelectorBatch" "', argument " "2"" of type '" "faiss::IDSelector::idx_t const *""'"); - } - arg2 = reinterpret_cast< faiss::IDSelector::idx_t * >(argp2); - result = (faiss::IDSelectorBatch *)new faiss::IDSelectorBatch(arg1,(faiss::IDSelector::idx_t const *)arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IDSelectorBatch_is_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - faiss::IDSelector::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"OO:IDSelectorBatch_is_member",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDSelectorBatch_is_member" "', argument " "1"" of type '" "faiss::IDSelectorBatch const *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IDSelectorBatch_is_member" "', argument " "2"" of type '" "faiss::IDSelector::idx_t""'"); - } - arg2 = static_cast< faiss::IDSelector::idx_t >(val2); - result = (bool)((faiss::IDSelectorBatch const *)arg1)->is_member(arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IDSelectorBatch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IDSelectorBatch *arg1 = (faiss::IDSelectorBatch *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IDSelectorBatch",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IDSelectorBatch" "', argument " "1"" of type '" "faiss::IDSelectorBatch *""'"); - } - arg1 = reinterpret_cast< faiss::IDSelectorBatch * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IDSelectorBatch_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IDSelectorBatch, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_BufferList_buffer_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_buffer_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffer_size_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_buffer_size_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->buffer_size = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffer_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_buffer_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffer_size_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (size_t) ((arg1)->buffer_size); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffers_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - std::vector< faiss::BufferList::Buffer > *arg2 = (std::vector< faiss::BufferList::Buffer > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_buffers_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffers_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BufferList_buffers_set" "', argument " "2"" of type '" "std::vector< faiss::BufferList::Buffer > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::BufferList::Buffer > * >(argp2); - if (arg1) (arg1)->buffers = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_buffers_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::BufferList::Buffer > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_buffers_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_buffers_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (std::vector< faiss::BufferList::Buffer > *)& ((arg1)->buffers); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_wp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BufferList_wp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_wp_set" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_wp_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->wp = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_wp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_wp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_wp_get" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - result = (size_t) ((arg1)->wp); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_BufferList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - faiss::BufferList *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_BufferList",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_BufferList" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - result = (faiss::BufferList *)new faiss::BufferList(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__BufferList, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_BufferList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_BufferList",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BufferList" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_append_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BufferList_append_buffer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_append_buffer" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - (arg1)->append_buffer(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - faiss::BufferList::idx_t arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:BufferList_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_add" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_add" "', argument " "2"" of type '" "faiss::BufferList::idx_t""'"); - } - arg2 = static_cast< faiss::BufferList::idx_t >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BufferList_add" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - (arg1)->add(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BufferList_copy_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::BufferList *arg1 = (faiss::BufferList *) 0 ; - size_t arg2 ; - size_t arg3 ; - faiss::BufferList::idx_t *arg4 = (faiss::BufferList::idx_t *) 0 ; - float *arg5 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:BufferList_copy_range",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__BufferList, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BufferList_copy_range" "', argument " "1"" of type '" "faiss::BufferList *""'"); - } - arg1 = reinterpret_cast< faiss::BufferList * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BufferList_copy_range" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BufferList_copy_range" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "BufferList_copy_range" "', argument " "4"" of type '" "faiss::BufferList::idx_t *""'"); - } - arg4 = reinterpret_cast< faiss::BufferList::idx_t * >(argp4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "BufferList_copy_range" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - (arg1)->copy_range(arg2,arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *BufferList_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__BufferList, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RangeQueryResult_qno_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - faiss::RangeQueryResult::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_qno_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_qno_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_qno_set" "', argument " "2"" of type '" "faiss::RangeQueryResult::idx_t""'"); - } - arg2 = static_cast< faiss::RangeQueryResult::idx_t >(val2); - if (arg1) (arg1)->qno = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_qno_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeQueryResult::idx_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_qno_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_qno_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (faiss::RangeQueryResult::idx_t) ((arg1)->qno); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_nres_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_nres_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_nres_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_nres_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->nres = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_nres_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_nres_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_nres_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (size_t) ((arg1)->nres); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_pres_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - faiss::RangeSearchPartialResult *arg2 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeQueryResult_pres_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_pres_set" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeQueryResult_pres_set" "', argument " "2"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp2); - if (arg1) (arg1)->pres = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_pres_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchPartialResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeQueryResult_pres_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_pres_get" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - result = (faiss::RangeSearchPartialResult *) ((arg1)->pres); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeQueryResult_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - float arg2 ; - faiss::RangeQueryResult::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:RangeQueryResult_add",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeQueryResult_add" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeQueryResult_add" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RangeQueryResult_add" "', argument " "3"" of type '" "faiss::RangeQueryResult::idx_t""'"); - } - arg3 = static_cast< faiss::RangeQueryResult::idx_t >(val3); - (arg1)->add(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeQueryResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_RangeQueryResult")) SWIG_fail; - result = (faiss::RangeQueryResult *)new faiss::RangeQueryResult(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeQueryResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeQueryResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeQueryResult *arg1 = (faiss::RangeQueryResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeQueryResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeQueryResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeQueryResult" "', argument " "1"" of type '" "faiss::RangeQueryResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeQueryResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeQueryResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeQueryResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_res_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - faiss::RangeSearchResult *arg2 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_res_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_res_set" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__RangeSearchResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchPartialResult_res_set" "', argument " "2"" of type '" "faiss::RangeSearchResult *""'"); - } - arg2 = reinterpret_cast< faiss::RangeSearchResult * >(argp2); - if (arg1) (arg1)->res = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_res_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_res_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_res_get" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - result = (faiss::RangeSearchResult *) ((arg1)->res); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangeSearchPartialResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchResult *arg1 = (faiss::RangeSearchResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - faiss::RangeSearchPartialResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_RangeSearchPartialResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_RangeSearchPartialResult" "', argument " "1"" of type '" "faiss::RangeSearchResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchResult * >(argp1); - result = (faiss::RangeSearchPartialResult *)new faiss::RangeSearchPartialResult(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_queries_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - std::vector< faiss::RangeQueryResult > *arg2 = (std::vector< faiss::RangeQueryResult > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_queries_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_queries_set" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RangeSearchPartialResult_queries_set" "', argument " "2"" of type '" "std::vector< faiss::RangeQueryResult > *""'"); - } - arg2 = reinterpret_cast< std::vector< faiss::RangeQueryResult > * >(argp2); - if (arg1) (arg1)->queries = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_queries_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< faiss::RangeQueryResult > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_queries_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_queries_get" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - result = (std::vector< faiss::RangeQueryResult > *)& ((arg1)->queries); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_new_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - faiss::BufferList::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - faiss::RangeQueryResult *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_new_result",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_new_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchPartialResult_new_result" "', argument " "2"" of type '" "faiss::BufferList::idx_t""'"); - } - arg2 = static_cast< faiss::BufferList::idx_t >(val2); - result = (faiss::RangeQueryResult *) &(arg1)->new_result(arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeQueryResult, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_finalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_finalize",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_finalize" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->finalize(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_lims(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_set_lims",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_lims" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->set_lims(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:RangeSearchPartialResult_set_result",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RangeSearchPartialResult_set_result" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - (arg1)->set_result(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:RangeSearchPartialResult_set_result",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RangeSearchPartialResult_set_result" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - (arg1)->set_result(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_RangeSearchPartialResult_set_result(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; - Py_ssize_t ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RangeSearchPartialResult, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_RangeSearchPartialResult_set_result__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RangeSearchPartialResult, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_RangeSearchPartialResult_set_result__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'RangeSearchPartialResult_set_result'.\n" - " Possible C/C++ prototypes are:\n" - " faiss::RangeSearchPartialResult::set_result(bool)\n" - " faiss::RangeSearchPartialResult::set_result()\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_delete_RangeSearchPartialResult(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::RangeSearchPartialResult *arg1 = (faiss::RangeSearchPartialResult *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_RangeSearchPartialResult",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RangeSearchPartialResult" "', argument " "1"" of type '" "faiss::RangeSearchPartialResult *""'"); - } - arg1 = reinterpret_cast< faiss::RangeSearchPartialResult * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *RangeSearchPartialResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RangeSearchPartialResult, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IOReader_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IOReader_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_name_set" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOReader_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IOReader_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IOReader_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_name_get" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IOReader___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader___call__" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOReader___call__" "', argument " "2"" of type '" "void *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOReader___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOReader___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()(arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOReader_fileno(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IOReader_fileno",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOReader_fileno" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - result = (int)(arg1)->fileno(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOReader *arg1 = (faiss::IOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IOReader",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOReader, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOReader" "', argument " "1"" of type '" "faiss::IOReader *""'"); - } - arg1 = reinterpret_cast< faiss::IOReader * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IOReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IOReader, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_IOWriter_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - std::string *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 = SWIG_OLDOBJ ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:IOWriter_name_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_name_set" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(obj1, &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOWriter_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IOWriter_name_set" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } - if (arg1) (arg1)->name = *arg2; - resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; - return resultobj; -fail: - if (SWIG_IsNewObj(res2)) delete arg2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::string *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:IOWriter_name_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_name_get" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - result = (std::string *) & ((arg1)->name); - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:IOWriter___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter___call__" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOWriter___call__" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOWriter___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOWriter___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()((void const *)arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOWriter_fileno(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if (!PyArg_ParseTuple(args,(char *)"O:IOWriter_fileno",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOWriter_fileno" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - result = (int)(arg1)->fileno(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::IOWriter *arg1 = (faiss::IOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_IOWriter",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IOWriter, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOWriter" "', argument " "1"" of type '" "faiss::IOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::IOWriter * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *IOWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IOWriter, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorIOReader_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOReader_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_data_set" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOReader_data_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->data = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOReader_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_data_get" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->data); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_rp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - size_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOReader_rp_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_rp_set" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorIOReader_rp_set" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - if (arg1) (arg1)->rp = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader_rp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOReader_rp_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader_rp_get" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - result = (size_t) ((arg1)->rp); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOReader___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorIOReader___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOReader___call__" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOReader___call__" "', argument " "2"" of type '" "void *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorIOReader___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorIOReader___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()(arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VectorIOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorIOReader")) SWIG_fail; - result = (faiss::VectorIOReader *)new faiss::VectorIOReader(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorIOReader, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorIOReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOReader *arg1 = (faiss::VectorIOReader *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorIOReader",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOReader, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorIOReader" "', argument " "1"" of type '" "faiss::VectorIOReader *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOReader * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorIOReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorIOReader, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_VectorIOWriter_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - std::vector< uint8_t > *arg2 = (std::vector< uint8_t > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:VectorIOWriter_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter_data_set" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOWriter_data_set" "', argument " "2"" of type '" "std::vector< uint8_t > *""'"); - } - arg2 = reinterpret_cast< std::vector< uint8_t > * >(argp2); - if (arg1) (arg1)->data = *arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOWriter_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::vector< uint8_t > *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:VectorIOWriter_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter_data_get" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - result = (std::vector< uint8_t > *)& ((arg1)->data); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_VectorIOWriter___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - size_t arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - size_t val3 ; - int ecode3 = 0 ; - size_t val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorIOWriter___call__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorIOWriter___call__" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorIOWriter___call__" "', argument " "2"" of type '" "void const *""'"); - } - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorIOWriter___call__" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_size_t(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorIOWriter___call__" "', argument " "4"" of type '" "size_t""'"); - } - arg4 = static_cast< size_t >(val4); - result = (size_t)(arg1)->operator ()((void const *)arg2,arg3,arg4); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_VectorIOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_VectorIOWriter")) SWIG_fail; - result = (faiss::VectorIOWriter *)new faiss::VectorIOWriter(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorIOWriter, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_VectorIOWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::VectorIOWriter *arg1 = (faiss::VectorIOWriter *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorIOWriter",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorIOWriter, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorIOWriter" "', argument " "1"" of type '" "faiss::VectorIOWriter *""'"); - } - arg1 = reinterpret_cast< faiss::VectorIOWriter * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *VectorIOWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorIOWriter, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_DistanceComputer_set_query(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - float *arg2 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DistanceComputer_set_query",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer_set_query" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DistanceComputer_set_query" "', argument " "2"" of type '" "float const *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - (arg1)->set_query((float const *)arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DistanceComputer___call__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - faiss::DistanceComputer::idx_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OO:DistanceComputer___call__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer___call__" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DistanceComputer___call__" "', argument " "2"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg2 = static_cast< faiss::DistanceComputer::idx_t >(val2); - result = (float)(arg1)->operator ()(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DistanceComputer_symmetric_dis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - faiss::DistanceComputer::idx_t arg2 ; - faiss::DistanceComputer::idx_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - float result; - - if (!PyArg_ParseTuple(args,(char *)"OOO:DistanceComputer_symmetric_dis",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DistanceComputer_symmetric_dis" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DistanceComputer_symmetric_dis" "', argument " "2"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg2 = static_cast< faiss::DistanceComputer::idx_t >(val2); - ecode3 = SWIG_AsVal_long(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DistanceComputer_symmetric_dis" "', argument " "3"" of type '" "faiss::DistanceComputer::idx_t""'"); - } - arg3 = static_cast< faiss::DistanceComputer::idx_t >(val3); - result = (float)(arg1)->symmetric_dis(arg2,arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DistanceComputer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::DistanceComputer *arg1 = (faiss::DistanceComputer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DistanceComputer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__DistanceComputer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DistanceComputer" "', argument " "1"" of type '" "faiss::DistanceComputer *""'"); - } - arg1 = reinterpret_cast< faiss::DistanceComputer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *DistanceComputer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__DistanceComputer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_InterruptCallback_want_interrupt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InterruptCallback *arg1 = (faiss::InterruptCallback *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if (!PyArg_ParseTuple(args,(char *)"O:InterruptCallback_want_interrupt",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InterruptCallback, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InterruptCallback_want_interrupt" "', argument " "1"" of type '" "faiss::InterruptCallback *""'"); - } - arg1 = reinterpret_cast< faiss::InterruptCallback * >(argp1); - result = (bool)(arg1)->want_interrupt(); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_InterruptCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - faiss::InterruptCallback *arg1 = (faiss::InterruptCallback *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_InterruptCallback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__InterruptCallback, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InterruptCallback" "', argument " "1"" of type '" "faiss::InterruptCallback *""'"); - } - arg1 = reinterpret_cast< faiss::InterruptCallback * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_check(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - - if (!PyArg_ParseTuple(args,(char *)":InterruptCallback_check")) SWIG_fail; - faiss::InterruptCallback::check(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_is_interrupted(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool result; - - if (!PyArg_ParseTuple(args,(char *)":InterruptCallback_is_interrupted")) SWIG_fail; - result = (bool)faiss::InterruptCallback::is_interrupted(); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_InterruptCallback_get_period_hint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - size_t arg1 ; - size_t val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - size_t result; - - if (!PyArg_ParseTuple(args,(char *)"O:InterruptCallback_get_period_hint",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "InterruptCallback_get_period_hint" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - result = (size_t)faiss::InterruptCallback::get_period_hint(arg1); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *InterruptCallback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_faiss__InterruptCallback, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ignore_SIGTTIN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - - if (!PyArg_ParseTuple(args,(char *)":ignore_SIGTTIN")) SWIG_fail; - ignore_SIGTTIN(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - std::unordered_map< long,long > arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:MapLong2Long_map_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_map_set" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__unordered_mapT_long_long_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MapLong2Long_map_set" "', argument " "2"" of type '" "std::unordered_map< long,long >""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MapLong2Long_map_set" "', argument " "2"" of type '" "std::unordered_map< long,long >""'"); - } else { - std::unordered_map< long,long > * temp = reinterpret_cast< std::unordered_map< long,long > * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->map = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - std::unordered_map< long,long > result; - - if (!PyArg_ParseTuple(args,(char *)"O:MapLong2Long_map_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_map_get" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - result = ((arg1)->map); - resultobj = SWIG_NewPointerObj((new std::unordered_map< long,long >(static_cast< const std::unordered_map< long,long >& >(result))), SWIGTYPE_p_std__unordered_mapT_long_long_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:MapLong2Long_add",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_add" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_add" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MapLong2Long_add" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MapLong2Long_add" "', argument " "4"" of type '" "long const *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - (arg1)->add(arg2,(long const *)arg3,(long const *)arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - long arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; - - if (!PyArg_ParseTuple(args,(char *)"OO:MapLong2Long_search",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_search" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_search" "', argument " "2"" of type '" "long""'"); - } - arg2 = static_cast< long >(val2); - result = (long)(arg1)->search(arg2); - resultobj = SWIG_From_long(static_cast< long >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_MapLong2Long_search_multiple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - size_t arg2 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:MapLong2Long_search_multiple",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MapLong2Long_search_multiple" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapLong2Long_search_multiple" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MapLong2Long_search_multiple" "', argument " "3"" of type '" "long const *""'"); - } - arg3 = reinterpret_cast< long * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MapLong2Long_search_multiple" "', argument " "4"" of type '" "long *""'"); - } - arg4 = reinterpret_cast< long * >(argp4); - (arg1)->search_multiple(arg2,(long const *)arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_MapLong2Long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_MapLong2Long")) SWIG_fail; - result = (MapLong2Long *)new MapLong2Long(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MapLong2Long, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_MapLong2Long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - MapLong2Long *arg1 = (MapLong2Long *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_MapLong2Long",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MapLong2Long, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MapLong2Long" "', argument " "1"" of type '" "MapLong2Long *""'"); - } - arg1 = reinterpret_cast< MapLong2Long * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *MapLong2Long_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_MapLong2Long, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"new_FloatVector", _wrap_new_FloatVector, METH_VARARGS, NULL}, - { (char *)"FloatVector_push_back", _wrap_FloatVector_push_back, METH_VARARGS, NULL}, - { (char *)"FloatVector_clear", _wrap_FloatVector_clear, METH_VARARGS, NULL}, - { (char *)"FloatVector_data", _wrap_FloatVector_data, METH_VARARGS, NULL}, - { (char *)"FloatVector_size", _wrap_FloatVector_size, METH_VARARGS, NULL}, - { (char *)"FloatVector_at", _wrap_FloatVector_at, METH_VARARGS, NULL}, - { (char *)"FloatVector_resize", _wrap_FloatVector_resize, METH_VARARGS, NULL}, - { (char *)"FloatVector_swap", _wrap_FloatVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_FloatVector", _wrap_delete_FloatVector, METH_VARARGS, NULL}, - { (char *)"FloatVector_swigregister", FloatVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_DoubleVector", _wrap_new_DoubleVector, METH_VARARGS, NULL}, - { (char *)"DoubleVector_push_back", _wrap_DoubleVector_push_back, METH_VARARGS, NULL}, - { (char *)"DoubleVector_clear", _wrap_DoubleVector_clear, METH_VARARGS, NULL}, - { (char *)"DoubleVector_data", _wrap_DoubleVector_data, METH_VARARGS, NULL}, - { (char *)"DoubleVector_size", _wrap_DoubleVector_size, METH_VARARGS, NULL}, - { (char *)"DoubleVector_at", _wrap_DoubleVector_at, METH_VARARGS, NULL}, - { (char *)"DoubleVector_resize", _wrap_DoubleVector_resize, METH_VARARGS, NULL}, - { (char *)"DoubleVector_swap", _wrap_DoubleVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_DoubleVector", _wrap_delete_DoubleVector, METH_VARARGS, NULL}, - { (char *)"DoubleVector_swigregister", DoubleVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_ByteVector", _wrap_new_ByteVector, METH_VARARGS, NULL}, - { (char *)"ByteVector_push_back", _wrap_ByteVector_push_back, METH_VARARGS, NULL}, - { (char *)"ByteVector_clear", _wrap_ByteVector_clear, METH_VARARGS, NULL}, - { (char *)"ByteVector_data", _wrap_ByteVector_data, METH_VARARGS, NULL}, - { (char *)"ByteVector_size", _wrap_ByteVector_size, METH_VARARGS, NULL}, - { (char *)"ByteVector_at", _wrap_ByteVector_at, METH_VARARGS, NULL}, - { (char *)"ByteVector_resize", _wrap_ByteVector_resize, METH_VARARGS, NULL}, - { (char *)"ByteVector_swap", _wrap_ByteVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_ByteVector", _wrap_delete_ByteVector, METH_VARARGS, NULL}, - { (char *)"ByteVector_swigregister", ByteVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_CharVector", _wrap_new_CharVector, METH_VARARGS, NULL}, - { (char *)"CharVector_push_back", _wrap_CharVector_push_back, METH_VARARGS, NULL}, - { (char *)"CharVector_clear", _wrap_CharVector_clear, METH_VARARGS, NULL}, - { (char *)"CharVector_data", _wrap_CharVector_data, METH_VARARGS, NULL}, - { (char *)"CharVector_size", _wrap_CharVector_size, METH_VARARGS, NULL}, - { (char *)"CharVector_at", _wrap_CharVector_at, METH_VARARGS, NULL}, - { (char *)"CharVector_resize", _wrap_CharVector_resize, METH_VARARGS, NULL}, - { (char *)"CharVector_swap", _wrap_CharVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_CharVector", _wrap_delete_CharVector, METH_VARARGS, NULL}, - { (char *)"CharVector_swigregister", CharVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_Uint64Vector", _wrap_new_Uint64Vector, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_push_back", _wrap_Uint64Vector_push_back, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_clear", _wrap_Uint64Vector_clear, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_data", _wrap_Uint64Vector_data, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_size", _wrap_Uint64Vector_size, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_at", _wrap_Uint64Vector_at, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_resize", _wrap_Uint64Vector_resize, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_swap", _wrap_Uint64Vector_swap, METH_VARARGS, NULL}, - { (char *)"delete_Uint64Vector", _wrap_delete_Uint64Vector, METH_VARARGS, NULL}, - { (char *)"Uint64Vector_swigregister", Uint64Vector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_LongVector", _wrap_new_LongVector, METH_VARARGS, NULL}, - { (char *)"LongVector_push_back", _wrap_LongVector_push_back, METH_VARARGS, NULL}, - { (char *)"LongVector_clear", _wrap_LongVector_clear, METH_VARARGS, NULL}, - { (char *)"LongVector_data", _wrap_LongVector_data, METH_VARARGS, NULL}, - { (char *)"LongVector_size", _wrap_LongVector_size, METH_VARARGS, NULL}, - { (char *)"LongVector_at", _wrap_LongVector_at, METH_VARARGS, NULL}, - { (char *)"LongVector_resize", _wrap_LongVector_resize, METH_VARARGS, NULL}, - { (char *)"LongVector_swap", _wrap_LongVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_LongVector", _wrap_delete_LongVector, METH_VARARGS, NULL}, - { (char *)"LongVector_swigregister", LongVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IntVector", _wrap_new_IntVector, METH_VARARGS, NULL}, - { (char *)"IntVector_push_back", _wrap_IntVector_push_back, METH_VARARGS, NULL}, - { (char *)"IntVector_clear", _wrap_IntVector_clear, METH_VARARGS, NULL}, - { (char *)"IntVector_data", _wrap_IntVector_data, METH_VARARGS, NULL}, - { (char *)"IntVector_size", _wrap_IntVector_size, METH_VARARGS, NULL}, - { (char *)"IntVector_at", _wrap_IntVector_at, METH_VARARGS, NULL}, - { (char *)"IntVector_resize", _wrap_IntVector_resize, METH_VARARGS, NULL}, - { (char *)"IntVector_swap", _wrap_IntVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_IntVector", _wrap_delete_IntVector, METH_VARARGS, NULL}, - { (char *)"IntVector_swigregister", IntVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_VectorTransformVector", _wrap_new_VectorTransformVector, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_push_back", _wrap_VectorTransformVector_push_back, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_clear", _wrap_VectorTransformVector_clear, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_data", _wrap_VectorTransformVector_data, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_size", _wrap_VectorTransformVector_size, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_at", _wrap_VectorTransformVector_at, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_resize", _wrap_VectorTransformVector_resize, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_swap", _wrap_VectorTransformVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_VectorTransformVector", _wrap_delete_VectorTransformVector, METH_VARARGS, NULL}, - { (char *)"VectorTransformVector_swigregister", VectorTransformVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_OperatingPointVector", _wrap_new_OperatingPointVector, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_push_back", _wrap_OperatingPointVector_push_back, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_clear", _wrap_OperatingPointVector_clear, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_data", _wrap_OperatingPointVector_data, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_size", _wrap_OperatingPointVector_size, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_at", _wrap_OperatingPointVector_at, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_resize", _wrap_OperatingPointVector_resize, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_swap", _wrap_OperatingPointVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPointVector", _wrap_delete_OperatingPointVector, METH_VARARGS, NULL}, - { (char *)"OperatingPointVector_swigregister", OperatingPointVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_InvertedListsPtrVector", _wrap_new_InvertedListsPtrVector, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_push_back", _wrap_InvertedListsPtrVector_push_back, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_clear", _wrap_InvertedListsPtrVector_clear, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_data", _wrap_InvertedListsPtrVector_data, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_size", _wrap_InvertedListsPtrVector_size, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_at", _wrap_InvertedListsPtrVector_at, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_resize", _wrap_InvertedListsPtrVector_resize, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_swap", _wrap_InvertedListsPtrVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_InvertedListsPtrVector", _wrap_delete_InvertedListsPtrVector, METH_VARARGS, NULL}, - { (char *)"InvertedListsPtrVector_swigregister", InvertedListsPtrVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_FloatVectorVector", _wrap_new_FloatVectorVector, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_push_back", _wrap_FloatVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_clear", _wrap_FloatVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_data", _wrap_FloatVectorVector_data, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_size", _wrap_FloatVectorVector_size, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_at", _wrap_FloatVectorVector_at, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_resize", _wrap_FloatVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_swap", _wrap_FloatVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_FloatVectorVector", _wrap_delete_FloatVectorVector, METH_VARARGS, NULL}, - { (char *)"FloatVectorVector_swigregister", FloatVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_ByteVectorVector", _wrap_new_ByteVectorVector, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_push_back", _wrap_ByteVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_clear", _wrap_ByteVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_data", _wrap_ByteVectorVector_data, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_size", _wrap_ByteVectorVector_size, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_at", _wrap_ByteVectorVector_at, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_resize", _wrap_ByteVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_swap", _wrap_ByteVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_ByteVectorVector", _wrap_delete_ByteVectorVector, METH_VARARGS, NULL}, - { (char *)"ByteVectorVector_swigregister", ByteVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"new_LongVectorVector", _wrap_new_LongVectorVector, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_push_back", _wrap_LongVectorVector_push_back, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_clear", _wrap_LongVectorVector_clear, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_data", _wrap_LongVectorVector_data, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_size", _wrap_LongVectorVector_size, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_at", _wrap_LongVectorVector_at, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_resize", _wrap_LongVectorVector_resize, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_swap", _wrap_LongVectorVector_swap, METH_VARARGS, NULL}, - { (char *)"delete_LongVectorVector", _wrap_delete_LongVectorVector, METH_VARARGS, NULL}, - { (char *)"LongVectorVector_swigregister", LongVectorVector_swigregister, METH_VARARGS, NULL}, - { (char *)"popcount64", _wrap_popcount64, METH_VARARGS, NULL}, - { (char *)"hammings", _wrap_hammings, METH_VARARGS, NULL}, - { (char *)"bitvec_print", _wrap_bitvec_print, METH_VARARGS, NULL}, - { (char *)"fvecs2bitvecs", _wrap_fvecs2bitvecs, METH_VARARGS, NULL}, - { (char *)"fvec2bitvec", _wrap_fvec2bitvec, METH_VARARGS, NULL}, - { (char *)"hammings_knn_hc", _wrap_hammings_knn_hc, METH_VARARGS, NULL}, - { (char *)"hammings_knn", _wrap_hammings_knn, METH_VARARGS, NULL}, - { (char *)"hammings_knn_mc", _wrap_hammings_knn_mc, METH_VARARGS, NULL}, - { (char *)"hamming_count_thres", _wrap_hamming_count_thres, METH_VARARGS, NULL}, - { (char *)"match_hamming_thres", _wrap_match_hamming_thres, METH_VARARGS, NULL}, - { (char *)"crosshamming_count_thres", _wrap_crosshamming_count_thres, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_a0_set", _wrap_HammingComputer4_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_a0_get", _wrap_HammingComputer4_a0_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer4", _wrap_new_HammingComputer4, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_set", _wrap_HammingComputer4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_hamming", _wrap_HammingComputer4_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer4", _wrap_delete_HammingComputer4, METH_VARARGS, NULL}, - { (char *)"HammingComputer4_swigregister", HammingComputer4_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_a0_set", _wrap_HammingComputer8_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_a0_get", _wrap_HammingComputer8_a0_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer8", _wrap_new_HammingComputer8, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_set", _wrap_HammingComputer8_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_hamming", _wrap_HammingComputer8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer8", _wrap_delete_HammingComputer8, METH_VARARGS, NULL}, - { (char *)"HammingComputer8_swigregister", HammingComputer8_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a0_set", _wrap_HammingComputer16_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a0_get", _wrap_HammingComputer16_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a1_set", _wrap_HammingComputer16_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_a1_get", _wrap_HammingComputer16_a1_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer16", _wrap_new_HammingComputer16, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_set", _wrap_HammingComputer16_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_hamming", _wrap_HammingComputer16_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer16", _wrap_delete_HammingComputer16, METH_VARARGS, NULL}, - { (char *)"HammingComputer16_swigregister", HammingComputer16_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a0_set", _wrap_HammingComputer20_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a0_get", _wrap_HammingComputer20_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a1_set", _wrap_HammingComputer20_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a1_get", _wrap_HammingComputer20_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a2_set", _wrap_HammingComputer20_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_a2_get", _wrap_HammingComputer20_a2_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer20", _wrap_new_HammingComputer20, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_set", _wrap_HammingComputer20_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_hamming", _wrap_HammingComputer20_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer20", _wrap_delete_HammingComputer20, METH_VARARGS, NULL}, - { (char *)"HammingComputer20_swigregister", HammingComputer20_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a0_set", _wrap_HammingComputer32_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a0_get", _wrap_HammingComputer32_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a1_set", _wrap_HammingComputer32_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a1_get", _wrap_HammingComputer32_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a2_set", _wrap_HammingComputer32_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a2_get", _wrap_HammingComputer32_a2_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a3_set", _wrap_HammingComputer32_a3_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_a3_get", _wrap_HammingComputer32_a3_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer32", _wrap_new_HammingComputer32, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_set", _wrap_HammingComputer32_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_hamming", _wrap_HammingComputer32_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer32", _wrap_delete_HammingComputer32, METH_VARARGS, NULL}, - { (char *)"HammingComputer32_swigregister", HammingComputer32_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a0_set", _wrap_HammingComputer64_a0_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a0_get", _wrap_HammingComputer64_a0_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a1_set", _wrap_HammingComputer64_a1_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a1_get", _wrap_HammingComputer64_a1_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a2_set", _wrap_HammingComputer64_a2_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a2_get", _wrap_HammingComputer64_a2_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a3_set", _wrap_HammingComputer64_a3_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a3_get", _wrap_HammingComputer64_a3_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a4_set", _wrap_HammingComputer64_a4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a4_get", _wrap_HammingComputer64_a4_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a5_set", _wrap_HammingComputer64_a5_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a5_get", _wrap_HammingComputer64_a5_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a6_set", _wrap_HammingComputer64_a6_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a6_get", _wrap_HammingComputer64_a6_get, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a7_set", _wrap_HammingComputer64_a7_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_a7_get", _wrap_HammingComputer64_a7_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputer64", _wrap_new_HammingComputer64, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_set", _wrap_HammingComputer64_set, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_hamming", _wrap_HammingComputer64_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputer64", _wrap_delete_HammingComputer64, METH_VARARGS, NULL}, - { (char *)"HammingComputer64_swigregister", HammingComputer64_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_a_set", _wrap_HammingComputerDefault_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_a_get", _wrap_HammingComputerDefault_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_n_set", _wrap_HammingComputerDefault_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_n_get", _wrap_HammingComputerDefault_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerDefault", _wrap_new_HammingComputerDefault, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_set", _wrap_HammingComputerDefault_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_hamming", _wrap_HammingComputerDefault_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerDefault", _wrap_delete_HammingComputerDefault, METH_VARARGS, NULL}, - { (char *)"HammingComputerDefault_swigregister", HammingComputerDefault_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_a_set", _wrap_HammingComputerM8_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_a_get", _wrap_HammingComputerM8_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_n_set", _wrap_HammingComputerM8_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_n_get", _wrap_HammingComputerM8_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerM8", _wrap_new_HammingComputerM8, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_set", _wrap_HammingComputerM8_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_hamming", _wrap_HammingComputerM8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerM8", _wrap_delete_HammingComputerM8, METH_VARARGS, NULL}, - { (char *)"HammingComputerM8_swigregister", HammingComputerM8_swigregister, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_a_set", _wrap_HammingComputerM4_a_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_a_get", _wrap_HammingComputerM4_a_get, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_n_set", _wrap_HammingComputerM4_n_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_n_get", _wrap_HammingComputerM4_n_get, METH_VARARGS, NULL}, - { (char *)"new_HammingComputerM4", _wrap_new_HammingComputerM4, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_set", _wrap_HammingComputerM4_set, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_hamming", _wrap_HammingComputerM4_hamming, METH_VARARGS, NULL}, - { (char *)"delete_HammingComputerM4", _wrap_delete_HammingComputerM4, METH_VARARGS, NULL}, - { (char *)"HammingComputerM4_swigregister", HammingComputerM4_swigregister, METH_VARARGS, NULL}, - { (char *)"generalized_hamming_64", _wrap_generalized_hamming_64, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_a0_set", _wrap_GenHammingComputer8_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_a0_get", _wrap_GenHammingComputer8_a0_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer8", _wrap_new_GenHammingComputer8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_hamming", _wrap_GenHammingComputer8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer8", _wrap_delete_GenHammingComputer8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer8_swigregister", GenHammingComputer8_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a0_set", _wrap_GenHammingComputer16_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a0_get", _wrap_GenHammingComputer16_a0_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a1_set", _wrap_GenHammingComputer16_a1_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_a1_get", _wrap_GenHammingComputer16_a1_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer16", _wrap_new_GenHammingComputer16, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_hamming", _wrap_GenHammingComputer16_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer16", _wrap_delete_GenHammingComputer16, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer16_swigregister", GenHammingComputer16_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a0_set", _wrap_GenHammingComputer32_a0_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a0_get", _wrap_GenHammingComputer32_a0_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a1_set", _wrap_GenHammingComputer32_a1_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a1_get", _wrap_GenHammingComputer32_a1_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a2_set", _wrap_GenHammingComputer32_a2_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a2_get", _wrap_GenHammingComputer32_a2_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a3_set", _wrap_GenHammingComputer32_a3_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_a3_get", _wrap_GenHammingComputer32_a3_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputer32", _wrap_new_GenHammingComputer32, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_hamming", _wrap_GenHammingComputer32_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputer32", _wrap_delete_GenHammingComputer32, METH_VARARGS, NULL}, - { (char *)"GenHammingComputer32_swigregister", GenHammingComputer32_swigregister, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_a_set", _wrap_GenHammingComputerM8_a_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_a_get", _wrap_GenHammingComputerM8_a_get, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_n_set", _wrap_GenHammingComputerM8_n_set, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_n_get", _wrap_GenHammingComputerM8_n_get, METH_VARARGS, NULL}, - { (char *)"new_GenHammingComputerM8", _wrap_new_GenHammingComputerM8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_hamming", _wrap_GenHammingComputerM8_hamming, METH_VARARGS, NULL}, - { (char *)"delete_GenHammingComputerM8", _wrap_delete_GenHammingComputerM8, METH_VARARGS, NULL}, - { (char *)"GenHammingComputerM8_swigregister", GenHammingComputerM8_swigregister, METH_VARARGS, NULL}, - { (char *)"generalized_hammings_knn_hc", _wrap_generalized_hammings_knn_hc, METH_VARARGS, NULL}, - { (char *)"get_num_gpus", _wrap_get_num_gpus, METH_VARARGS, NULL}, - { (char *)"getmillisecs", _wrap_getmillisecs, METH_VARARGS, NULL}, - { (char *)"get_mem_usage_kb", _wrap_get_mem_usage_kb, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_mt_set", _wrap_RandomGenerator_mt_set, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_mt_get", _wrap_RandomGenerator_mt_get, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_long", _wrap_RandomGenerator_rand_long, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_int", _wrap_RandomGenerator_rand_int, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_float", _wrap_RandomGenerator_rand_float, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_rand_double", _wrap_RandomGenerator_rand_double, METH_VARARGS, NULL}, - { (char *)"new_RandomGenerator", _wrap_new_RandomGenerator, METH_VARARGS, NULL}, - { (char *)"delete_RandomGenerator", _wrap_delete_RandomGenerator, METH_VARARGS, NULL}, - { (char *)"RandomGenerator_swigregister", RandomGenerator_swigregister, METH_VARARGS, NULL}, - { (char *)"float_rand", _wrap_float_rand, METH_VARARGS, NULL}, - { (char *)"float_randn", _wrap_float_randn, METH_VARARGS, NULL}, - { (char *)"long_rand", _wrap_long_rand, METH_VARARGS, NULL}, - { (char *)"byte_rand", _wrap_byte_rand, METH_VARARGS, NULL}, - { (char *)"rand_perm", _wrap_rand_perm, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr", _wrap_fvec_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_product", _wrap_fvec_inner_product, METH_VARARGS, NULL}, - { (char *)"imbalance_factor", _wrap_imbalance_factor, METH_VARARGS, NULL}, - { (char *)"pairwise_L2sqr", _wrap_pairwise_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_products_ny", _wrap_fvec_inner_products_ny, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr_ny", _wrap_fvec_L2sqr_ny, METH_VARARGS, NULL}, - { (char *)"fvec_norm_L2sqr", _wrap_fvec_norm_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_norms_L2", _wrap_fvec_norms_L2, METH_VARARGS, NULL}, - { (char *)"fvec_norms_L2sqr", _wrap_fvec_norms_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_renorm_L2", _wrap_fvec_renorm_L2, METH_VARARGS, NULL}, - { (char *)"inner_product_to_L2sqr", _wrap_inner_product_to_L2sqr, METH_VARARGS, NULL}, - { (char *)"fvec_inner_products_by_idx", _wrap_fvec_inner_products_by_idx, METH_VARARGS, NULL}, - { (char *)"fvec_L2sqr_by_idx", _wrap_fvec_L2sqr_by_idx, METH_VARARGS, NULL}, - { (char *)"knn_inner_product", _wrap_knn_inner_product, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr", _wrap_knn_L2sqr, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr_base_shift", _wrap_knn_L2sqr_base_shift, METH_VARARGS, NULL}, - { (char *)"knn_inner_products_by_idx", _wrap_knn_inner_products_by_idx, METH_VARARGS, NULL}, - { (char *)"knn_L2sqr_by_idx", _wrap_knn_L2sqr_by_idx, METH_VARARGS, NULL}, - { (char *)"range_search_L2sqr", _wrap_range_search_L2sqr, METH_VARARGS, NULL}, - { (char *)"range_search_inner_product", _wrap_range_search_inner_product, METH_VARARGS, NULL}, - { (char *)"fvec_madd", _wrap_fvec_madd, METH_VARARGS, NULL}, - { (char *)"fvec_madd_and_argmin", _wrap_fvec_madd_and_argmin, METH_VARARGS, NULL}, - { (char *)"reflection", _wrap_reflection, METH_VARARGS, NULL}, - { (char *)"km_update_centroids", _wrap_km_update_centroids, METH_VARARGS, NULL}, - { (char *)"matrix_qr", _wrap_matrix_qr, METH_VARARGS, NULL}, - { (char *)"ranklist_handle_ties", _wrap_ranklist_handle_ties, METH_VARARGS, NULL}, - { (char *)"ranklist_intersection_size", _wrap_ranklist_intersection_size, METH_VARARGS, NULL}, - { (char *)"merge_result_table_with", _wrap_merge_result_table_with, METH_VARARGS, NULL}, - { (char *)"fvec_argsort", _wrap_fvec_argsort, METH_VARARGS, NULL}, - { (char *)"fvec_argsort_parallel", _wrap_fvec_argsort_parallel, METH_VARARGS, NULL}, - { (char *)"ivec_hist", _wrap_ivec_hist, METH_VARARGS, NULL}, - { (char *)"bincode_hist", _wrap_bincode_hist, METH_VARARGS, NULL}, - { (char *)"ivec_checksum", _wrap_ivec_checksum, METH_VARARGS, NULL}, - { (char *)"fvecs_maybe_subsample", _wrap_fvecs_maybe_subsample, METH_VARARGS, NULL}, - { (char *)"binary_to_real", _wrap_binary_to_real, METH_VARARGS, NULL}, - { (char *)"real_to_binary", _wrap_real_to_binary, METH_VARARGS, NULL}, - { (char *)"hash_bytes", _wrap_hash_bytes, METH_VARARGS, NULL}, - { (char *)"check_openmp", _wrap_check_openmp, METH_VARARGS, NULL}, - { (char *)"Index_d_set", _wrap_Index_d_set, METH_VARARGS, NULL}, - { (char *)"Index_d_get", _wrap_Index_d_get, METH_VARARGS, NULL}, - { (char *)"Index_ntotal_set", _wrap_Index_ntotal_set, METH_VARARGS, NULL}, - { (char *)"Index_ntotal_get", _wrap_Index_ntotal_get, METH_VARARGS, NULL}, - { (char *)"Index_verbose_set", _wrap_Index_verbose_set, METH_VARARGS, NULL}, - { (char *)"Index_verbose_get", _wrap_Index_verbose_get, METH_VARARGS, NULL}, - { (char *)"Index_is_trained_set", _wrap_Index_is_trained_set, METH_VARARGS, NULL}, - { (char *)"Index_is_trained_get", _wrap_Index_is_trained_get, METH_VARARGS, NULL}, - { (char *)"Index_metric_type_set", _wrap_Index_metric_type_set, METH_VARARGS, NULL}, - { (char *)"Index_metric_type_get", _wrap_Index_metric_type_get, METH_VARARGS, NULL}, - { (char *)"delete_Index", _wrap_delete_Index, METH_VARARGS, NULL}, - { (char *)"Index_train", _wrap_Index_train, METH_VARARGS, NULL}, - { (char *)"Index_add", _wrap_Index_add, METH_VARARGS, NULL}, - { (char *)"Index_add_with_ids", _wrap_Index_add_with_ids, METH_VARARGS, NULL}, - { (char *)"Index_search", _wrap_Index_search, METH_VARARGS, NULL}, - { (char *)"Index_range_search", _wrap_Index_range_search, METH_VARARGS, NULL}, - { (char *)"Index_assign", _wrap_Index_assign, METH_VARARGS, NULL}, - { (char *)"Index_reset", _wrap_Index_reset, METH_VARARGS, NULL}, - { (char *)"Index_remove_ids", _wrap_Index_remove_ids, METH_VARARGS, NULL}, - { (char *)"Index_reconstruct", _wrap_Index_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index_reconstruct_n", _wrap_Index_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"Index_search_and_reconstruct", _wrap_Index_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index_compute_residual", _wrap_Index_compute_residual, METH_VARARGS, NULL}, - { (char *)"Index_display", _wrap_Index_display, METH_VARARGS, NULL}, - { (char *)"Index_swigregister", Index_swigregister, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_niter_set", _wrap_ClusteringParameters_niter_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_niter_get", _wrap_ClusteringParameters_niter_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_nredo_set", _wrap_ClusteringParameters_nredo_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_nredo_get", _wrap_ClusteringParameters_nredo_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_verbose_set", _wrap_ClusteringParameters_verbose_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_verbose_get", _wrap_ClusteringParameters_verbose_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_spherical_set", _wrap_ClusteringParameters_spherical_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_spherical_get", _wrap_ClusteringParameters_spherical_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_int_centroids_set", _wrap_ClusteringParameters_int_centroids_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_int_centroids_get", _wrap_ClusteringParameters_int_centroids_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_update_index_set", _wrap_ClusteringParameters_update_index_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_update_index_get", _wrap_ClusteringParameters_update_index_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_frozen_centroids_set", _wrap_ClusteringParameters_frozen_centroids_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_frozen_centroids_get", _wrap_ClusteringParameters_frozen_centroids_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_min_points_per_centroid_set", _wrap_ClusteringParameters_min_points_per_centroid_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_min_points_per_centroid_get", _wrap_ClusteringParameters_min_points_per_centroid_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_max_points_per_centroid_set", _wrap_ClusteringParameters_max_points_per_centroid_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_max_points_per_centroid_get", _wrap_ClusteringParameters_max_points_per_centroid_get, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_seed_set", _wrap_ClusteringParameters_seed_set, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_seed_get", _wrap_ClusteringParameters_seed_get, METH_VARARGS, NULL}, - { (char *)"new_ClusteringParameters", _wrap_new_ClusteringParameters, METH_VARARGS, NULL}, - { (char *)"delete_ClusteringParameters", _wrap_delete_ClusteringParameters, METH_VARARGS, NULL}, - { (char *)"ClusteringParameters_swigregister", ClusteringParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"Clustering_d_set", _wrap_Clustering_d_set, METH_VARARGS, NULL}, - { (char *)"Clustering_d_get", _wrap_Clustering_d_get, METH_VARARGS, NULL}, - { (char *)"Clustering_k_set", _wrap_Clustering_k_set, METH_VARARGS, NULL}, - { (char *)"Clustering_k_get", _wrap_Clustering_k_get, METH_VARARGS, NULL}, - { (char *)"Clustering_centroids_set", _wrap_Clustering_centroids_set, METH_VARARGS, NULL}, - { (char *)"Clustering_centroids_get", _wrap_Clustering_centroids_get, METH_VARARGS, NULL}, - { (char *)"Clustering_obj_set", _wrap_Clustering_obj_set, METH_VARARGS, NULL}, - { (char *)"Clustering_obj_get", _wrap_Clustering_obj_get, METH_VARARGS, NULL}, - { (char *)"new_Clustering", _wrap_new_Clustering, METH_VARARGS, NULL}, - { (char *)"Clustering_train", _wrap_Clustering_train, METH_VARARGS, NULL}, - { (char *)"Clustering_post_process_centroids", _wrap_Clustering_post_process_centroids, METH_VARARGS, NULL}, - { (char *)"delete_Clustering", _wrap_delete_Clustering, METH_VARARGS, NULL}, - { (char *)"Clustering_swigregister", Clustering_swigregister, METH_VARARGS, NULL}, - { (char *)"kmeans_clustering", _wrap_kmeans_clustering, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_d_set", _wrap_ProductQuantizer_d_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_d_get", _wrap_ProductQuantizer_d_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_M_set", _wrap_ProductQuantizer_M_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_M_get", _wrap_ProductQuantizer_M_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_nbits_set", _wrap_ProductQuantizer_nbits_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_nbits_get", _wrap_ProductQuantizer_nbits_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_dsub_set", _wrap_ProductQuantizer_dsub_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_dsub_get", _wrap_ProductQuantizer_dsub_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_byte_per_idx_set", _wrap_ProductQuantizer_byte_per_idx_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_byte_per_idx_get", _wrap_ProductQuantizer_byte_per_idx_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_code_size_set", _wrap_ProductQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_code_size_get", _wrap_ProductQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_ksub_set", _wrap_ProductQuantizer_ksub_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_ksub_get", _wrap_ProductQuantizer_ksub_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_verbose_set", _wrap_ProductQuantizer_verbose_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_verbose_get", _wrap_ProductQuantizer_verbose_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train_type_set", _wrap_ProductQuantizer_train_type_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train_type_get", _wrap_ProductQuantizer_train_type_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_cp_set", _wrap_ProductQuantizer_cp_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_cp_get", _wrap_ProductQuantizer_cp_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_assign_index_set", _wrap_ProductQuantizer_assign_index_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_assign_index_get", _wrap_ProductQuantizer_assign_index_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_centroids_set", _wrap_ProductQuantizer_centroids_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_centroids_get", _wrap_ProductQuantizer_centroids_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_get_centroids", _wrap_ProductQuantizer_get_centroids, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_train", _wrap_ProductQuantizer_train, METH_VARARGS, NULL}, - { (char *)"new_ProductQuantizer", _wrap_new_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_set_derived_values", _wrap_ProductQuantizer_set_derived_values, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_set_params", _wrap_ProductQuantizer_set_params, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_code", _wrap_ProductQuantizer_compute_code, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_codes", _wrap_ProductQuantizer_compute_codes, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_codes_with_assign_index", _wrap_ProductQuantizer_compute_codes_with_assign_index, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_decode", _wrap_ProductQuantizer_decode, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_code_from_distance_table", _wrap_ProductQuantizer_compute_code_from_distance_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_distance_table", _wrap_ProductQuantizer_compute_distance_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_inner_prod_table", _wrap_ProductQuantizer_compute_inner_prod_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_distance_tables", _wrap_ProductQuantizer_compute_distance_tables, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_inner_prod_tables", _wrap_ProductQuantizer_compute_inner_prod_tables, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search", _wrap_ProductQuantizer_search, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search_ip", _wrap_ProductQuantizer_search_ip, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_sdc_table_set", _wrap_ProductQuantizer_sdc_table_set, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_sdc_table_get", _wrap_ProductQuantizer_sdc_table_get, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_compute_sdc_table", _wrap_ProductQuantizer_compute_sdc_table, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_search_sdc", _wrap_ProductQuantizer_search_sdc, METH_VARARGS, NULL}, - { (char *)"delete_ProductQuantizer", _wrap_delete_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"ProductQuantizer_swigregister", ProductQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_in_set", _wrap_VectorTransform_d_in_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_in_get", _wrap_VectorTransform_d_in_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_out_set", _wrap_VectorTransform_d_out_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_d_out_get", _wrap_VectorTransform_d_out_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_is_trained_set", _wrap_VectorTransform_is_trained_set, METH_VARARGS, NULL}, - { (char *)"VectorTransform_is_trained_get", _wrap_VectorTransform_is_trained_get, METH_VARARGS, NULL}, - { (char *)"VectorTransform_train", _wrap_VectorTransform_train, METH_VARARGS, NULL}, - { (char *)"VectorTransform_apply", _wrap_VectorTransform_apply, METH_VARARGS, NULL}, - { (char *)"VectorTransform_apply_noalloc", _wrap_VectorTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"VectorTransform_reverse_transform", _wrap_VectorTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_VectorTransform", _wrap_delete_VectorTransform, METH_VARARGS, NULL}, - { (char *)"VectorTransform_swigregister", VectorTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"LinearTransform_have_bias_set", _wrap_LinearTransform_have_bias_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_have_bias_get", _wrap_LinearTransform_have_bias_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_is_orthonormal_set", _wrap_LinearTransform_is_orthonormal_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_is_orthonormal_get", _wrap_LinearTransform_is_orthonormal_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_A_set", _wrap_LinearTransform_A_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_A_get", _wrap_LinearTransform_A_get, METH_VARARGS, NULL}, - { (char *)"LinearTransform_b_set", _wrap_LinearTransform_b_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_b_get", _wrap_LinearTransform_b_get, METH_VARARGS, NULL}, - { (char *)"new_LinearTransform", _wrap_new_LinearTransform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_apply_noalloc", _wrap_LinearTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"LinearTransform_transform_transpose", _wrap_LinearTransform_transform_transpose, METH_VARARGS, NULL}, - { (char *)"LinearTransform_reverse_transform", _wrap_LinearTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_set_is_orthonormal", _wrap_LinearTransform_set_is_orthonormal, METH_VARARGS, NULL}, - { (char *)"LinearTransform_verbose_set", _wrap_LinearTransform_verbose_set, METH_VARARGS, NULL}, - { (char *)"LinearTransform_verbose_get", _wrap_LinearTransform_verbose_get, METH_VARARGS, NULL}, - { (char *)"delete_LinearTransform", _wrap_delete_LinearTransform, METH_VARARGS, NULL}, - { (char *)"LinearTransform_swigregister", LinearTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_init", _wrap_RandomRotationMatrix_init, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_train", _wrap_RandomRotationMatrix_train, METH_VARARGS, NULL}, - { (char *)"new_RandomRotationMatrix", _wrap_new_RandomRotationMatrix, METH_VARARGS, NULL}, - { (char *)"delete_RandomRotationMatrix", _wrap_delete_RandomRotationMatrix, METH_VARARGS, NULL}, - { (char *)"RandomRotationMatrix_swigregister", RandomRotationMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigen_power_set", _wrap_PCAMatrix_eigen_power_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigen_power_get", _wrap_PCAMatrix_eigen_power_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_random_rotation_set", _wrap_PCAMatrix_random_rotation_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_random_rotation_get", _wrap_PCAMatrix_random_rotation_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_max_points_per_d_set", _wrap_PCAMatrix_max_points_per_d_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_max_points_per_d_get", _wrap_PCAMatrix_max_points_per_d_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_balanced_bins_set", _wrap_PCAMatrix_balanced_bins_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_balanced_bins_get", _wrap_PCAMatrix_balanced_bins_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_mean_set", _wrap_PCAMatrix_mean_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_mean_get", _wrap_PCAMatrix_mean_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigenvalues_set", _wrap_PCAMatrix_eigenvalues_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_eigenvalues_get", _wrap_PCAMatrix_eigenvalues_get, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_PCAMat_set", _wrap_PCAMatrix_PCAMat_set, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_PCAMat_get", _wrap_PCAMatrix_PCAMat_get, METH_VARARGS, NULL}, - { (char *)"new_PCAMatrix", _wrap_new_PCAMatrix, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_train", _wrap_PCAMatrix_train, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_copy_from", _wrap_PCAMatrix_copy_from, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_prepare_Ab", _wrap_PCAMatrix_prepare_Ab, METH_VARARGS, NULL}, - { (char *)"delete_PCAMatrix", _wrap_delete_PCAMatrix, METH_VARARGS, NULL}, - { (char *)"PCAMatrix_swigregister", PCAMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_M_set", _wrap_OPQMatrix_M_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_M_get", _wrap_OPQMatrix_M_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_set", _wrap_OPQMatrix_niter_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_get", _wrap_OPQMatrix_niter_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_set", _wrap_OPQMatrix_niter_pq_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_get", _wrap_OPQMatrix_niter_pq_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_0_set", _wrap_OPQMatrix_niter_pq_0_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_niter_pq_0_get", _wrap_OPQMatrix_niter_pq_0_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_max_train_points_set", _wrap_OPQMatrix_max_train_points_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_max_train_points_get", _wrap_OPQMatrix_max_train_points_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_verbose_set", _wrap_OPQMatrix_verbose_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_verbose_get", _wrap_OPQMatrix_verbose_get, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_pq_set", _wrap_OPQMatrix_pq_set, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_pq_get", _wrap_OPQMatrix_pq_get, METH_VARARGS, NULL}, - { (char *)"new_OPQMatrix", _wrap_new_OPQMatrix, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_train", _wrap_OPQMatrix_train, METH_VARARGS, NULL}, - { (char *)"delete_OPQMatrix", _wrap_delete_OPQMatrix, METH_VARARGS, NULL}, - { (char *)"OPQMatrix_swigregister", OPQMatrix_swigregister, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_map_set", _wrap_RemapDimensionsTransform_map_set, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_map_get", _wrap_RemapDimensionsTransform_map_get, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_apply_noalloc", _wrap_RemapDimensionsTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_reverse_transform", _wrap_RemapDimensionsTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"new_RemapDimensionsTransform", _wrap_new_RemapDimensionsTransform, METH_VARARGS, NULL}, - { (char *)"delete_RemapDimensionsTransform", _wrap_delete_RemapDimensionsTransform, METH_VARARGS, NULL}, - { (char *)"RemapDimensionsTransform_swigregister", RemapDimensionsTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_norm_set", _wrap_NormalizationTransform_norm_set, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_norm_get", _wrap_NormalizationTransform_norm_get, METH_VARARGS, NULL}, - { (char *)"new_NormalizationTransform", _wrap_new_NormalizationTransform, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_apply_noalloc", _wrap_NormalizationTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_reverse_transform", _wrap_NormalizationTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_NormalizationTransform", _wrap_delete_NormalizationTransform, METH_VARARGS, NULL}, - { (char *)"NormalizationTransform_swigregister", NormalizationTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_mean_set", _wrap_CenteringTransform_mean_set, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_mean_get", _wrap_CenteringTransform_mean_get, METH_VARARGS, NULL}, - { (char *)"new_CenteringTransform", _wrap_new_CenteringTransform, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_train", _wrap_CenteringTransform_train, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_apply_noalloc", _wrap_CenteringTransform_apply_noalloc, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_reverse_transform", _wrap_CenteringTransform_reverse_transform, METH_VARARGS, NULL}, - { (char *)"delete_CenteringTransform", _wrap_delete_CenteringTransform, METH_VARARGS, NULL}, - { (char *)"CenteringTransform_swigregister", CenteringTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_chain_set", _wrap_IndexPreTransform_chain_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_chain_get", _wrap_IndexPreTransform_chain_get, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_index_set", _wrap_IndexPreTransform_index_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_index_get", _wrap_IndexPreTransform_index_get, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_own_fields_set", _wrap_IndexPreTransform_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_own_fields_get", _wrap_IndexPreTransform_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPreTransform", _wrap_new_IndexPreTransform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_prepend_transform", _wrap_IndexPreTransform_prepend_transform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_train", _wrap_IndexPreTransform_train, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_add", _wrap_IndexPreTransform_add, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_add_with_ids", _wrap_IndexPreTransform_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reset", _wrap_IndexPreTransform_reset, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_remove_ids", _wrap_IndexPreTransform_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_search", _wrap_IndexPreTransform_search, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_range_search", _wrap_IndexPreTransform_range_search, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reconstruct", _wrap_IndexPreTransform_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reconstruct_n", _wrap_IndexPreTransform_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_search_and_reconstruct", _wrap_IndexPreTransform_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_apply_chain", _wrap_IndexPreTransform_apply_chain, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_reverse_chain", _wrap_IndexPreTransform_reverse_chain, METH_VARARGS, NULL}, - { (char *)"delete_IndexPreTransform", _wrap_delete_IndexPreTransform, METH_VARARGS, NULL}, - { (char *)"IndexPreTransform_swigregister", IndexPreTransform_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlat_xb_set", _wrap_IndexFlat_xb_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat_xb_get", _wrap_IndexFlat_xb_get, METH_VARARGS, NULL}, - { (char *)"IndexFlat_add", _wrap_IndexFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexFlat_reset", _wrap_IndexFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexFlat_search", _wrap_IndexFlat_search, METH_VARARGS, NULL}, - { (char *)"IndexFlat_range_search", _wrap_IndexFlat_range_search, METH_VARARGS, NULL}, - { (char *)"IndexFlat_reconstruct", _wrap_IndexFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexFlat_compute_distance_subset", _wrap_IndexFlat_compute_distance_subset, METH_VARARGS, NULL}, - { (char *)"IndexFlat_remove_ids", _wrap_IndexFlat_remove_ids, METH_VARARGS, NULL}, - { (char *)"new_IndexFlat", _wrap_new_IndexFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlat", _wrap_delete_IndexFlat, METH_VARARGS, NULL}, - { (char *)"IndexFlat_swigregister", IndexFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatIP", _wrap_new_IndexFlatIP, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatIP", _wrap_delete_IndexFlatIP, METH_VARARGS, NULL}, - { (char *)"IndexFlatIP_swigregister", IndexFlatIP_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatL2", _wrap_new_IndexFlatL2, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatL2", _wrap_delete_IndexFlatL2, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2_swigregister", IndexFlatL2_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_shift_set", _wrap_IndexFlatL2BaseShift_shift_set, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_shift_get", _wrap_IndexFlatL2BaseShift_shift_get, METH_VARARGS, NULL}, - { (char *)"new_IndexFlatL2BaseShift", _wrap_new_IndexFlatL2BaseShift, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_search", _wrap_IndexFlatL2BaseShift_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlatL2BaseShift", _wrap_delete_IndexFlatL2BaseShift, METH_VARARGS, NULL}, - { (char *)"IndexFlatL2BaseShift_swigregister", IndexFlatL2BaseShift_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_refine_index_set", _wrap_IndexRefineFlat_refine_index_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_refine_index_get", _wrap_IndexRefineFlat_refine_index_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_base_index_set", _wrap_IndexRefineFlat_base_index_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_base_index_get", _wrap_IndexRefineFlat_base_index_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_own_fields_set", _wrap_IndexRefineFlat_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_own_fields_get", _wrap_IndexRefineFlat_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_k_factor_set", _wrap_IndexRefineFlat_k_factor_set, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_k_factor_get", _wrap_IndexRefineFlat_k_factor_get, METH_VARARGS, NULL}, - { (char *)"new_IndexRefineFlat", _wrap_new_IndexRefineFlat, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_train", _wrap_IndexRefineFlat_train, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_add", _wrap_IndexRefineFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_reset", _wrap_IndexRefineFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_search", _wrap_IndexRefineFlat_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexRefineFlat", _wrap_delete_IndexRefineFlat, METH_VARARGS, NULL}, - { (char *)"IndexRefineFlat_swigregister", IndexRefineFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_continuous_update_set", _wrap_IndexFlat1D_continuous_update_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_continuous_update_get", _wrap_IndexFlat1D_continuous_update_get, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_perm_set", _wrap_IndexFlat1D_perm_set, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_perm_get", _wrap_IndexFlat1D_perm_get, METH_VARARGS, NULL}, - { (char *)"new_IndexFlat1D", _wrap_new_IndexFlat1D, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_update_permutation", _wrap_IndexFlat1D_update_permutation, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_add", _wrap_IndexFlat1D_add, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_reset", _wrap_IndexFlat1D_reset, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_search", _wrap_IndexFlat1D_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexFlat1D", _wrap_delete_IndexFlat1D, METH_VARARGS, NULL}, - { (char *)"IndexFlat1D_swigregister", IndexFlat1D_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexLSH_nbits_set", _wrap_IndexLSH_nbits_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_nbits_get", _wrap_IndexLSH_nbits_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_bytes_per_vec_set", _wrap_IndexLSH_bytes_per_vec_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_bytes_per_vec_get", _wrap_IndexLSH_bytes_per_vec_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rotate_data_set", _wrap_IndexLSH_rotate_data_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rotate_data_get", _wrap_IndexLSH_rotate_data_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train_thresholds_set", _wrap_IndexLSH_train_thresholds_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train_thresholds_get", _wrap_IndexLSH_train_thresholds_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rrot_set", _wrap_IndexLSH_rrot_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_rrot_get", _wrap_IndexLSH_rrot_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_thresholds_set", _wrap_IndexLSH_thresholds_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_thresholds_get", _wrap_IndexLSH_thresholds_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_codes_set", _wrap_IndexLSH_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexLSH_codes_get", _wrap_IndexLSH_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexLSH_apply_preprocess", _wrap_IndexLSH_apply_preprocess, METH_VARARGS, NULL}, - { (char *)"IndexLSH_train", _wrap_IndexLSH_train, METH_VARARGS, NULL}, - { (char *)"IndexLSH_add", _wrap_IndexLSH_add, METH_VARARGS, NULL}, - { (char *)"IndexLSH_search", _wrap_IndexLSH_search, METH_VARARGS, NULL}, - { (char *)"IndexLSH_reset", _wrap_IndexLSH_reset, METH_VARARGS, NULL}, - { (char *)"IndexLSH_transfer_thresholds", _wrap_IndexLSH_transfer_thresholds, METH_VARARGS, NULL}, - { (char *)"delete_IndexLSH", _wrap_delete_IndexLSH, METH_VARARGS, NULL}, - { (char *)"new_IndexLSH", _wrap_new_IndexLSH, METH_VARARGS, NULL}, - { (char *)"IndexLSH_swigregister", IndexLSH_swigregister, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_temperature_set", _wrap_SimulatedAnnealingParameters_init_temperature_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_temperature_get", _wrap_SimulatedAnnealingParameters_init_temperature_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_temperature_decay_set", _wrap_SimulatedAnnealingParameters_temperature_decay_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_temperature_decay_get", _wrap_SimulatedAnnealingParameters_temperature_decay_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_iter_set", _wrap_SimulatedAnnealingParameters_n_iter_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_iter_get", _wrap_SimulatedAnnealingParameters_n_iter_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_redo_set", _wrap_SimulatedAnnealingParameters_n_redo_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_n_redo_get", _wrap_SimulatedAnnealingParameters_n_redo_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_seed_set", _wrap_SimulatedAnnealingParameters_seed_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_seed_get", _wrap_SimulatedAnnealingParameters_seed_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_verbose_set", _wrap_SimulatedAnnealingParameters_verbose_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_verbose_get", _wrap_SimulatedAnnealingParameters_verbose_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_only_bit_flips_set", _wrap_SimulatedAnnealingParameters_only_bit_flips_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_only_bit_flips_get", _wrap_SimulatedAnnealingParameters_only_bit_flips_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_random_set", _wrap_SimulatedAnnealingParameters_init_random_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_init_random_get", _wrap_SimulatedAnnealingParameters_init_random_get, METH_VARARGS, NULL}, - { (char *)"new_SimulatedAnnealingParameters", _wrap_new_SimulatedAnnealingParameters, METH_VARARGS, NULL}, - { (char *)"delete_SimulatedAnnealingParameters", _wrap_delete_SimulatedAnnealingParameters, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingParameters_swigregister", SimulatedAnnealingParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_n_set", _wrap_PermutationObjective_n_set, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_n_get", _wrap_PermutationObjective_n_get, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_compute_cost", _wrap_PermutationObjective_compute_cost, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_cost_update", _wrap_PermutationObjective_cost_update, METH_VARARGS, NULL}, - { (char *)"delete_PermutationObjective", _wrap_delete_PermutationObjective, METH_VARARGS, NULL}, - { (char *)"PermutationObjective_swigregister", PermutationObjective_swigregister, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight_factor_set", _wrap_ReproduceDistancesObjective_dis_weight_factor_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight_factor_get", _wrap_ReproduceDistancesObjective_dis_weight_factor_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_sqr", _wrap_ReproduceDistancesObjective_sqr, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_dis_weight", _wrap_ReproduceDistancesObjective_dis_weight, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_source_dis_set", _wrap_ReproduceDistancesObjective_source_dis_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_source_dis_get", _wrap_ReproduceDistancesObjective_source_dis_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_target_dis_set", _wrap_ReproduceDistancesObjective_target_dis_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_target_dis_get", _wrap_ReproduceDistancesObjective_target_dis_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_weights_set", _wrap_ReproduceDistancesObjective_weights_set, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_weights_get", _wrap_ReproduceDistancesObjective_weights_get, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_get_source_dis", _wrap_ReproduceDistancesObjective_get_source_dis, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_compute_cost", _wrap_ReproduceDistancesObjective_compute_cost, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_cost_update", _wrap_ReproduceDistancesObjective_cost_update, METH_VARARGS, NULL}, - { (char *)"new_ReproduceDistancesObjective", _wrap_new_ReproduceDistancesObjective, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_compute_mean_stdev", _wrap_ReproduceDistancesObjective_compute_mean_stdev, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_set_affine_target_dis", _wrap_ReproduceDistancesObjective_set_affine_target_dis, METH_VARARGS, NULL}, - { (char *)"delete_ReproduceDistancesObjective", _wrap_delete_ReproduceDistancesObjective, METH_VARARGS, NULL}, - { (char *)"ReproduceDistancesObjective_swigregister", ReproduceDistancesObjective_swigregister, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_obj_set", _wrap_SimulatedAnnealingOptimizer_obj_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_obj_get", _wrap_SimulatedAnnealingOptimizer_obj_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_n_set", _wrap_SimulatedAnnealingOptimizer_n_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_n_get", _wrap_SimulatedAnnealingOptimizer_n_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_logfile_set", _wrap_SimulatedAnnealingOptimizer_logfile_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_logfile_get", _wrap_SimulatedAnnealingOptimizer_logfile_get, METH_VARARGS, NULL}, - { (char *)"new_SimulatedAnnealingOptimizer", _wrap_new_SimulatedAnnealingOptimizer, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_rnd_set", _wrap_SimulatedAnnealingOptimizer_rnd_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_rnd_get", _wrap_SimulatedAnnealingOptimizer_rnd_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_init_cost_set", _wrap_SimulatedAnnealingOptimizer_init_cost_set, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_init_cost_get", _wrap_SimulatedAnnealingOptimizer_init_cost_get, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_optimize", _wrap_SimulatedAnnealingOptimizer_optimize, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_run_optimization", _wrap_SimulatedAnnealingOptimizer_run_optimization, METH_VARARGS, NULL}, - { (char *)"delete_SimulatedAnnealingOptimizer", _wrap_delete_SimulatedAnnealingOptimizer, METH_VARARGS, NULL}, - { (char *)"SimulatedAnnealingOptimizer_swigregister", SimulatedAnnealingOptimizer_swigregister, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimization_type_set", _wrap_PolysemousTraining_optimization_type_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimization_type_get", _wrap_PolysemousTraining_optimization_type_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_ntrain_permutation_set", _wrap_PolysemousTraining_ntrain_permutation_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_ntrain_permutation_get", _wrap_PolysemousTraining_ntrain_permutation_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_dis_weight_factor_set", _wrap_PolysemousTraining_dis_weight_factor_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_dis_weight_factor_get", _wrap_PolysemousTraining_dis_weight_factor_get, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_log_pattern_set", _wrap_PolysemousTraining_log_pattern_set, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_log_pattern_get", _wrap_PolysemousTraining_log_pattern_get, METH_VARARGS, NULL}, - { (char *)"new_PolysemousTraining", _wrap_new_PolysemousTraining, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_pq_for_hamming", _wrap_PolysemousTraining_optimize_pq_for_hamming, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_ranking", _wrap_PolysemousTraining_optimize_ranking, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_optimize_reproduce_distances", _wrap_PolysemousTraining_optimize_reproduce_distances, METH_VARARGS, NULL}, - { (char *)"delete_PolysemousTraining", _wrap_delete_PolysemousTraining, METH_VARARGS, NULL}, - { (char *)"PolysemousTraining_swigregister", PolysemousTraining_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPQ_pq_set", _wrap_IndexPQ_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_pq_get", _wrap_IndexPQ_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_codes_set", _wrap_IndexPQ_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_codes_get", _wrap_IndexPQ_codes_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPQ", _wrap_new_IndexPQ, METH_VARARGS, NULL}, - { (char *)"IndexPQ_train", _wrap_IndexPQ_train, METH_VARARGS, NULL}, - { (char *)"IndexPQ_add", _wrap_IndexPQ_add, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search", _wrap_IndexPQ_search, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reset", _wrap_IndexPQ_reset, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reconstruct_n", _wrap_IndexPQ_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexPQ_reconstruct", _wrap_IndexPQ_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexPQ_remove_ids", _wrap_IndexPQ_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexPQ_do_polysemous_training_set", _wrap_IndexPQ_do_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_do_polysemous_training_get", _wrap_IndexPQ_do_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_training_set", _wrap_IndexPQ_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_training_get", _wrap_IndexPQ_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_type_set", _wrap_IndexPQ_search_type_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_type_get", _wrap_IndexPQ_search_type_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_encode_signs_set", _wrap_IndexPQ_encode_signs_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_encode_signs_get", _wrap_IndexPQ_encode_signs_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_ht_set", _wrap_IndexPQ_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IndexPQ_polysemous_ht_get", _wrap_IndexPQ_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"IndexPQ_search_core_polysemous", _wrap_IndexPQ_search_core_polysemous, METH_VARARGS, NULL}, - { (char *)"IndexPQ_hamming_distance_histogram", _wrap_IndexPQ_hamming_distance_histogram, METH_VARARGS, NULL}, - { (char *)"IndexPQ_hamming_distance_table", _wrap_IndexPQ_hamming_distance_table, METH_VARARGS, NULL}, - { (char *)"delete_IndexPQ", _wrap_delete_IndexPQ, METH_VARARGS, NULL}, - { (char *)"IndexPQ_swigregister", IndexPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_nq_set", _wrap_IndexPQStats_nq_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_nq_get", _wrap_IndexPQStats_nq_get, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_ncode_set", _wrap_IndexPQStats_ncode_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_ncode_get", _wrap_IndexPQStats_ncode_get, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_n_hamming_pass_set", _wrap_IndexPQStats_n_hamming_pass_set, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_n_hamming_pass_get", _wrap_IndexPQStats_n_hamming_pass_get, METH_VARARGS, NULL}, - { (char *)"new_IndexPQStats", _wrap_new_IndexPQStats, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_reset", _wrap_IndexPQStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexPQStats", _wrap_delete_IndexPQStats, METH_VARARGS, NULL}, - { (char *)"IndexPQStats_swigregister", IndexPQStats_swigregister, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_pq_set", _wrap_MultiIndexQuantizer_pq_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_pq_get", _wrap_MultiIndexQuantizer_pq_get, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_train", _wrap_MultiIndexQuantizer_train, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_search", _wrap_MultiIndexQuantizer_search, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_add", _wrap_MultiIndexQuantizer_add, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_reset", _wrap_MultiIndexQuantizer_reset, METH_VARARGS, NULL}, - { (char *)"new_MultiIndexQuantizer", _wrap_new_MultiIndexQuantizer, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_reconstruct", _wrap_MultiIndexQuantizer_reconstruct, METH_VARARGS, NULL}, - { (char *)"delete_MultiIndexQuantizer", _wrap_delete_MultiIndexQuantizer, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer_swigregister", MultiIndexQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_assign_indexes_set", _wrap_MultiIndexQuantizer2_assign_indexes_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_assign_indexes_get", _wrap_MultiIndexQuantizer2_assign_indexes_get, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_own_fields_set", _wrap_MultiIndexQuantizer2_own_fields_set, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_own_fields_get", _wrap_MultiIndexQuantizer2_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_MultiIndexQuantizer2", _wrap_new_MultiIndexQuantizer2, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_train", _wrap_MultiIndexQuantizer2_train, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_search", _wrap_MultiIndexQuantizer2_search, METH_VARARGS, NULL}, - { (char *)"delete_MultiIndexQuantizer2", _wrap_delete_MultiIndexQuantizer2, METH_VARARGS, NULL}, - { (char *)"MultiIndexQuantizer2_swigregister", MultiIndexQuantizer2_swigregister, METH_VARARGS, NULL}, - { (char *)"InvertedLists_nlist_set", _wrap_InvertedLists_nlist_set, METH_VARARGS, NULL}, - { (char *)"InvertedLists_nlist_get", _wrap_InvertedLists_nlist_get, METH_VARARGS, NULL}, - { (char *)"InvertedLists_code_size_set", _wrap_InvertedLists_code_size_set, METH_VARARGS, NULL}, - { (char *)"InvertedLists_code_size_get", _wrap_InvertedLists_code_size_get, METH_VARARGS, NULL}, - { (char *)"InvertedLists_list_size", _wrap_InvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_codes", _wrap_InvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_ids", _wrap_InvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"InvertedLists_release_codes", _wrap_InvertedLists_release_codes, METH_VARARGS, NULL}, - { (char *)"InvertedLists_release_ids", _wrap_InvertedLists_release_ids, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_single_id", _wrap_InvertedLists_get_single_id, METH_VARARGS, NULL}, - { (char *)"InvertedLists_get_single_code", _wrap_InvertedLists_get_single_code, METH_VARARGS, NULL}, - { (char *)"InvertedLists_prefetch_lists", _wrap_InvertedLists_prefetch_lists, METH_VARARGS, NULL}, - { (char *)"InvertedLists_add_entry", _wrap_InvertedLists_add_entry, METH_VARARGS, NULL}, - { (char *)"InvertedLists_add_entries", _wrap_InvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"InvertedLists_update_entry", _wrap_InvertedLists_update_entry, METH_VARARGS, NULL}, - { (char *)"InvertedLists_update_entries", _wrap_InvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"InvertedLists_resize", _wrap_InvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"InvertedLists_reset", _wrap_InvertedLists_reset, METH_VARARGS, NULL}, - { (char *)"InvertedLists_merge_from", _wrap_InvertedLists_merge_from, METH_VARARGS, NULL}, - { (char *)"delete_InvertedLists", _wrap_delete_InvertedLists, METH_VARARGS, NULL}, - { (char *)"InvertedLists_imbalance_factor", _wrap_InvertedLists_imbalance_factor, METH_VARARGS, NULL}, - { (char *)"InvertedLists_print_stats", _wrap_InvertedLists_print_stats, METH_VARARGS, NULL}, - { (char *)"InvertedLists_swigregister", InvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_codes_set", _wrap_ArrayInvertedLists_codes_set, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_codes_get", _wrap_ArrayInvertedLists_codes_get, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_ids_set", _wrap_ArrayInvertedLists_ids_set, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_ids_get", _wrap_ArrayInvertedLists_ids_get, METH_VARARGS, NULL}, - { (char *)"new_ArrayInvertedLists", _wrap_new_ArrayInvertedLists, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_list_size", _wrap_ArrayInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_get_codes", _wrap_ArrayInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_get_ids", _wrap_ArrayInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_add_entries", _wrap_ArrayInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_update_entries", _wrap_ArrayInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_resize", _wrap_ArrayInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"delete_ArrayInvertedLists", _wrap_delete_ArrayInvertedLists, METH_VARARGS, NULL}, - { (char *)"ArrayInvertedLists_swigregister", ArrayInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_ils_set", _wrap_ConcatenatedInvertedLists_ils_set, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_ils_get", _wrap_ConcatenatedInvertedLists_ils_get, METH_VARARGS, NULL}, - { (char *)"new_ConcatenatedInvertedLists", _wrap_new_ConcatenatedInvertedLists, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_list_size", _wrap_ConcatenatedInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_codes", _wrap_ConcatenatedInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_ids", _wrap_ConcatenatedInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_release_codes", _wrap_ConcatenatedInvertedLists_release_codes, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_release_ids", _wrap_ConcatenatedInvertedLists_release_ids, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_single_id", _wrap_ConcatenatedInvertedLists_get_single_id, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_get_single_code", _wrap_ConcatenatedInvertedLists_get_single_code, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_add_entries", _wrap_ConcatenatedInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_update_entries", _wrap_ConcatenatedInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_resize", _wrap_ConcatenatedInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"delete_ConcatenatedInvertedLists", _wrap_delete_ConcatenatedInvertedLists, METH_VARARGS, NULL}, - { (char *)"ConcatenatedInvertedLists_swigregister", ConcatenatedInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_set", _wrap_Level1Quantizer_quantizer_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_get", _wrap_Level1Quantizer_quantizer_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_nlist_set", _wrap_Level1Quantizer_nlist_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_nlist_get", _wrap_Level1Quantizer_nlist_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_trains_alone_set", _wrap_Level1Quantizer_quantizer_trains_alone_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_quantizer_trains_alone_get", _wrap_Level1Quantizer_quantizer_trains_alone_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_own_fields_set", _wrap_Level1Quantizer_own_fields_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_own_fields_get", _wrap_Level1Quantizer_own_fields_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_cp_set", _wrap_Level1Quantizer_cp_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_cp_get", _wrap_Level1Quantizer_cp_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_clustering_index_set", _wrap_Level1Quantizer_clustering_index_set, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_clustering_index_get", _wrap_Level1Quantizer_clustering_index_get, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_train_q1", _wrap_Level1Quantizer_train_q1, METH_VARARGS, NULL}, - { (char *)"new_Level1Quantizer", _wrap_new_Level1Quantizer, METH_VARARGS, NULL}, - { (char *)"delete_Level1Quantizer", _wrap_delete_Level1Quantizer, METH_VARARGS, NULL}, - { (char *)"Level1Quantizer_swigregister", Level1Quantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_nprobe_set", _wrap_IVFSearchParameters_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_nprobe_get", _wrap_IVFSearchParameters_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_max_codes_set", _wrap_IVFSearchParameters_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_max_codes_get", _wrap_IVFSearchParameters_max_codes_get, METH_VARARGS, NULL}, - { (char *)"delete_IVFSearchParameters", _wrap_delete_IVFSearchParameters, METH_VARARGS, NULL}, - { (char *)"new_IVFSearchParameters", _wrap_new_IVFSearchParameters, METH_VARARGS, NULL}, - { (char *)"IVFSearchParameters_swigregister", IVFSearchParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVF_invlists_set", _wrap_IndexIVF_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_invlists_get", _wrap_IndexIVF_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_own_invlists_set", _wrap_IndexIVF_own_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_own_invlists_get", _wrap_IndexIVF_own_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_code_size_set", _wrap_IndexIVF_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_code_size_get", _wrap_IndexIVF_code_size_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_nprobe_set", _wrap_IndexIVF_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_nprobe_get", _wrap_IndexIVF_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_max_codes_set", _wrap_IndexIVF_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_max_codes_get", _wrap_IndexIVF_max_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_maintain_direct_map_set", _wrap_IndexIVF_maintain_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_maintain_direct_map_get", _wrap_IndexIVF_maintain_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_direct_map_set", _wrap_IndexIVF_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIVF_direct_map_get", _wrap_IndexIVF_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reset", _wrap_IndexIVF_reset, METH_VARARGS, NULL}, - { (char *)"IndexIVF_train", _wrap_IndexIVF_train, METH_VARARGS, NULL}, - { (char *)"IndexIVF_add", _wrap_IndexIVF_add, METH_VARARGS, NULL}, - { (char *)"IndexIVF_encode_vectors", _wrap_IndexIVF_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVF_train_residual", _wrap_IndexIVF_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search_preassigned", _wrap_IndexIVF_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search", _wrap_IndexIVF_search, METH_VARARGS, NULL}, - { (char *)"IndexIVF_range_search", _wrap_IndexIVF_range_search, METH_VARARGS, NULL}, - { (char *)"IndexIVF_get_InvertedListScanner", _wrap_IndexIVF_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct", _wrap_IndexIVF_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct_n", _wrap_IndexIVF_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexIVF_search_and_reconstruct", _wrap_IndexIVF_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexIVF_reconstruct_from_offset", _wrap_IndexIVF_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVF_remove_ids", _wrap_IndexIVF_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVF_check_compatible_for_merge", _wrap_IndexIVF_check_compatible_for_merge, METH_VARARGS, NULL}, - { (char *)"IndexIVF_merge_from", _wrap_IndexIVF_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexIVF_copy_subset_to", _wrap_IndexIVF_copy_subset_to, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVF", _wrap_delete_IndexIVF, METH_VARARGS, NULL}, - { (char *)"IndexIVF_get_list_size", _wrap_IndexIVF_get_list_size, METH_VARARGS, NULL}, - { (char *)"IndexIVF_make_direct_map", _wrap_IndexIVF_make_direct_map, METH_VARARGS, NULL}, - { (char *)"IndexIVF_replace_invlists", _wrap_IndexIVF_replace_invlists, METH_VARARGS, NULL}, - { (char *)"IndexIVF_swigregister", IndexIVF_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nq_set", _wrap_IndexIVFStats_nq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nq_get", _wrap_IndexIVFStats_nq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nlist_set", _wrap_IndexIVFStats_nlist_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nlist_get", _wrap_IndexIVFStats_nlist_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_ndis_set", _wrap_IndexIVFStats_ndis_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_ndis_get", _wrap_IndexIVFStats_ndis_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nheap_updates_set", _wrap_IndexIVFStats_nheap_updates_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_nheap_updates_get", _wrap_IndexIVFStats_nheap_updates_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_quantization_time_set", _wrap_IndexIVFStats_quantization_time_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_quantization_time_get", _wrap_IndexIVFStats_quantization_time_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_search_time_set", _wrap_IndexIVFStats_search_time_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_search_time_get", _wrap_IndexIVFStats_search_time_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFStats", _wrap_new_IndexIVFStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_reset", _wrap_IndexIVFStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFStats", _wrap_delete_IndexIVFStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFStats_swigregister", IndexIVFStats_swigregister, METH_VARARGS, NULL}, - { (char *)"check_compatible_for_merge", _wrap_check_compatible_for_merge, METH_VARARGS, NULL}, - { (char *)"extract_index_ivf", _wrap_extract_index_ivf, METH_VARARGS, NULL}, - { (char *)"merge_into", _wrap_merge_into, METH_VARARGS, NULL}, - { (char *)"search_centroid", _wrap_search_centroid, METH_VARARGS, NULL}, - { (char *)"search_and_return_centroids", _wrap_search_and_return_centroids, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_index_set", _wrap_SlidingIndexWindow_index_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_index_get", _wrap_SlidingIndexWindow_index_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_ils_set", _wrap_SlidingIndexWindow_ils_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_ils_get", _wrap_SlidingIndexWindow_ils_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_n_slice_set", _wrap_SlidingIndexWindow_n_slice_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_n_slice_get", _wrap_SlidingIndexWindow_n_slice_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_nlist_set", _wrap_SlidingIndexWindow_nlist_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_nlist_get", _wrap_SlidingIndexWindow_nlist_get, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_sizes_set", _wrap_SlidingIndexWindow_sizes_set, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_sizes_get", _wrap_SlidingIndexWindow_sizes_get, METH_VARARGS, NULL}, - { (char *)"new_SlidingIndexWindow", _wrap_new_SlidingIndexWindow, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_step", _wrap_SlidingIndexWindow_step, METH_VARARGS, NULL}, - { (char *)"delete_SlidingIndexWindow", _wrap_delete_SlidingIndexWindow, METH_VARARGS, NULL}, - { (char *)"SlidingIndexWindow_swigregister", SlidingIndexWindow_swigregister, METH_VARARGS, NULL}, - { (char *)"get_invlist_range", _wrap_get_invlist_range, METH_VARARGS, NULL}, - { (char *)"set_invlist_range", _wrap_set_invlist_range, METH_VARARGS, NULL}, - { (char *)"search_with_parameters", _wrap_search_with_parameters, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_qtype_set", _wrap_ScalarQuantizer_qtype_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_qtype_get", _wrap_ScalarQuantizer_qtype_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_set", _wrap_ScalarQuantizer_rangestat_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_get", _wrap_ScalarQuantizer_rangestat_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_arg_set", _wrap_ScalarQuantizer_rangestat_arg_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_rangestat_arg_get", _wrap_ScalarQuantizer_rangestat_arg_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_d_set", _wrap_ScalarQuantizer_d_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_d_get", _wrap_ScalarQuantizer_d_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_code_size_set", _wrap_ScalarQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_code_size_get", _wrap_ScalarQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_trained_set", _wrap_ScalarQuantizer_trained_set, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_trained_get", _wrap_ScalarQuantizer_trained_get, METH_VARARGS, NULL}, - { (char *)"new_ScalarQuantizer", _wrap_new_ScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_train", _wrap_ScalarQuantizer_train, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_compute_codes", _wrap_ScalarQuantizer_compute_codes, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_decode", _wrap_ScalarQuantizer_decode, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_get_distance_computer", _wrap_ScalarQuantizer_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_ScalarQuantizer", _wrap_delete_ScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"ScalarQuantizer_swigregister", ScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_sq_set", _wrap_IndexScalarQuantizer_sq_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_sq_get", _wrap_IndexScalarQuantizer_sq_get, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_codes_set", _wrap_IndexScalarQuantizer_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_codes_get", _wrap_IndexScalarQuantizer_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_code_size_set", _wrap_IndexScalarQuantizer_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_code_size_get", _wrap_IndexScalarQuantizer_code_size_get, METH_VARARGS, NULL}, - { (char *)"new_IndexScalarQuantizer", _wrap_new_IndexScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_train", _wrap_IndexScalarQuantizer_train, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_add", _wrap_IndexScalarQuantizer_add, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_search", _wrap_IndexScalarQuantizer_search, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reset", _wrap_IndexScalarQuantizer_reset, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reconstruct_n", _wrap_IndexScalarQuantizer_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_reconstruct", _wrap_IndexScalarQuantizer_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_get_distance_computer", _wrap_IndexScalarQuantizer_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexScalarQuantizer", _wrap_delete_IndexScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexScalarQuantizer_swigregister", IndexScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_sq_set", _wrap_IndexIVFScalarQuantizer_sq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_sq_get", _wrap_IndexIVFScalarQuantizer_sq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_by_residual_set", _wrap_IndexIVFScalarQuantizer_by_residual_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_by_residual_get", _wrap_IndexIVFScalarQuantizer_by_residual_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFScalarQuantizer", _wrap_new_IndexIVFScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_train_residual", _wrap_IndexIVFScalarQuantizer_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_encode_vectors", _wrap_IndexIVFScalarQuantizer_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_add_with_ids", _wrap_IndexIVFScalarQuantizer_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_get_InvertedListScanner", _wrap_IndexIVFScalarQuantizer_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_reconstruct_from_offset", _wrap_IndexIVFScalarQuantizer_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFScalarQuantizer", _wrap_delete_IndexIVFScalarQuantizer, METH_VARARGS, NULL}, - { (char *)"IndexIVFScalarQuantizer_swigregister", IndexIVFScalarQuantizer_swigregister, METH_VARARGS, NULL}, - { (char *)"HNSW_assign_probas_set", _wrap_HNSW_assign_probas_set, METH_VARARGS, NULL}, - { (char *)"HNSW_assign_probas_get", _wrap_HNSW_assign_probas_get, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nneighbor_per_level_set", _wrap_HNSW_cum_nneighbor_per_level_set, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nneighbor_per_level_get", _wrap_HNSW_cum_nneighbor_per_level_get, METH_VARARGS, NULL}, - { (char *)"HNSW_levels_set", _wrap_HNSW_levels_set, METH_VARARGS, NULL}, - { (char *)"HNSW_levels_get", _wrap_HNSW_levels_get, METH_VARARGS, NULL}, - { (char *)"HNSW_offsets_set", _wrap_HNSW_offsets_set, METH_VARARGS, NULL}, - { (char *)"HNSW_offsets_get", _wrap_HNSW_offsets_get, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbors_set", _wrap_HNSW_neighbors_set, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbors_get", _wrap_HNSW_neighbors_get, METH_VARARGS, NULL}, - { (char *)"HNSW_entry_point_set", _wrap_HNSW_entry_point_set, METH_VARARGS, NULL}, - { (char *)"HNSW_entry_point_get", _wrap_HNSW_entry_point_get, METH_VARARGS, NULL}, - { (char *)"HNSW_rng_set", _wrap_HNSW_rng_set, METH_VARARGS, NULL}, - { (char *)"HNSW_rng_get", _wrap_HNSW_rng_get, METH_VARARGS, NULL}, - { (char *)"HNSW_max_level_set", _wrap_HNSW_max_level_set, METH_VARARGS, NULL}, - { (char *)"HNSW_max_level_get", _wrap_HNSW_max_level_get, METH_VARARGS, NULL}, - { (char *)"HNSW_efConstruction_set", _wrap_HNSW_efConstruction_set, METH_VARARGS, NULL}, - { (char *)"HNSW_efConstruction_get", _wrap_HNSW_efConstruction_get, METH_VARARGS, NULL}, - { (char *)"HNSW_efSearch_set", _wrap_HNSW_efSearch_set, METH_VARARGS, NULL}, - { (char *)"HNSW_efSearch_get", _wrap_HNSW_efSearch_get, METH_VARARGS, NULL}, - { (char *)"HNSW_check_relative_distance_set", _wrap_HNSW_check_relative_distance_set, METH_VARARGS, NULL}, - { (char *)"HNSW_check_relative_distance_get", _wrap_HNSW_check_relative_distance_get, METH_VARARGS, NULL}, - { (char *)"HNSW_upper_beam_set", _wrap_HNSW_upper_beam_set, METH_VARARGS, NULL}, - { (char *)"HNSW_upper_beam_get", _wrap_HNSW_upper_beam_get, METH_VARARGS, NULL}, - { (char *)"HNSW_search_bounded_queue_set", _wrap_HNSW_search_bounded_queue_set, METH_VARARGS, NULL}, - { (char *)"HNSW_search_bounded_queue_get", _wrap_HNSW_search_bounded_queue_get, METH_VARARGS, NULL}, - { (char *)"HNSW_set_default_probas", _wrap_HNSW_set_default_probas, METH_VARARGS, NULL}, - { (char *)"HNSW_set_nb_neighbors", _wrap_HNSW_set_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_nb_neighbors", _wrap_HNSW_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_cum_nb_neighbors", _wrap_HNSW_cum_nb_neighbors, METH_VARARGS, NULL}, - { (char *)"HNSW_neighbor_range", _wrap_HNSW_neighbor_range, METH_VARARGS, NULL}, - { (char *)"new_HNSW", _wrap_new_HNSW, METH_VARARGS, NULL}, - { (char *)"HNSW_random_level", _wrap_HNSW_random_level, METH_VARARGS, NULL}, - { (char *)"HNSW_fill_with_random_links", _wrap_HNSW_fill_with_random_links, METH_VARARGS, NULL}, - { (char *)"HNSW_add_links_starting_from", _wrap_HNSW_add_links_starting_from, METH_VARARGS, NULL}, - { (char *)"HNSW_add_with_locks", _wrap_HNSW_add_with_locks, METH_VARARGS, NULL}, - { (char *)"HNSW_search_from_candidates", _wrap_HNSW_search_from_candidates, METH_VARARGS, NULL}, - { (char *)"HNSW_search_from_candidate_unbounded", _wrap_HNSW_search_from_candidate_unbounded, METH_VARARGS, NULL}, - { (char *)"HNSW_search", _wrap_HNSW_search, METH_VARARGS, NULL}, - { (char *)"HNSW_reset", _wrap_HNSW_reset, METH_VARARGS, NULL}, - { (char *)"HNSW_clear_neighbor_tables", _wrap_HNSW_clear_neighbor_tables, METH_VARARGS, NULL}, - { (char *)"HNSW_print_neighbor_stats", _wrap_HNSW_print_neighbor_stats, METH_VARARGS, NULL}, - { (char *)"HNSW_prepare_level_tab", _wrap_HNSW_prepare_level_tab, METH_VARARGS, NULL}, - { (char *)"HNSW_shrink_neighbor_list", _wrap_HNSW_shrink_neighbor_list, METH_VARARGS, NULL}, - { (char *)"delete_HNSW", _wrap_delete_HNSW, METH_VARARGS, NULL}, - { (char *)"HNSW_swigregister", HNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visited_set", _wrap_VisitedTable_visited_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visited_get", _wrap_VisitedTable_visited_get, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visno_set", _wrap_VisitedTable_visno_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_visno_get", _wrap_VisitedTable_visno_get, METH_VARARGS, NULL}, - { (char *)"new_VisitedTable", _wrap_new_VisitedTable, METH_VARARGS, NULL}, - { (char *)"VisitedTable_set", _wrap_VisitedTable_set, METH_VARARGS, NULL}, - { (char *)"VisitedTable_get", _wrap_VisitedTable_get, METH_VARARGS, NULL}, - { (char *)"VisitedTable_advance", _wrap_VisitedTable_advance, METH_VARARGS, NULL}, - { (char *)"delete_VisitedTable", _wrap_delete_VisitedTable, METH_VARARGS, NULL}, - { (char *)"VisitedTable_swigregister", VisitedTable_swigregister, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n1_set", _wrap_HNSWStats_n1_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n1_get", _wrap_HNSWStats_n1_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n2_set", _wrap_HNSWStats_n2_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n2_get", _wrap_HNSWStats_n2_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n3_set", _wrap_HNSWStats_n3_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_n3_get", _wrap_HNSWStats_n3_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_ndis_set", _wrap_HNSWStats_ndis_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_ndis_get", _wrap_HNSWStats_ndis_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_nreorder_set", _wrap_HNSWStats_nreorder_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_nreorder_get", _wrap_HNSWStats_nreorder_get, METH_VARARGS, NULL}, - { (char *)"HNSWStats_view_set", _wrap_HNSWStats_view_set, METH_VARARGS, NULL}, - { (char *)"HNSWStats_view_get", _wrap_HNSWStats_view_get, METH_VARARGS, NULL}, - { (char *)"new_HNSWStats", _wrap_new_HNSWStats, METH_VARARGS, NULL}, - { (char *)"HNSWStats_reset", _wrap_HNSWStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_HNSWStats", _wrap_delete_HNSWStats, METH_VARARGS, NULL}, - { (char *)"HNSWStats_swigregister", HNSWStats_swigregister, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_index_get", _wrap_ReconstructFromNeighbors_index_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_M_set", _wrap_ReconstructFromNeighbors_M_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_M_get", _wrap_ReconstructFromNeighbors_M_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_set", _wrap_ReconstructFromNeighbors_k_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_get", _wrap_ReconstructFromNeighbors_k_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_nsq_set", _wrap_ReconstructFromNeighbors_nsq_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_nsq_get", _wrap_ReconstructFromNeighbors_nsq_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_code_size_set", _wrap_ReconstructFromNeighbors_code_size_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_code_size_get", _wrap_ReconstructFromNeighbors_code_size_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_reorder_set", _wrap_ReconstructFromNeighbors_k_reorder_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_k_reorder_get", _wrap_ReconstructFromNeighbors_k_reorder_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codebook_set", _wrap_ReconstructFromNeighbors_codebook_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codebook_get", _wrap_ReconstructFromNeighbors_codebook_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codes_set", _wrap_ReconstructFromNeighbors_codes_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_codes_get", _wrap_ReconstructFromNeighbors_codes_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_ntotal_set", _wrap_ReconstructFromNeighbors_ntotal_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_ntotal_get", _wrap_ReconstructFromNeighbors_ntotal_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_d_set", _wrap_ReconstructFromNeighbors_d_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_d_get", _wrap_ReconstructFromNeighbors_d_get, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_dsub_set", _wrap_ReconstructFromNeighbors_dsub_set, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_dsub_get", _wrap_ReconstructFromNeighbors_dsub_get, METH_VARARGS, NULL}, - { (char *)"new_ReconstructFromNeighbors", _wrap_new_ReconstructFromNeighbors, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_add_codes", _wrap_ReconstructFromNeighbors_add_codes, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_compute_distances", _wrap_ReconstructFromNeighbors_compute_distances, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_estimate_code", _wrap_ReconstructFromNeighbors_estimate_code, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_reconstruct", _wrap_ReconstructFromNeighbors_reconstruct, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_reconstruct_n", _wrap_ReconstructFromNeighbors_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_get_neighbor_table", _wrap_ReconstructFromNeighbors_get_neighbor_table, METH_VARARGS, NULL}, - { (char *)"delete_ReconstructFromNeighbors", _wrap_delete_ReconstructFromNeighbors, METH_VARARGS, NULL}, - { (char *)"ReconstructFromNeighbors_swigregister", ReconstructFromNeighbors_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_hnsw_set", _wrap_IndexHNSW_hnsw_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_hnsw_get", _wrap_IndexHNSW_hnsw_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_own_fields_set", _wrap_IndexHNSW_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_own_fields_get", _wrap_IndexHNSW_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_storage_set", _wrap_IndexHNSW_storage_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_storage_get", _wrap_IndexHNSW_storage_get, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct_from_neighbors_set", _wrap_IndexHNSW_reconstruct_from_neighbors_set, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct_from_neighbors_get", _wrap_IndexHNSW_reconstruct_from_neighbors_get, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSW", _wrap_delete_IndexHNSW, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_get_distance_computer", _wrap_IndexHNSW_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_add", _wrap_IndexHNSW_add, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_train", _wrap_IndexHNSW_train, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_search", _wrap_IndexHNSW_search, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reconstruct", _wrap_IndexHNSW_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reset", _wrap_IndexHNSW_reset, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_shrink_level_0_neighbors", _wrap_IndexHNSW_shrink_level_0_neighbors, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_search_level_0", _wrap_IndexHNSW_search_level_0, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_init_level_0_from_knngraph", _wrap_IndexHNSW_init_level_0_from_knngraph, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_init_level_0_from_entry_points", _wrap_IndexHNSW_init_level_0_from_entry_points, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_reorder_links", _wrap_IndexHNSW_reorder_links, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_link_singletons", _wrap_IndexHNSW_link_singletons, METH_VARARGS, NULL}, - { (char *)"IndexHNSW_swigregister", IndexHNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWFlat", _wrap_new_IndexHNSWFlat, METH_VARARGS, NULL}, - { (char *)"IndexHNSWFlat_get_distance_computer", _wrap_IndexHNSWFlat_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWFlat", _wrap_delete_IndexHNSWFlat, METH_VARARGS, NULL}, - { (char *)"IndexHNSWFlat_swigregister", IndexHNSWFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWPQ", _wrap_new_IndexHNSWPQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_train", _wrap_IndexHNSWPQ_train, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_get_distance_computer", _wrap_IndexHNSWPQ_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWPQ", _wrap_delete_IndexHNSWPQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWPQ_swigregister", IndexHNSWPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSWSQ", _wrap_new_IndexHNSWSQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWSQ_get_distance_computer", _wrap_IndexHNSWSQ_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSWSQ", _wrap_delete_IndexHNSWSQ, METH_VARARGS, NULL}, - { (char *)"IndexHNSWSQ_swigregister", IndexHNSWSQ_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexHNSW2Level", _wrap_new_IndexHNSW2Level, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_get_distance_computer", _wrap_IndexHNSW2Level_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_flip_to_ivf", _wrap_IndexHNSW2Level_flip_to_ivf, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_search", _wrap_IndexHNSW2Level_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexHNSW2Level", _wrap_delete_IndexHNSW2Level, METH_VARARGS, NULL}, - { (char *)"IndexHNSW2Level_swigregister", IndexHNSW2Level_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_add_core", _wrap_IndexIVFFlat_add_core, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_add_with_ids", _wrap_IndexIVFFlat_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_encode_vectors", _wrap_IndexIVFFlat_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_get_InvertedListScanner", _wrap_IndexIVFFlat_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_update_vectors", _wrap_IndexIVFFlat_update_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_reconstruct_from_offset", _wrap_IndexIVFFlat_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFFlat", _wrap_new_IndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFFlat", _wrap_delete_IndexIVFFlat, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlat_swigregister", IndexIVFFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_instances_set", _wrap_IndexIVFFlatDedup_instances_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_instances_get", _wrap_IndexIVFFlatDedup_instances_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_train", _wrap_IndexIVFFlatDedup_train, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_add_with_ids", _wrap_IndexIVFFlatDedup_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_search_preassigned", _wrap_IndexIVFFlatDedup_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_remove_ids", _wrap_IndexIVFFlatDedup_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_range_search", _wrap_IndexIVFFlatDedup_range_search, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_update_vectors", _wrap_IndexIVFFlatDedup_update_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_reconstruct_from_offset", _wrap_IndexIVFFlatDedup_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFFlatDedup", _wrap_new_IndexIVFFlatDedup, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFFlatDedup", _wrap_delete_IndexIVFFlatDedup, METH_VARARGS, NULL}, - { (char *)"IndexIVFFlatDedup_swigregister", IndexIVFFlatDedup_swigregister, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_lists_set", _wrap_OnDiskInvertedLists_lists_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_lists_get", _wrap_OnDiskInvertedLists_lists_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_slots_set", _wrap_OnDiskInvertedLists_slots_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_slots_get", _wrap_OnDiskInvertedLists_slots_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_filename_set", _wrap_OnDiskInvertedLists_filename_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_filename_get", _wrap_OnDiskInvertedLists_filename_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_totsize_set", _wrap_OnDiskInvertedLists_totsize_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_totsize_get", _wrap_OnDiskInvertedLists_totsize_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_ptr_set", _wrap_OnDiskInvertedLists_ptr_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_ptr_get", _wrap_OnDiskInvertedLists_ptr_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_read_only_set", _wrap_OnDiskInvertedLists_read_only_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_read_only_get", _wrap_OnDiskInvertedLists_read_only_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_list_size", _wrap_OnDiskInvertedLists_list_size, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_get_codes", _wrap_OnDiskInvertedLists_get_codes, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_get_ids", _wrap_OnDiskInvertedLists_get_ids, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_add_entries", _wrap_OnDiskInvertedLists_add_entries, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_update_entries", _wrap_OnDiskInvertedLists_update_entries, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_resize", _wrap_OnDiskInvertedLists_resize, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_merge_from", _wrap_OnDiskInvertedLists_merge_from, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_prefetch_lists", _wrap_OnDiskInvertedLists_prefetch_lists, METH_VARARGS, NULL}, - { (char *)"delete_OnDiskInvertedLists", _wrap_delete_OnDiskInvertedLists, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_locks_set", _wrap_OnDiskInvertedLists_locks_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_locks_get", _wrap_OnDiskInvertedLists_locks_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_pf_set", _wrap_OnDiskInvertedLists_pf_set, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_pf_get", _wrap_OnDiskInvertedLists_pf_get, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_do_mmap", _wrap_OnDiskInvertedLists_do_mmap, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_update_totsize", _wrap_OnDiskInvertedLists_update_totsize, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_resize_locked", _wrap_OnDiskInvertedLists_resize_locked, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_allocate_slot", _wrap_OnDiskInvertedLists_allocate_slot, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_free_slot", _wrap_OnDiskInvertedLists_free_slot, METH_VARARGS, NULL}, - { (char *)"new_OnDiskInvertedLists", _wrap_new_OnDiskInvertedLists, METH_VARARGS, NULL}, - { (char *)"OnDiskInvertedLists_swigregister", OnDiskInvertedLists_swigregister, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_scan_table_threshold_set", _wrap_IVFPQSearchParameters_scan_table_threshold_set, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_scan_table_threshold_get", _wrap_IVFPQSearchParameters_scan_table_threshold_get, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_polysemous_ht_set", _wrap_IVFPQSearchParameters_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_polysemous_ht_get", _wrap_IVFPQSearchParameters_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"delete_IVFPQSearchParameters", _wrap_delete_IVFPQSearchParameters, METH_VARARGS, NULL}, - { (char *)"new_IVFPQSearchParameters", _wrap_new_IVFPQSearchParameters, METH_VARARGS, NULL}, - { (char *)"IVFPQSearchParameters_swigregister", IVFPQSearchParameters_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_by_residual_set", _wrap_IndexIVFPQ_by_residual_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_by_residual_get", _wrap_IndexIVFPQ_by_residual_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_pq_set", _wrap_IndexIVFPQ_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_pq_get", _wrap_IndexIVFPQ_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_do_polysemous_training_set", _wrap_IndexIVFPQ_do_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_do_polysemous_training_get", _wrap_IndexIVFPQ_do_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_training_set", _wrap_IndexIVFPQ_polysemous_training_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_training_get", _wrap_IndexIVFPQ_polysemous_training_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_scan_table_threshold_set", _wrap_IndexIVFPQ_scan_table_threshold_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_scan_table_threshold_get", _wrap_IndexIVFPQ_scan_table_threshold_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_ht_set", _wrap_IndexIVFPQ_polysemous_ht_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_polysemous_ht_get", _wrap_IndexIVFPQ_polysemous_ht_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_use_precomputed_table_set", _wrap_IndexIVFPQ_use_precomputed_table_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_use_precomputed_table_get", _wrap_IndexIVFPQ_use_precomputed_table_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_max_bytes_get", _wrap_IndexIVFPQ_precomputed_table_max_bytes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_max_bytes_set", _wrap_IndexIVFPQ_precomputed_table_max_bytes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_set", _wrap_IndexIVFPQ_precomputed_table_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precomputed_table_get", _wrap_IndexIVFPQ_precomputed_table_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_add_with_ids", _wrap_IndexIVFPQ_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode_vectors", _wrap_IndexIVFPQ_encode_vectors, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_add_core_o", _wrap_IndexIVFPQ_add_core_o, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_train_residual", _wrap_IndexIVFPQ_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_train_residual_o", _wrap_IndexIVFPQ_train_residual_o, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_reconstruct_from_offset", _wrap_IndexIVFPQ_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_find_duplicates", _wrap_IndexIVFPQ_find_duplicates, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode", _wrap_IndexIVFPQ_encode, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_encode_multiple", _wrap_IndexIVFPQ_encode_multiple, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_decode_multiple", _wrap_IndexIVFPQ_decode_multiple, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_get_InvertedListScanner", _wrap_IndexIVFPQ_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_precompute_table", _wrap_IndexIVFPQ_precompute_table, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQ", _wrap_new_IndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQ", _wrap_delete_IndexIVFPQ, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQ_swigregister", IndexIVFPQ_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_nrefine_set", _wrap_IndexIVFPQStats_nrefine_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_nrefine_get", _wrap_IndexIVFPQStats_nrefine_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_n_hamming_pass_set", _wrap_IndexIVFPQStats_n_hamming_pass_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_n_hamming_pass_get", _wrap_IndexIVFPQStats_n_hamming_pass_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_search_cycles_set", _wrap_IndexIVFPQStats_search_cycles_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_search_cycles_get", _wrap_IndexIVFPQStats_search_cycles_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_refine_cycles_set", _wrap_IndexIVFPQStats_refine_cycles_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_refine_cycles_get", _wrap_IndexIVFPQStats_refine_cycles_get, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQStats", _wrap_new_IndexIVFPQStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_reset", _wrap_IndexIVFPQStats_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQStats", _wrap_delete_IndexIVFPQStats, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQStats_swigregister", IndexIVFPQStats_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_pq_set", _wrap_IndexIVFPQR_refine_pq_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_pq_get", _wrap_IndexIVFPQR_refine_pq_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_codes_set", _wrap_IndexIVFPQR_refine_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_refine_codes_get", _wrap_IndexIVFPQR_refine_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_k_factor_set", _wrap_IndexIVFPQR_k_factor_set, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_k_factor_get", _wrap_IndexIVFPQR_k_factor_get, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_reset", _wrap_IndexIVFPQR_reset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_remove_ids", _wrap_IndexIVFPQR_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_train_residual", _wrap_IndexIVFPQR_train_residual, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_add_with_ids", _wrap_IndexIVFPQR_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_add_core", _wrap_IndexIVFPQR_add_core, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_reconstruct_from_offset", _wrap_IndexIVFPQR_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_merge_from", _wrap_IndexIVFPQR_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_search_preassigned", _wrap_IndexIVFPQR_search_preassigned, METH_VARARGS, NULL}, - { (char *)"new_IndexIVFPQR", _wrap_new_IndexIVFPQR, METH_VARARGS, NULL}, - { (char *)"delete_IndexIVFPQR", _wrap_delete_IndexIVFPQR, METH_VARARGS, NULL}, - { (char *)"IndexIVFPQR_swigregister", IndexIVFPQR_swigregister, METH_VARARGS, NULL}, - { (char *)"Index2Layer_q1_set", _wrap_Index2Layer_q1_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_q1_get", _wrap_Index2Layer_q1_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_pq_set", _wrap_Index2Layer_pq_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_pq_get", _wrap_Index2Layer_pq_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_codes_set", _wrap_Index2Layer_codes_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_codes_get", _wrap_Index2Layer_codes_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_1_set", _wrap_Index2Layer_code_size_1_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_1_get", _wrap_Index2Layer_code_size_1_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_2_set", _wrap_Index2Layer_code_size_2_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_2_get", _wrap_Index2Layer_code_size_2_get, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_set", _wrap_Index2Layer_code_size_set, METH_VARARGS, NULL}, - { (char *)"Index2Layer_code_size_get", _wrap_Index2Layer_code_size_get, METH_VARARGS, NULL}, - { (char *)"new_Index2Layer", _wrap_new_Index2Layer, METH_VARARGS, NULL}, - { (char *)"delete_Index2Layer", _wrap_delete_Index2Layer, METH_VARARGS, NULL}, - { (char *)"Index2Layer_train", _wrap_Index2Layer_train, METH_VARARGS, NULL}, - { (char *)"Index2Layer_add", _wrap_Index2Layer_add, METH_VARARGS, NULL}, - { (char *)"Index2Layer_search", _wrap_Index2Layer_search, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reconstruct_n", _wrap_Index2Layer_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reconstruct", _wrap_Index2Layer_reconstruct, METH_VARARGS, NULL}, - { (char *)"Index2Layer_reset", _wrap_Index2Layer_reset, METH_VARARGS, NULL}, - { (char *)"Index2Layer_transfer_to_IVFPQ", _wrap_Index2Layer_transfer_to_IVFPQ, METH_VARARGS, NULL}, - { (char *)"Index2Layer_swigregister", Index2Layer_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinary_d_set", _wrap_IndexBinary_d_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_d_get", _wrap_IndexBinary_d_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_code_size_set", _wrap_IndexBinary_code_size_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_code_size_get", _wrap_IndexBinary_code_size_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_ntotal_set", _wrap_IndexBinary_ntotal_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_ntotal_get", _wrap_IndexBinary_ntotal_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_verbose_set", _wrap_IndexBinary_verbose_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_verbose_get", _wrap_IndexBinary_verbose_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_is_trained_set", _wrap_IndexBinary_is_trained_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_is_trained_get", _wrap_IndexBinary_is_trained_get, METH_VARARGS, NULL}, - { (char *)"IndexBinary_metric_type_set", _wrap_IndexBinary_metric_type_set, METH_VARARGS, NULL}, - { (char *)"IndexBinary_metric_type_get", _wrap_IndexBinary_metric_type_get, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinary", _wrap_delete_IndexBinary, METH_VARARGS, NULL}, - { (char *)"IndexBinary_train", _wrap_IndexBinary_train, METH_VARARGS, NULL}, - { (char *)"IndexBinary_add", _wrap_IndexBinary_add, METH_VARARGS, NULL}, - { (char *)"IndexBinary_add_with_ids", _wrap_IndexBinary_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinary_search", _wrap_IndexBinary_search, METH_VARARGS, NULL}, - { (char *)"IndexBinary_range_search", _wrap_IndexBinary_range_search, METH_VARARGS, NULL}, - { (char *)"IndexBinary_assign", _wrap_IndexBinary_assign, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reset", _wrap_IndexBinary_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinary_remove_ids", _wrap_IndexBinary_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reconstruct", _wrap_IndexBinary_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinary_reconstruct_n", _wrap_IndexBinary_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexBinary_search_and_reconstruct", _wrap_IndexBinary_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinary_display", _wrap_IndexBinary_display, METH_VARARGS, NULL}, - { (char *)"IndexBinary_swigregister", IndexBinary_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_xb_set", _wrap_IndexBinaryFlat_xb_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_xb_get", _wrap_IndexBinaryFlat_xb_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_use_heap_set", _wrap_IndexBinaryFlat_use_heap_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_use_heap_get", _wrap_IndexBinaryFlat_use_heap_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_query_batch_size_set", _wrap_IndexBinaryFlat_query_batch_size_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_query_batch_size_get", _wrap_IndexBinaryFlat_query_batch_size_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_add", _wrap_IndexBinaryFlat_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_reset", _wrap_IndexBinaryFlat_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_search", _wrap_IndexBinaryFlat_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_reconstruct", _wrap_IndexBinaryFlat_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_remove_ids", _wrap_IndexBinaryFlat_remove_ids, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryFlat", _wrap_new_IndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryFlat", _wrap_delete_IndexBinaryFlat, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFlat_swigregister", IndexBinaryFlat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_invlists_set", _wrap_IndexBinaryIVF_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_invlists_get", _wrap_IndexBinaryIVF_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_invlists_set", _wrap_IndexBinaryIVF_own_invlists_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_invlists_get", _wrap_IndexBinaryIVF_own_invlists_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nprobe_set", _wrap_IndexBinaryIVF_nprobe_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nprobe_get", _wrap_IndexBinaryIVF_nprobe_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_max_codes_set", _wrap_IndexBinaryIVF_max_codes_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_max_codes_get", _wrap_IndexBinaryIVF_max_codes_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_use_heap_set", _wrap_IndexBinaryIVF_use_heap_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_use_heap_get", _wrap_IndexBinaryIVF_use_heap_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_maintain_direct_map_set", _wrap_IndexBinaryIVF_maintain_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_maintain_direct_map_get", _wrap_IndexBinaryIVF_maintain_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_direct_map_set", _wrap_IndexBinaryIVF_direct_map_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_direct_map_get", _wrap_IndexBinaryIVF_direct_map_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_quantizer_set", _wrap_IndexBinaryIVF_quantizer_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_quantizer_get", _wrap_IndexBinaryIVF_quantizer_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nlist_set", _wrap_IndexBinaryIVF_nlist_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_nlist_get", _wrap_IndexBinaryIVF_nlist_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_fields_set", _wrap_IndexBinaryIVF_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_own_fields_get", _wrap_IndexBinaryIVF_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_cp_set", _wrap_IndexBinaryIVF_cp_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_cp_get", _wrap_IndexBinaryIVF_cp_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_clustering_index_set", _wrap_IndexBinaryIVF_clustering_index_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_clustering_index_get", _wrap_IndexBinaryIVF_clustering_index_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryIVF", _wrap_new_IndexBinaryIVF, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryIVF", _wrap_delete_IndexBinaryIVF, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reset", _wrap_IndexBinaryIVF_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_train", _wrap_IndexBinaryIVF_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add", _wrap_IndexBinaryIVF_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add_with_ids", _wrap_IndexBinaryIVF_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_add_core", _wrap_IndexBinaryIVF_add_core, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search_preassigned", _wrap_IndexBinaryIVF_search_preassigned, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_get_InvertedListScanner", _wrap_IndexBinaryIVF_get_InvertedListScanner, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search", _wrap_IndexBinaryIVF_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct", _wrap_IndexBinaryIVF_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct_n", _wrap_IndexBinaryIVF_reconstruct_n, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_search_and_reconstruct", _wrap_IndexBinaryIVF_search_and_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_reconstruct_from_offset", _wrap_IndexBinaryIVF_reconstruct_from_offset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_remove_ids", _wrap_IndexBinaryIVF_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_merge_from", _wrap_IndexBinaryIVF_merge_from, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_get_list_size", _wrap_IndexBinaryIVF_get_list_size, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_make_direct_map", _wrap_IndexBinaryIVF_make_direct_map, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_replace_invlists", _wrap_IndexBinaryIVF_replace_invlists, METH_VARARGS, NULL}, - { (char *)"IndexBinaryIVF_swigregister", IndexBinaryIVF_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_index_set", _wrap_IndexBinaryFromFloat_index_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_index_get", _wrap_IndexBinaryFromFloat_index_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_own_fields_set", _wrap_IndexBinaryFromFloat_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_own_fields_get", _wrap_IndexBinaryFromFloat_own_fields_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryFromFloat", _wrap_new_IndexBinaryFromFloat, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryFromFloat", _wrap_delete_IndexBinaryFromFloat, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_add", _wrap_IndexBinaryFromFloat_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_reset", _wrap_IndexBinaryFromFloat_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_search", _wrap_IndexBinaryFromFloat_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_train", _wrap_IndexBinaryFromFloat_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryFromFloat_swigregister", IndexBinaryFromFloat_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_hnsw_set", _wrap_IndexBinaryHNSW_hnsw_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_hnsw_get", _wrap_IndexBinaryHNSW_hnsw_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_own_fields_set", _wrap_IndexBinaryHNSW_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_own_fields_get", _wrap_IndexBinaryHNSW_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_storage_set", _wrap_IndexBinaryHNSW_storage_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_storage_get", _wrap_IndexBinaryHNSW_storage_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryHNSW", _wrap_new_IndexBinaryHNSW, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryHNSW", _wrap_delete_IndexBinaryHNSW, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_get_distance_computer", _wrap_IndexBinaryHNSW_get_distance_computer, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_add", _wrap_IndexBinaryHNSW_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_train", _wrap_IndexBinaryHNSW_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_search", _wrap_IndexBinaryHNSW_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_reconstruct", _wrap_IndexBinaryHNSW_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_reset", _wrap_IndexBinaryHNSW_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryHNSW_swigregister", IndexBinaryHNSW_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexShards_shard_indexes_set", _wrap_IndexShards_shard_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_shard_indexes_get", _wrap_IndexShards_shard_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_own_fields_set", _wrap_IndexShards_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_own_fields_get", _wrap_IndexShards_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_threaded_set", _wrap_IndexShards_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_threaded_get", _wrap_IndexShards_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexShards_successive_ids_set", _wrap_IndexShards_successive_ids_set, METH_VARARGS, NULL}, - { (char *)"IndexShards_successive_ids_get", _wrap_IndexShards_successive_ids_get, METH_VARARGS, NULL}, - { (char *)"new_IndexShards", _wrap_new_IndexShards, METH_VARARGS, NULL}, - { (char *)"IndexShards_add_shard", _wrap_IndexShards_add_shard, METH_VARARGS, NULL}, - { (char *)"IndexShards_sync_with_shard_indexes", _wrap_IndexShards_sync_with_shard_indexes, METH_VARARGS, NULL}, - { (char *)"IndexShards_at", _wrap_IndexShards_at, METH_VARARGS, NULL}, - { (char *)"IndexShards_add", _wrap_IndexShards_add, METH_VARARGS, NULL}, - { (char *)"IndexShards_add_with_ids", _wrap_IndexShards_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexShards_search", _wrap_IndexShards_search, METH_VARARGS, NULL}, - { (char *)"IndexShards_train", _wrap_IndexShards_train, METH_VARARGS, NULL}, - { (char *)"IndexShards_reset", _wrap_IndexShards_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexShards", _wrap_delete_IndexShards, METH_VARARGS, NULL}, - { (char *)"IndexShards_swigregister", IndexShards_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_shard_indexes_set", _wrap_IndexBinaryShards_shard_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_shard_indexes_get", _wrap_IndexBinaryShards_shard_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_own_fields_set", _wrap_IndexBinaryShards_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_own_fields_get", _wrap_IndexBinaryShards_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_threaded_set", _wrap_IndexBinaryShards_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_threaded_get", _wrap_IndexBinaryShards_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_successive_ids_set", _wrap_IndexBinaryShards_successive_ids_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_successive_ids_get", _wrap_IndexBinaryShards_successive_ids_get, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryShards", _wrap_new_IndexBinaryShards, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add_shard", _wrap_IndexBinaryShards_add_shard, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_sync_with_shard_indexes", _wrap_IndexBinaryShards_sync_with_shard_indexes, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_at", _wrap_IndexBinaryShards_at, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add", _wrap_IndexBinaryShards_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_add_with_ids", _wrap_IndexBinaryShards_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_search", _wrap_IndexBinaryShards_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_train", _wrap_IndexBinaryShards_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_reset", _wrap_IndexBinaryShards_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryShards", _wrap_delete_IndexBinaryShards, METH_VARARGS, NULL}, - { (char *)"IndexBinaryShards_swigregister", IndexBinaryShards_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexReplicas", _wrap_new_IndexReplicas, METH_VARARGS, NULL}, - { (char *)"delete_IndexReplicas", _wrap_delete_IndexReplicas, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_addIndex", _wrap_IndexReplicas_addIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_removeIndex", _wrap_IndexReplicas_removeIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_runOnIndex", _wrap_IndexReplicas_runOnIndex, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_reset", _wrap_IndexReplicas_reset, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_train", _wrap_IndexReplicas_train, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_add", _wrap_IndexReplicas_add, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_search", _wrap_IndexReplicas_search, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_reconstruct", _wrap_IndexReplicas_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_own_fields_set", _wrap_IndexReplicas_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_own_fields_get", _wrap_IndexReplicas_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_count", _wrap_IndexReplicas_count, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_at", _wrap_IndexReplicas_at, METH_VARARGS, NULL}, - { (char *)"IndexReplicas_swigregister", IndexReplicas_swigregister, METH_VARARGS, NULL}, - { (char *)"new_IndexBinaryReplicas", _wrap_new_IndexBinaryReplicas, METH_VARARGS, NULL}, - { (char *)"delete_IndexBinaryReplicas", _wrap_delete_IndexBinaryReplicas, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_addIndex", _wrap_IndexBinaryReplicas_addIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_removeIndex", _wrap_IndexBinaryReplicas_removeIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_runOnIndex", _wrap_IndexBinaryReplicas_runOnIndex, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_reset", _wrap_IndexBinaryReplicas_reset, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_train", _wrap_IndexBinaryReplicas_train, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_add", _wrap_IndexBinaryReplicas_add, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_search", _wrap_IndexBinaryReplicas_search, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_reconstruct", _wrap_IndexBinaryReplicas_reconstruct, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_own_fields_set", _wrap_IndexBinaryReplicas_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_own_fields_get", _wrap_IndexBinaryReplicas_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_count", _wrap_IndexBinaryReplicas_count, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_at", _wrap_IndexBinaryReplicas_at, METH_VARARGS, NULL}, - { (char *)"IndexBinaryReplicas_swigregister", IndexBinaryReplicas_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_index_set", _wrap_IndexIDMap_index_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_index_get", _wrap_IndexIDMap_index_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_own_fields_set", _wrap_IndexIDMap_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_own_fields_get", _wrap_IndexIDMap_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_id_map_set", _wrap_IndexIDMap_id_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_id_map_get", _wrap_IndexIDMap_id_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_add_with_ids", _wrap_IndexIDMap_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_add", _wrap_IndexIDMap_add, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_search", _wrap_IndexIDMap_search, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_train", _wrap_IndexIDMap_train, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_reset", _wrap_IndexIDMap_reset, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_remove_ids", _wrap_IndexIDMap_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_range_search", _wrap_IndexIDMap_range_search, METH_VARARGS, NULL}, - { (char *)"delete_IndexIDMap", _wrap_delete_IndexIDMap, METH_VARARGS, NULL}, - { (char *)"new_IndexIDMap", _wrap_new_IndexIDMap, METH_VARARGS, NULL}, - { (char *)"IndexIDMap_swigregister", IndexIDMap_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_rev_map_set", _wrap_IndexIDMap2_rev_map_set, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_rev_map_get", _wrap_IndexIDMap2_rev_map_get, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_construct_rev_map", _wrap_IndexIDMap2_construct_rev_map, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_add_with_ids", _wrap_IndexIDMap2_add_with_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_remove_ids", _wrap_IndexIDMap2_remove_ids, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_reconstruct", _wrap_IndexIDMap2_reconstruct, METH_VARARGS, NULL}, - { (char *)"delete_IndexIDMap2", _wrap_delete_IndexIDMap2, METH_VARARGS, NULL}, - { (char *)"new_IndexIDMap2", _wrap_new_IndexIDMap2, METH_VARARGS, NULL}, - { (char *)"IndexIDMap2_swigregister", IndexIDMap2_swigregister, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_own_fields_set", _wrap_IndexSplitVectors_own_fields_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_own_fields_get", _wrap_IndexSplitVectors_own_fields_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_threaded_set", _wrap_IndexSplitVectors_threaded_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_threaded_get", _wrap_IndexSplitVectors_threaded_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sub_indexes_set", _wrap_IndexSplitVectors_sub_indexes_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sub_indexes_get", _wrap_IndexSplitVectors_sub_indexes_get, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sum_d_set", _wrap_IndexSplitVectors_sum_d_set, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sum_d_get", _wrap_IndexSplitVectors_sum_d_get, METH_VARARGS, NULL}, - { (char *)"new_IndexSplitVectors", _wrap_new_IndexSplitVectors, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_add_sub_index", _wrap_IndexSplitVectors_add_sub_index, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_sync_with_sub_indexes", _wrap_IndexSplitVectors_sync_with_sub_indexes, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_add", _wrap_IndexSplitVectors_add, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_search", _wrap_IndexSplitVectors_search, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_train", _wrap_IndexSplitVectors_train, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_reset", _wrap_IndexSplitVectors_reset, METH_VARARGS, NULL}, - { (char *)"delete_IndexSplitVectors", _wrap_delete_IndexSplitVectors, METH_VARARGS, NULL}, - { (char *)"IndexSplitVectors_swigregister", IndexSplitVectors_swigregister, METH_VARARGS, NULL}, - { (char *)"downcast_index", _wrap_downcast_index, METH_VARARGS, NULL}, - { (char *)"downcast_VectorTransform", _wrap_downcast_VectorTransform, METH_VARARGS, NULL}, - { (char *)"downcast_IndexBinary", _wrap_downcast_IndexBinary, METH_VARARGS, NULL}, - { (char *)"write_index", _wrap_write_index, METH_VARARGS, NULL}, - { (char *)"write_index_binary", _wrap_write_index_binary, METH_VARARGS, NULL}, - { (char *)"read_index", _wrap_read_index, METH_VARARGS, NULL}, - { (char *)"read_index_binary", _wrap_read_index_binary, METH_VARARGS, NULL}, - { (char *)"write_VectorTransform", _wrap_write_VectorTransform, METH_VARARGS, NULL}, - { (char *)"read_VectorTransform", _wrap_read_VectorTransform, METH_VARARGS, NULL}, - { (char *)"read_ProductQuantizer", _wrap_read_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"write_ProductQuantizer", _wrap_write_ProductQuantizer, METH_VARARGS, NULL}, - { (char *)"write_InvertedLists", _wrap_write_InvertedLists, METH_VARARGS, NULL}, - { (char *)"read_InvertedLists", _wrap_read_InvertedLists, METH_VARARGS, NULL}, - { (char *)"clone_index", _wrap_clone_index, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_VectorTransform", _wrap_Cloner_clone_VectorTransform, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_Index", _wrap_Cloner_clone_Index, METH_VARARGS, NULL}, - { (char *)"Cloner_clone_IndexIVF", _wrap_Cloner_clone_IndexIVF, METH_VARARGS, NULL}, - { (char *)"delete_Cloner", _wrap_delete_Cloner, METH_VARARGS, NULL}, - { (char *)"new_Cloner", _wrap_new_Cloner, METH_VARARGS, NULL}, - { (char *)"Cloner_swigregister", Cloner_swigregister, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nq_set", _wrap_AutoTuneCriterion_nq_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nq_get", _wrap_AutoTuneCriterion_nq_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nnn_set", _wrap_AutoTuneCriterion_nnn_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_nnn_get", _wrap_AutoTuneCriterion_nnn_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_nnn_set", _wrap_AutoTuneCriterion_gt_nnn_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_nnn_get", _wrap_AutoTuneCriterion_gt_nnn_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_D_set", _wrap_AutoTuneCriterion_gt_D_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_D_get", _wrap_AutoTuneCriterion_gt_D_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_I_set", _wrap_AutoTuneCriterion_gt_I_set, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_gt_I_get", _wrap_AutoTuneCriterion_gt_I_get, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_set_groundtruth", _wrap_AutoTuneCriterion_set_groundtruth, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_evaluate", _wrap_AutoTuneCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_AutoTuneCriterion", _wrap_delete_AutoTuneCriterion, METH_VARARGS, NULL}, - { (char *)"AutoTuneCriterion_swigregister", AutoTuneCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_R_set", _wrap_OneRecallAtRCriterion_R_set, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_R_get", _wrap_OneRecallAtRCriterion_R_get, METH_VARARGS, NULL}, - { (char *)"new_OneRecallAtRCriterion", _wrap_new_OneRecallAtRCriterion, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_evaluate", _wrap_OneRecallAtRCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_OneRecallAtRCriterion", _wrap_delete_OneRecallAtRCriterion, METH_VARARGS, NULL}, - { (char *)"OneRecallAtRCriterion_swigregister", OneRecallAtRCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_R_set", _wrap_IntersectionCriterion_R_set, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_R_get", _wrap_IntersectionCriterion_R_get, METH_VARARGS, NULL}, - { (char *)"new_IntersectionCriterion", _wrap_new_IntersectionCriterion, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_evaluate", _wrap_IntersectionCriterion_evaluate, METH_VARARGS, NULL}, - { (char *)"delete_IntersectionCriterion", _wrap_delete_IntersectionCriterion, METH_VARARGS, NULL}, - { (char *)"IntersectionCriterion_swigregister", IntersectionCriterion_swigregister, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_perf_set", _wrap_OperatingPoint_perf_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_perf_get", _wrap_OperatingPoint_perf_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_t_set", _wrap_OperatingPoint_t_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_t_get", _wrap_OperatingPoint_t_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_key_set", _wrap_OperatingPoint_key_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_key_get", _wrap_OperatingPoint_key_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_cno_set", _wrap_OperatingPoint_cno_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_cno_get", _wrap_OperatingPoint_cno_get, METH_VARARGS, NULL}, - { (char *)"new_OperatingPoint", _wrap_new_OperatingPoint, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPoint", _wrap_delete_OperatingPoint, METH_VARARGS, NULL}, - { (char *)"OperatingPoint_swigregister", OperatingPoint_swigregister, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_pts_set", _wrap_OperatingPoints_all_pts_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_pts_get", _wrap_OperatingPoints_all_pts_get, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_pts_set", _wrap_OperatingPoints_optimal_pts_set, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_pts_get", _wrap_OperatingPoints_optimal_pts_get, METH_VARARGS, NULL}, - { (char *)"new_OperatingPoints", _wrap_new_OperatingPoints, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_merge_with", _wrap_OperatingPoints_merge_with, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_clear", _wrap_OperatingPoints_clear, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_add", _wrap_OperatingPoints_add, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_t_for_perf", _wrap_OperatingPoints_t_for_perf, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_display", _wrap_OperatingPoints_display, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_all_to_gnuplot", _wrap_OperatingPoints_all_to_gnuplot, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_optimal_to_gnuplot", _wrap_OperatingPoints_optimal_to_gnuplot, METH_VARARGS, NULL}, - { (char *)"delete_OperatingPoints", _wrap_delete_OperatingPoints, METH_VARARGS, NULL}, - { (char *)"OperatingPoints_swigregister", OperatingPoints_swigregister, METH_VARARGS, NULL}, - { (char *)"ParameterRange_name_set", _wrap_ParameterRange_name_set, METH_VARARGS, NULL}, - { (char *)"ParameterRange_name_get", _wrap_ParameterRange_name_get, METH_VARARGS, NULL}, - { (char *)"ParameterRange_values_set", _wrap_ParameterRange_values_set, METH_VARARGS, NULL}, - { (char *)"ParameterRange_values_get", _wrap_ParameterRange_values_get, METH_VARARGS, NULL}, - { (char *)"new_ParameterRange", _wrap_new_ParameterRange, METH_VARARGS, NULL}, - { (char *)"delete_ParameterRange", _wrap_delete_ParameterRange, METH_VARARGS, NULL}, - { (char *)"ParameterRange_swigregister", ParameterRange_swigregister, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_parameter_ranges_set", _wrap_ParameterSpace_parameter_ranges_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_parameter_ranges_get", _wrap_ParameterSpace_parameter_ranges_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_verbose_set", _wrap_ParameterSpace_verbose_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_verbose_get", _wrap_ParameterSpace_verbose_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_experiments_set", _wrap_ParameterSpace_n_experiments_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_experiments_get", _wrap_ParameterSpace_n_experiments_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_batchsize_set", _wrap_ParameterSpace_batchsize_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_batchsize_get", _wrap_ParameterSpace_batchsize_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_thread_over_batches_set", _wrap_ParameterSpace_thread_over_batches_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_thread_over_batches_get", _wrap_ParameterSpace_thread_over_batches_get, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_min_test_duration_set", _wrap_ParameterSpace_min_test_duration_set, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_min_test_duration_get", _wrap_ParameterSpace_min_test_duration_get, METH_VARARGS, NULL}, - { (char *)"new_ParameterSpace", _wrap_new_ParameterSpace, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_n_combinations", _wrap_ParameterSpace_n_combinations, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_combination_ge", _wrap_ParameterSpace_combination_ge, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_combination_name", _wrap_ParameterSpace_combination_name, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_display", _wrap_ParameterSpace_display, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_add_range", _wrap_ParameterSpace_add_range, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_initialize", _wrap_ParameterSpace_initialize, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_set_index_parameters", _wrap_ParameterSpace_set_index_parameters, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_set_index_parameter", _wrap_ParameterSpace_set_index_parameter, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_update_bounds", _wrap_ParameterSpace_update_bounds, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_explore", _wrap_ParameterSpace_explore, METH_VARARGS, NULL}, - { (char *)"delete_ParameterSpace", _wrap_delete_ParameterSpace, METH_VARARGS, NULL}, - { (char *)"ParameterSpace_swigregister", ParameterSpace_swigregister, METH_VARARGS, NULL}, - { (char *)"index_factory", _wrap_index_factory, METH_VARARGS, NULL}, - { (char *)"index_binary_factory", _wrap_index_binary_factory, METH_VARARGS, NULL}, - { (char *)"new_MatrixStats", _wrap_new_MatrixStats, METH_VARARGS, NULL}, - { (char *)"MatrixStats_comments_set", _wrap_MatrixStats_comments_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_comments_get", _wrap_MatrixStats_comments_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_set", _wrap_MatrixStats_n_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_get", _wrap_MatrixStats_n_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_d_set", _wrap_MatrixStats_d_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_d_get", _wrap_MatrixStats_d_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_collision_set", _wrap_MatrixStats_n_collision_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_collision_get", _wrap_MatrixStats_n_collision_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_valid_set", _wrap_MatrixStats_n_valid_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n_valid_get", _wrap_MatrixStats_n_valid_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n0_set", _wrap_MatrixStats_n0_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_n0_get", _wrap_MatrixStats_n0_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_min_norm2_set", _wrap_MatrixStats_min_norm2_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_min_norm2_get", _wrap_MatrixStats_min_norm2_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_max_norm2_set", _wrap_MatrixStats_max_norm2_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_max_norm2_get", _wrap_MatrixStats_max_norm2_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_per_dim_stats_set", _wrap_MatrixStats_per_dim_stats_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_per_dim_stats_get", _wrap_MatrixStats_per_dim_stats_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_occurrences_set", _wrap_MatrixStats_occurrences_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_occurrences_get", _wrap_MatrixStats_occurrences_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_buf_set", _wrap_MatrixStats_buf_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_buf_get", _wrap_MatrixStats_buf_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_nbuf_set", _wrap_MatrixStats_nbuf_set, METH_VARARGS, NULL}, - { (char *)"MatrixStats_nbuf_get", _wrap_MatrixStats_nbuf_get, METH_VARARGS, NULL}, - { (char *)"MatrixStats_do_comment", _wrap_MatrixStats_do_comment, METH_VARARGS, NULL}, - { (char *)"delete_MatrixStats", _wrap_delete_MatrixStats, METH_VARARGS, NULL}, - { (char *)"MatrixStats_swigregister", MatrixStats_swigregister, METH_VARARGS, NULL}, - { (char *)"swig_ptr", _wrap_swig_ptr, METH_VARARGS, NULL}, - { (char *)"rev_swig_ptr", _wrap_rev_swig_ptr, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_nh_set", _wrap_float_minheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_nh_get", _wrap_float_minheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_k_set", _wrap_float_minheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_k_get", _wrap_float_minheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_ids_set", _wrap_float_minheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_ids_get", _wrap_float_minheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_val_set", _wrap_float_minheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_val_get", _wrap_float_minheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_get_val", _wrap_float_minheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_get_ids", _wrap_float_minheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_heapify", _wrap_float_minheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_addn", _wrap_float_minheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_addn_with_ids", _wrap_float_minheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_reorder", _wrap_float_minheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_per_line_extrema", _wrap_float_minheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_float_minheap_array_t", _wrap_new_float_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_float_minheap_array_t", _wrap_delete_float_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"float_minheap_array_t_swigregister", float_minheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_nh_set", _wrap_int_minheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_nh_get", _wrap_int_minheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_k_set", _wrap_int_minheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_k_get", _wrap_int_minheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_ids_set", _wrap_int_minheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_ids_get", _wrap_int_minheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_val_set", _wrap_int_minheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_val_get", _wrap_int_minheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_get_val", _wrap_int_minheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_get_ids", _wrap_int_minheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_heapify", _wrap_int_minheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_addn", _wrap_int_minheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_addn_with_ids", _wrap_int_minheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_reorder", _wrap_int_minheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_per_line_extrema", _wrap_int_minheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_int_minheap_array_t", _wrap_new_int_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_int_minheap_array_t", _wrap_delete_int_minheap_array_t, METH_VARARGS, NULL}, - { (char *)"int_minheap_array_t_swigregister", int_minheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_nh_set", _wrap_float_maxheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_nh_get", _wrap_float_maxheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_k_set", _wrap_float_maxheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_k_get", _wrap_float_maxheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_ids_set", _wrap_float_maxheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_ids_get", _wrap_float_maxheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_val_set", _wrap_float_maxheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_val_get", _wrap_float_maxheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_get_val", _wrap_float_maxheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_get_ids", _wrap_float_maxheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_heapify", _wrap_float_maxheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_addn", _wrap_float_maxheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_addn_with_ids", _wrap_float_maxheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_reorder", _wrap_float_maxheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_per_line_extrema", _wrap_float_maxheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_float_maxheap_array_t", _wrap_new_float_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_float_maxheap_array_t", _wrap_delete_float_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"float_maxheap_array_t_swigregister", float_maxheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_nh_set", _wrap_int_maxheap_array_t_nh_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_nh_get", _wrap_int_maxheap_array_t_nh_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_k_set", _wrap_int_maxheap_array_t_k_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_k_get", _wrap_int_maxheap_array_t_k_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_ids_set", _wrap_int_maxheap_array_t_ids_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_ids_get", _wrap_int_maxheap_array_t_ids_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_val_set", _wrap_int_maxheap_array_t_val_set, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_val_get", _wrap_int_maxheap_array_t_val_get, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_get_val", _wrap_int_maxheap_array_t_get_val, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_get_ids", _wrap_int_maxheap_array_t_get_ids, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_heapify", _wrap_int_maxheap_array_t_heapify, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_addn", _wrap_int_maxheap_array_t_addn, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_addn_with_ids", _wrap_int_maxheap_array_t_addn_with_ids, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_reorder", _wrap_int_maxheap_array_t_reorder, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_per_line_extrema", _wrap_int_maxheap_array_t_per_line_extrema, METH_VARARGS, NULL}, - { (char *)"new_int_maxheap_array_t", _wrap_new_int_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"delete_int_maxheap_array_t", _wrap_delete_int_maxheap_array_t, METH_VARARGS, NULL}, - { (char *)"int_maxheap_array_t_swigregister", int_maxheap_array_t_swigregister, METH_VARARGS, NULL}, - { (char *)"omp_set_num_threads", _wrap_omp_set_num_threads, METH_VARARGS, NULL}, - { (char *)"omp_get_max_threads", _wrap_omp_get_max_threads, METH_VARARGS, NULL}, - { (char *)"memcpy", _wrap_memcpy, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_float_ptr", _wrap_cast_integer_to_float_ptr, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_long_ptr", _wrap_cast_integer_to_long_ptr, METH_VARARGS, NULL}, - { (char *)"cast_integer_to_int_ptr", _wrap_cast_integer_to_int_ptr, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_nq_set", _wrap_RangeSearchResult_nq_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_nq_get", _wrap_RangeSearchResult_nq_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_lims_set", _wrap_RangeSearchResult_lims_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_lims_get", _wrap_RangeSearchResult_lims_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_labels_set", _wrap_RangeSearchResult_labels_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_labels_get", _wrap_RangeSearchResult_labels_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_distances_set", _wrap_RangeSearchResult_distances_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_distances_get", _wrap_RangeSearchResult_distances_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_buffer_size_set", _wrap_RangeSearchResult_buffer_size_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_buffer_size_get", _wrap_RangeSearchResult_buffer_size_get, METH_VARARGS, NULL}, - { (char *)"new_RangeSearchResult", _wrap_new_RangeSearchResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_do_allocation", _wrap_RangeSearchResult_do_allocation, METH_VARARGS, NULL}, - { (char *)"delete_RangeSearchResult", _wrap_delete_RangeSearchResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchResult_swigregister", RangeSearchResult_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelector_is_member", _wrap_IDSelector_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelector", _wrap_delete_IDSelector, METH_VARARGS, NULL}, - { (char *)"IDSelector_swigregister", IDSelector_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imin_set", _wrap_IDSelectorRange_imin_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imin_get", _wrap_IDSelectorRange_imin_get, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imax_set", _wrap_IDSelectorRange_imax_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_imax_get", _wrap_IDSelectorRange_imax_get, METH_VARARGS, NULL}, - { (char *)"new_IDSelectorRange", _wrap_new_IDSelectorRange, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_is_member", _wrap_IDSelectorRange_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelectorRange", _wrap_delete_IDSelectorRange, METH_VARARGS, NULL}, - { (char *)"IDSelectorRange_swigregister", IDSelectorRange_swigregister, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_nbits_set", _wrap_IDSelectorBatch_nbits_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_nbits_get", _wrap_IDSelectorBatch_nbits_get, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_mask_set", _wrap_IDSelectorBatch_mask_set, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_mask_get", _wrap_IDSelectorBatch_mask_get, METH_VARARGS, NULL}, - { (char *)"new_IDSelectorBatch", _wrap_new_IDSelectorBatch, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_is_member", _wrap_IDSelectorBatch_is_member, METH_VARARGS, NULL}, - { (char *)"delete_IDSelectorBatch", _wrap_delete_IDSelectorBatch, METH_VARARGS, NULL}, - { (char *)"IDSelectorBatch_swigregister", IDSelectorBatch_swigregister, METH_VARARGS, NULL}, - { (char *)"BufferList_buffer_size_set", _wrap_BufferList_buffer_size_set, METH_VARARGS, NULL}, - { (char *)"BufferList_buffer_size_get", _wrap_BufferList_buffer_size_get, METH_VARARGS, NULL}, - { (char *)"BufferList_buffers_set", _wrap_BufferList_buffers_set, METH_VARARGS, NULL}, - { (char *)"BufferList_buffers_get", _wrap_BufferList_buffers_get, METH_VARARGS, NULL}, - { (char *)"BufferList_wp_set", _wrap_BufferList_wp_set, METH_VARARGS, NULL}, - { (char *)"BufferList_wp_get", _wrap_BufferList_wp_get, METH_VARARGS, NULL}, - { (char *)"new_BufferList", _wrap_new_BufferList, METH_VARARGS, NULL}, - { (char *)"delete_BufferList", _wrap_delete_BufferList, METH_VARARGS, NULL}, - { (char *)"BufferList_append_buffer", _wrap_BufferList_append_buffer, METH_VARARGS, NULL}, - { (char *)"BufferList_add", _wrap_BufferList_add, METH_VARARGS, NULL}, - { (char *)"BufferList_copy_range", _wrap_BufferList_copy_range, METH_VARARGS, NULL}, - { (char *)"BufferList_swigregister", BufferList_swigregister, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_qno_set", _wrap_RangeQueryResult_qno_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_qno_get", _wrap_RangeQueryResult_qno_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_nres_set", _wrap_RangeQueryResult_nres_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_nres_get", _wrap_RangeQueryResult_nres_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_pres_set", _wrap_RangeQueryResult_pres_set, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_pres_get", _wrap_RangeQueryResult_pres_get, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_add", _wrap_RangeQueryResult_add, METH_VARARGS, NULL}, - { (char *)"new_RangeQueryResult", _wrap_new_RangeQueryResult, METH_VARARGS, NULL}, - { (char *)"delete_RangeQueryResult", _wrap_delete_RangeQueryResult, METH_VARARGS, NULL}, - { (char *)"RangeQueryResult_swigregister", RangeQueryResult_swigregister, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_res_set", _wrap_RangeSearchPartialResult_res_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_res_get", _wrap_RangeSearchPartialResult_res_get, METH_VARARGS, NULL}, - { (char *)"new_RangeSearchPartialResult", _wrap_new_RangeSearchPartialResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_queries_set", _wrap_RangeSearchPartialResult_queries_set, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_queries_get", _wrap_RangeSearchPartialResult_queries_get, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_new_result", _wrap_RangeSearchPartialResult_new_result, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_finalize", _wrap_RangeSearchPartialResult_finalize, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_set_lims", _wrap_RangeSearchPartialResult_set_lims, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_set_result", _wrap_RangeSearchPartialResult_set_result, METH_VARARGS, NULL}, - { (char *)"delete_RangeSearchPartialResult", _wrap_delete_RangeSearchPartialResult, METH_VARARGS, NULL}, - { (char *)"RangeSearchPartialResult_swigregister", RangeSearchPartialResult_swigregister, METH_VARARGS, NULL}, - { (char *)"IOReader_name_set", _wrap_IOReader_name_set, METH_VARARGS, NULL}, - { (char *)"IOReader_name_get", _wrap_IOReader_name_get, METH_VARARGS, NULL}, - { (char *)"IOReader___call__", _wrap_IOReader___call__, METH_VARARGS, NULL}, - { (char *)"IOReader_fileno", _wrap_IOReader_fileno, METH_VARARGS, NULL}, - { (char *)"delete_IOReader", _wrap_delete_IOReader, METH_VARARGS, NULL}, - { (char *)"IOReader_swigregister", IOReader_swigregister, METH_VARARGS, NULL}, - { (char *)"IOWriter_name_set", _wrap_IOWriter_name_set, METH_VARARGS, NULL}, - { (char *)"IOWriter_name_get", _wrap_IOWriter_name_get, METH_VARARGS, NULL}, - { (char *)"IOWriter___call__", _wrap_IOWriter___call__, METH_VARARGS, NULL}, - { (char *)"IOWriter_fileno", _wrap_IOWriter_fileno, METH_VARARGS, NULL}, - { (char *)"delete_IOWriter", _wrap_delete_IOWriter, METH_VARARGS, NULL}, - { (char *)"IOWriter_swigregister", IOWriter_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_data_set", _wrap_VectorIOReader_data_set, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_data_get", _wrap_VectorIOReader_data_get, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_rp_set", _wrap_VectorIOReader_rp_set, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_rp_get", _wrap_VectorIOReader_rp_get, METH_VARARGS, NULL}, - { (char *)"VectorIOReader___call__", _wrap_VectorIOReader___call__, METH_VARARGS, NULL}, - { (char *)"new_VectorIOReader", _wrap_new_VectorIOReader, METH_VARARGS, NULL}, - { (char *)"delete_VectorIOReader", _wrap_delete_VectorIOReader, METH_VARARGS, NULL}, - { (char *)"VectorIOReader_swigregister", VectorIOReader_swigregister, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_data_set", _wrap_VectorIOWriter_data_set, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_data_get", _wrap_VectorIOWriter_data_get, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter___call__", _wrap_VectorIOWriter___call__, METH_VARARGS, NULL}, - { (char *)"new_VectorIOWriter", _wrap_new_VectorIOWriter, METH_VARARGS, NULL}, - { (char *)"delete_VectorIOWriter", _wrap_delete_VectorIOWriter, METH_VARARGS, NULL}, - { (char *)"VectorIOWriter_swigregister", VectorIOWriter_swigregister, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_set_query", _wrap_DistanceComputer_set_query, METH_VARARGS, NULL}, - { (char *)"DistanceComputer___call__", _wrap_DistanceComputer___call__, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_symmetric_dis", _wrap_DistanceComputer_symmetric_dis, METH_VARARGS, NULL}, - { (char *)"delete_DistanceComputer", _wrap_delete_DistanceComputer, METH_VARARGS, NULL}, - { (char *)"DistanceComputer_swigregister", DistanceComputer_swigregister, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_want_interrupt", _wrap_InterruptCallback_want_interrupt, METH_VARARGS, NULL}, - { (char *)"delete_InterruptCallback", _wrap_delete_InterruptCallback, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_check", _wrap_InterruptCallback_check, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_is_interrupted", _wrap_InterruptCallback_is_interrupted, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_get_period_hint", _wrap_InterruptCallback_get_period_hint, METH_VARARGS, NULL}, - { (char *)"InterruptCallback_swigregister", InterruptCallback_swigregister, METH_VARARGS, NULL}, - { (char *)"ignore_SIGTTIN", _wrap_ignore_SIGTTIN, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_map_set", _wrap_MapLong2Long_map_set, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_map_get", _wrap_MapLong2Long_map_get, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_add", _wrap_MapLong2Long_add, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_search", _wrap_MapLong2Long_search, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_search_multiple", _wrap_MapLong2Long_search_multiple, METH_VARARGS, NULL}, - { (char *)"new_MapLong2Long", _wrap_new_MapLong2Long, METH_VARARGS, NULL}, - { (char *)"delete_MapLong2Long", _wrap_delete_MapLong2Long, METH_VARARGS, NULL}, - { (char *)"MapLong2Long_swigregister", MapLong2Long_swigregister, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static void *_p_faiss__IndexHNSWFlatTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWFlat *) x)); -} -static void *_p_faiss__IndexHNSWSQTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWSQ *) x)); -} -static void *_p_faiss__IndexHNSWPQTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSWPQ *) x)); -} -static void *_p_faiss__IndexHNSW2LevelTo_p_faiss__IndexHNSW(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexHNSW *) ((faiss::IndexHNSW2Level *) x)); -} -static void *_p_faiss__IndexIDMap2To_p_faiss__IndexIDMap(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIDMap *) ((faiss::IndexIDMap2 *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__IndexIVFPQ(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__RandomRotationMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::RandomRotationMatrix *) x)); -} -static void *_p_faiss__PCAMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::PCAMatrix *) x)); -} -static void *_p_faiss__OPQMatrixTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) (faiss::LinearTransform *) ((faiss::OPQMatrix *) x)); -} -static void *_p_faiss__LinearTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::LinearTransform *) x)); -} -static void *_p_faiss__RemapDimensionsTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::RemapDimensionsTransform *) x)); -} -static void *_p_faiss__NormalizationTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::NormalizationTransform *) x)); -} -static void *_p_faiss__CenteringTransformTo_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform *) ((faiss::CenteringTransform *) x)); -} -static void *_p_faiss__RandomRotationMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::RandomRotationMatrix *) x)); -} -static void *_p_faiss__PCAMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::PCAMatrix *) x)); -} -static void *_p_faiss__OPQMatrixTo_p_faiss__LinearTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::LinearTransform *) ((faiss::OPQMatrix *) x)); -} -static void *_p_p_faiss__RandomRotationMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::RandomRotationMatrix **) x)); -} -static void *_p_p_faiss__PCAMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::PCAMatrix **) x)); -} -static void *_p_p_faiss__OPQMatrixTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) (faiss::LinearTransform *) ((faiss::OPQMatrix **) x)); -} -static void *_p_p_faiss__LinearTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::LinearTransform **) x)); -} -static void *_p_p_faiss__RemapDimensionsTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::RemapDimensionsTransform **) x)); -} -static void *_p_p_faiss__NormalizationTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::NormalizationTransform **) x)); -} -static void *_p_p_faiss__CenteringTransformTo_p_p_faiss__VectorTransform(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::VectorTransform **) ((faiss::CenteringTransform **) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVFFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IDSelectorBatchTo_p_faiss__IDSelector(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IDSelector *) ((faiss::IDSelectorBatch *) x)); -} -static void *_p_faiss__IDSelectorRangeTo_p_faiss__IDSelector(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IDSelector *) ((faiss::IDSelectorRange *) x)); -} -static void *_p_faiss__RangeSearchPartialResultTo_p_faiss__BufferList(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::BufferList *) ((faiss::RangeSearchPartialResult *) x)); -} -static void *_p_faiss__ReproduceDistancesObjectiveTo_p_faiss__PermutationObjective(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::PermutationObjective *) ((faiss::ReproduceDistancesObjective *) x)); -} -static void *_p_faiss__IndexFlatL2To_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) ((faiss::IndexFlatL2 *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) (faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__IndexFlatIPTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) ((faiss::IndexFlatIP *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlat(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlat *) (faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__ArrayInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::ArrayInvertedLists *) x)); -} -static void *_p_faiss__ConcatenatedInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::ConcatenatedInvertedLists *) x)); -} -static void *_p_faiss__OnDiskInvertedListsTo_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists *) ((faiss::OnDiskInvertedLists *) x)); -} -static void *_p_p_faiss__ArrayInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::ArrayInvertedLists **) x)); -} -static void *_p_p_faiss__ConcatenatedInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::ConcatenatedInvertedLists **) x)); -} -static void *_p_p_faiss__OnDiskInvertedListsTo_p_p_faiss__InvertedLists(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::InvertedLists **) ((faiss::OnDiskInvertedLists **) x)); -} -static void *_p_faiss__VectorIOReaderTo_p_faiss__IOReader(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IOReader *) ((faiss::VectorIOReader *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__IndexFlatL2(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlatL2(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) (faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__IndexIVF(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexIVF *) (faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__PolysemousTrainingTo_p_faiss__SimulatedAnnealingParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::SimulatedAnnealingParameters *) ((faiss::PolysemousTraining *) x)); -} -static void *_p_faiss__SimulatedAnnealingOptimizerTo_p_faiss__SimulatedAnnealingParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::SimulatedAnnealingParameters *) ((faiss::SimulatedAnnealingOptimizer *) x)); -} -static void *_p_faiss__ClusteringTo_p_faiss__ClusteringParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::ClusteringParameters *) ((faiss::Clustering *) x)); -} -static void *_p_faiss__IVFPQSearchParametersTo_p_faiss__IVFSearchParameters(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IVFSearchParameters *) ((faiss::IVFPQSearchParameters *) x)); -} -static void *_p_p_faiss__IndexPreTransformTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexPreTransform **) x)); -} -static void *_p_p_faiss__IndexIVFTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexIVF **) x)); -} -static void *_p_p_faiss__IndexFlatL2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *) ((faiss::IndexFlatL2 **) x)); -} -static void *_p_p_faiss__IndexHNSWFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWFlat **) x)); -} -static void *_p_p_faiss__Index2LayerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::Index2Layer **) x)); -} -static void *_p_p_faiss__IndexFlatIPTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *) ((faiss::IndexFlatIP **) x)); -} -static void *_p_p_faiss__IndexHNSWTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexHNSW **) x)); -} -static void *_p_p_faiss__IndexHNSWPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWPQ **) x)); -} -static void *_p_p_faiss__IndexIVFFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFFlat **) x)); -} -static void *_p_p_faiss__IndexLSHTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexLSH **) x)); -} -static void *_p_p_faiss__IndexFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexFlat **) x)); -} -static void *_p_p_faiss__IndexIVFFlatDedupTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup **) x)); -} -static void *_p_p_faiss__IndexIVFPQRTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR **) x)); -} -static void *_p_p_faiss__IndexFlat1DTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlat1D **) x)); -} -static void *_p_p_faiss__IndexFlatL2BaseShiftTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift **) x)); -} -static void *_p_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexShardsTemplate< faiss::Index > **) x)); -} -static void *_p_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexReplicasTemplate< faiss::Index > **) x)); -} -static void *_p_p_faiss__IndexHNSW2LevelTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSW2Level **) x)); -} -static void *_p_p_faiss__IndexIDMap2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIDMap *) ((faiss::IndexIDMap2 **) x)); -} -static void *_p_p_faiss__IndexSplitVectorsTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexSplitVectors **) x)); -} -static void *_p_p_faiss__IndexRefineFlatTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexRefineFlat **) x)); -} -static void *_p_p_faiss__IndexHNSWSQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexHNSW *) ((faiss::IndexHNSWSQ **) x)); -} -static void *_p_p_faiss__MultiIndexQuantizer2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 **) x)); -} -static void *_p_p_faiss__IndexPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexPQ **) x)); -} -static void *_p_p_faiss__IndexIDMapTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexIDMap **) x)); -} -static void *_p_p_faiss__IndexIVFPQTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFPQ **) x)); -} -static void *_p_p_faiss__IndexIVFScalarQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer **) x)); -} -static void *_p_p_faiss__IndexScalarQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::IndexScalarQuantizer **) x)); -} -static void *_p_p_faiss__MultiIndexQuantizerTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index **) ((faiss::MultiIndexQuantizer **) x)); -} -static void *_p_faiss__IndexPreTransformTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexPreTransform *) x)); -} -static void *_p_faiss__IndexIVFTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexIVF *) x)); -} -static void *_p_faiss__IndexFlatL2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *) ((faiss::IndexFlatL2 *) x)); -} -static void *_p_faiss__IndexHNSWFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWFlat *) x)); -} -static void *_p_faiss__Index2LayerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::Index2Layer *) x)); -} -static void *_p_faiss__IndexFlatIPTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *) ((faiss::IndexFlatIP *) x)); -} -static void *_p_faiss__IndexHNSWTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexHNSW *) x)); -} -static void *_p_faiss__IndexHNSWPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__IndexLSHTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexLSH *) x)); -} -static void *_p_faiss__IndexFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexFlat *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__IndexFlat1DTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlat1D *) x)); -} -static void *_p_faiss__IndexFlatL2BaseShiftTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexFlat *)(faiss::IndexFlatL2 *) ((faiss::IndexFlatL2BaseShift *) x)); -} -static void *_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexShardsTemplate< faiss::Index > *) x)); -} -static void *_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexReplicasTemplate< faiss::Index > *) x)); -} -static void *_p_faiss__IndexHNSW2LevelTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSW2Level *) x)); -} -static void *_p_faiss__IndexIDMap2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIDMap *) ((faiss::IndexIDMap2 *) x)); -} -static void *_p_faiss__IndexSplitVectorsTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexSplitVectors *) x)); -} -static void *_p_faiss__IndexRefineFlatTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexRefineFlat *) x)); -} -static void *_p_faiss__IndexHNSWSQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWSQ *) x)); -} -static void *_p_faiss__MultiIndexQuantizer2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 *) x)); -} -static void *_p_faiss__IndexPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexPQ *) x)); -} -static void *_p_faiss__IndexIDMapTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexIDMap *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexScalarQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::IndexScalarQuantizer *) x)); -} -static void *_p_faiss__MultiIndexQuantizerTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Index *) ((faiss::MultiIndexQuantizer *) x)); -} -static void *_p_faiss__IndexBinaryFlatTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryFlat *) x)); -} -static void *_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexShardsTemplate< faiss::IndexBinary > *) x)); -} -static void *_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexReplicasTemplate< faiss::IndexBinary > *) x)); -} -static void *_p_faiss__IndexBinaryHNSWTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryHNSW *) x)); -} -static void *_p_faiss__IndexBinaryIVFTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryIVF *) x)); -} -static void *_p_faiss__IndexBinaryFromFloatTo_p_faiss__IndexBinary(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IndexBinary *) ((faiss::IndexBinaryFromFloat *) x)); -} -static void *_p_faiss__MultiIndexQuantizer2To_p_faiss__MultiIndexQuantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 *) x)); -} -static void *_p_faiss__IndexIVFTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) ((faiss::IndexIVF *) x)); -} -static void *_p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFScalarQuantizer *) x)); -} -static void *_p_faiss__IndexIVFPQTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFPQ *) x)); -} -static void *_p_faiss__IndexIVFFlatTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *) ((faiss::IndexIVFFlat *) x)); -} -static void *_p_faiss__IndexIVFFlatDedupTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *)(faiss::IndexIVFFlat *) ((faiss::IndexIVFFlatDedup *) x)); -} -static void *_p_faiss__IndexIVFPQRTo_p_faiss__Level1Quantizer(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::Level1Quantizer *) (faiss::IndexIVF *)(faiss::IndexIVFPQ *) ((faiss::IndexIVFPQR *) x)); -} -static void *_p_faiss__OneRecallAtRCriterionTo_p_faiss__AutoTuneCriterion(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::AutoTuneCriterion *) ((faiss::OneRecallAtRCriterion *) x)); -} -static void *_p_faiss__IntersectionCriterionTo_p_faiss__AutoTuneCriterion(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::AutoTuneCriterion *) ((faiss::IntersectionCriterion *) x)); -} -static void *_p_faiss__VectorIOWriterTo_p_faiss__IOWriter(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((faiss::IOWriter *) ((faiss::VectorIOWriter *) x)); -} -static swig_type_info _swigt__p_Crev = {"_p_Crev", "Crev *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_MapLong2Long = {"_p_MapLong2Long", "MapLong2Long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Node = {"_p_Node", "Node *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_T = {"_p_T", "T *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_TI = {"_p_TI", "TI *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_component_t = {"_p_component_t", "component_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_distance_t = {"_p_distance_t", "distance_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ArrayInvertedLists = {"_p_faiss__ArrayInvertedLists", "faiss::ArrayInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__AutoTuneCriterion = {"_p_faiss__AutoTuneCriterion", "faiss::AutoTuneCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__BinaryInvertedListScanner = {"_p_faiss__BinaryInvertedListScanner", "faiss::BinaryInvertedListScanner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__BufferList = {"_p_faiss__BufferList", "faiss::BufferList *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__CenteringTransform = {"_p_faiss__CenteringTransform", "faiss::CenteringTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Cloner = {"_p_faiss__Cloner", "faiss::Cloner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Clustering = {"_p_faiss__Clustering", "faiss::Clustering *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ClusteringParameters = {"_p_faiss__ClusteringParameters", "faiss::ClusteringParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ConcatenatedInvertedLists = {"_p_faiss__ConcatenatedInvertedLists", "faiss::ConcatenatedInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__DistanceComputer = {"_p_faiss__DistanceComputer", "faiss::DistanceComputer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer16 = {"_p_faiss__GenHammingComputer16", "faiss::GenHammingComputer16 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer32 = {"_p_faiss__GenHammingComputer32", "faiss::GenHammingComputer32 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputer8 = {"_p_faiss__GenHammingComputer8", "faiss::GenHammingComputer8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__GenHammingComputerM8 = {"_p_faiss__GenHammingComputerM8", "faiss::GenHammingComputerM8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSW = {"_p_faiss__HNSW", "faiss::HNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSWStats = {"_p_faiss__HNSWStats", "faiss::HNSWStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HNSW__MinimaxHeap = {"_p_faiss__HNSW__MinimaxHeap", "faiss::HNSW::MinimaxHeap *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer16 = {"_p_faiss__HammingComputer16", "faiss::HammingComputer16 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer20 = {"_p_faiss__HammingComputer20", "faiss::HammingComputer20 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer32 = {"_p_faiss__HammingComputer32", "faiss::HammingComputer32 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer4 = {"_p_faiss__HammingComputer4", "faiss::HammingComputer4 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer64 = {"_p_faiss__HammingComputer64", "faiss::HammingComputer64 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputer8 = {"_p_faiss__HammingComputer8", "faiss::HammingComputer8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerDefault = {"_p_faiss__HammingComputerDefault", "faiss::HammingComputerDefault *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerM4 = {"_p_faiss__HammingComputerM4", "faiss::HammingComputerM4 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HammingComputerM8 = {"_p_faiss__HammingComputerM8", "faiss::HammingComputerM8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t", "faiss::HeapArray< faiss::CMax< float,long > > *|faiss::float_maxheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t", "faiss::HeapArray< faiss::CMax< int,long > > *|faiss::int_maxheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t", "faiss::HeapArray< faiss::CMin< float,long > > *|faiss::float_minheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t = {"_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t", "faiss::HeapArray< faiss::CMin< int,long > > *|faiss::int_minheap_array_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelector = {"_p_faiss__IDSelector", "faiss::IDSelector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelectorBatch = {"_p_faiss__IDSelectorBatch", "faiss::IDSelectorBatch *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IDSelectorRange = {"_p_faiss__IDSelectorRange", "faiss::IDSelectorRange *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IOReader = {"_p_faiss__IOReader", "faiss::IOReader *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IOWriter = {"_p_faiss__IOWriter", "faiss::IOWriter *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IVFPQSearchParameters = {"_p_faiss__IVFPQSearchParameters", "faiss::IVFPQSearchParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IVFSearchParameters = {"_p_faiss__IVFSearchParameters", "faiss::IVFSearchParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Index = {"_p_faiss__Index", "faiss::Index *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Index2Layer = {"_p_faiss__Index2Layer", "faiss::Index2Layer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinary = {"_p_faiss__IndexBinary", "faiss::IndexBinary *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryFlat = {"_p_faiss__IndexBinaryFlat", "faiss::IndexBinaryFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryFromFloat = {"_p_faiss__IndexBinaryFromFloat", "faiss::IndexBinaryFromFloat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryHNSW = {"_p_faiss__IndexBinaryHNSW", "faiss::IndexBinaryHNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexBinaryIVF = {"_p_faiss__IndexBinaryIVF", "faiss::IndexBinaryIVF *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlat = {"_p_faiss__IndexFlat", "faiss::IndexFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlat1D = {"_p_faiss__IndexFlat1D", "faiss::IndexFlat1D *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatIP = {"_p_faiss__IndexFlatIP", "faiss::IndexFlatIP *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatL2 = {"_p_faiss__IndexFlatL2", "faiss::IndexFlatL2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexFlatL2BaseShift = {"_p_faiss__IndexFlatL2BaseShift", "faiss::IndexFlatL2BaseShift *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSW = {"_p_faiss__IndexHNSW", "faiss::IndexHNSW *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSW2Level = {"_p_faiss__IndexHNSW2Level", "faiss::IndexHNSW2Level *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWFlat = {"_p_faiss__IndexHNSWFlat", "faiss::IndexHNSWFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWPQ = {"_p_faiss__IndexHNSWPQ", "faiss::IndexHNSWPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexHNSWSQ = {"_p_faiss__IndexHNSWSQ", "faiss::IndexHNSWSQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIDMap = {"_p_faiss__IndexIDMap", "faiss::IndexIDMap *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIDMap2 = {"_p_faiss__IndexIDMap2", "faiss::IndexIDMap2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVF = {"_p_faiss__IndexIVF", "faiss::IndexIVF *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFFlat = {"_p_faiss__IndexIVFFlat", "faiss::IndexIVFFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFFlatDedup = {"_p_faiss__IndexIVFFlatDedup", "faiss::IndexIVFFlatDedup *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQ = {"_p_faiss__IndexIVFPQ", "faiss::IndexIVFPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQR = {"_p_faiss__IndexIVFPQR", "faiss::IndexIVFPQR *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFPQStats = {"_p_faiss__IndexIVFPQStats", "faiss::IndexIVFPQStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFScalarQuantizer = {"_p_faiss__IndexIVFScalarQuantizer", "faiss::IndexIVFScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexIVFStats = {"_p_faiss__IndexIVFStats", "faiss::IndexIVFStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexLSH = {"_p_faiss__IndexLSH", "faiss::IndexLSH *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPQ = {"_p_faiss__IndexPQ", "faiss::IndexPQ *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPQStats = {"_p_faiss__IndexPQStats", "faiss::IndexPQStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexPreTransform = {"_p_faiss__IndexPreTransform", "faiss::IndexPreTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexRefineFlat = {"_p_faiss__IndexRefineFlat", "faiss::IndexRefineFlat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t = {"_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t", "faiss::IndexBinaryReplicas *|faiss::IndexReplicasTemplate< faiss::IndexBinary > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t = {"_p_faiss__IndexReplicasTemplateT_faiss__Index_t", "faiss::IndexReplicas *|faiss::IndexReplicasTemplate< faiss::Index > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexScalarQuantizer = {"_p_faiss__IndexScalarQuantizer", "faiss::IndexScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t = {"_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t", "faiss::IndexBinaryShards *|faiss::IndexShardsTemplate< faiss::IndexBinary > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t = {"_p_faiss__IndexShardsTemplateT_faiss__Index_t", "faiss::IndexShards *|faiss::IndexShardsTemplate< faiss::Index > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IndexSplitVectors = {"_p_faiss__IndexSplitVectors", "faiss::IndexSplitVectors *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InterruptCallback = {"_p_faiss__InterruptCallback", "faiss::InterruptCallback *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__IntersectionCriterion = {"_p_faiss__IntersectionCriterion", "faiss::IntersectionCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InvertedListScanner = {"_p_faiss__InvertedListScanner", "faiss::InvertedListScanner *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__InvertedLists = {"_p_faiss__InvertedLists", "faiss::InvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__Level1Quantizer = {"_p_faiss__Level1Quantizer", "faiss::Level1Quantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__LinearTransform = {"_p_faiss__LinearTransform", "faiss::LinearTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__LockLevels = {"_p_faiss__LockLevels", "faiss::LockLevels *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MatrixStats = {"_p_faiss__MatrixStats", "faiss::MatrixStats *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MultiIndexQuantizer = {"_p_faiss__MultiIndexQuantizer", "faiss::MultiIndexQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__MultiIndexQuantizer2 = {"_p_faiss__MultiIndexQuantizer2", "faiss::MultiIndexQuantizer2 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__NormalizationTransform = {"_p_faiss__NormalizationTransform", "faiss::NormalizationTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OPQMatrix = {"_p_faiss__OPQMatrix", "faiss::OPQMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OnDiskInvertedLists = {"_p_faiss__OnDiskInvertedLists", "faiss::OnDiskInvertedLists *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch = {"_p_faiss__OnDiskInvertedLists__OngoingPrefetch", "faiss::OnDiskInvertedLists::OngoingPrefetch *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OneRecallAtRCriterion = {"_p_faiss__OneRecallAtRCriterion", "faiss::OneRecallAtRCriterion *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OperatingPoint = {"_p_faiss__OperatingPoint", "faiss::OperatingPoint *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__OperatingPoints = {"_p_faiss__OperatingPoints", "faiss::OperatingPoints *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PCAMatrix = {"_p_faiss__PCAMatrix", "faiss::PCAMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ParameterRange = {"_p_faiss__ParameterRange", "faiss::ParameterRange *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ParameterSpace = {"_p_faiss__ParameterSpace", "faiss::ParameterSpace *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PermutationObjective = {"_p_faiss__PermutationObjective", "faiss::PermutationObjective *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__PolysemousTraining = {"_p_faiss__PolysemousTraining", "faiss::PolysemousTraining *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ProductQuantizer = {"_p_faiss__ProductQuantizer", "faiss::ProductQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RandomGenerator = {"_p_faiss__RandomGenerator", "faiss::RandomGenerator *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RandomRotationMatrix = {"_p_faiss__RandomRotationMatrix", "faiss::RandomRotationMatrix *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeQueryResult = {"_p_faiss__RangeQueryResult", "faiss::RangeQueryResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeSearchPartialResult = {"_p_faiss__RangeSearchPartialResult", "faiss::RangeSearchPartialResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RangeSearchResult = {"_p_faiss__RangeSearchResult", "faiss::RangeSearchResult *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ReconstructFromNeighbors = {"_p_faiss__ReconstructFromNeighbors", "faiss::ReconstructFromNeighbors *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__RemapDimensionsTransform = {"_p_faiss__RemapDimensionsTransform", "faiss::RemapDimensionsTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ReproduceDistancesObjective = {"_p_faiss__ReproduceDistancesObjective", "faiss::ReproduceDistancesObjective *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SQDistanceComputer = {"_p_faiss__SQDistanceComputer", "faiss::SQDistanceComputer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ScalarQuantizer = {"_p_faiss__ScalarQuantizer", "faiss::ScalarQuantizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SimulatedAnnealingOptimizer = {"_p_faiss__SimulatedAnnealingOptimizer", "faiss::SimulatedAnnealingOptimizer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__SimulatedAnnealingParameters = {"_p_faiss__SimulatedAnnealingParameters", "faiss::SimulatedAnnealingParameters *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorIOReader = {"_p_faiss__VectorIOReader", "faiss::VectorIOReader *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorIOWriter = {"_p_faiss__VectorIOWriter", "faiss::VectorIOWriter *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VectorTransform = {"_p_faiss__VectorTransform", "faiss::VectorTransform *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__VisitedTable = {"_p_faiss__VisitedTable", "faiss::VisitedTable *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_faiss__ivflib__SlidingIndexWindow = {"_p_faiss__ivflib__SlidingIndexWindow", "faiss::ivflib::SlidingIndexWindow *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_float = {"_p_float", "faiss::IndexShardsTemplate< faiss::Index >::distance_t *|faiss::IndexShardsTemplate< faiss::Index >::component_t *|float *|faiss::IndexReplicasTemplate< faiss::Index >::distance_t *|faiss::HeapArray< faiss::CMin< float,long > >::T *|faiss::HeapArray< faiss::CMax< float,long > >::T *|faiss::IndexReplicasTemplate< faiss::Index >::component_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_idx_t = {"_p_idx_t", "idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "faiss::IndexShardsTemplate< faiss::IndexBinary >::distance_t *|int *|int32_t *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::distance_t *|hamdis_t *|faiss::HeapArray< faiss::CMin< int,long > >::T *|faiss::HeapArray< faiss::CMax< int,long > >::T *|faiss::IndexHNSW::storage_idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_long = {"_p_long", "faiss::IndexReplicasTemplate< faiss::Index >::idx_t *|faiss::IndexShardsTemplate< faiss::Index >::idx_t *|faiss::IndexShardsTemplate< faiss::IndexBinary >::idx_t *|faiss::HeapArray< faiss::CMax< float,long > >::TI *|faiss::HeapArray< faiss::CMin< float,long > >::TI *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::idx_t *|faiss::RangeSearchResult::idx_t *|faiss::AutoTuneCriterion::idx_t *|faiss::Index::idx_t *|faiss::InvertedLists::idx_t *|faiss::ivflib::idx_t *|faiss::HNSW::idx_t *|faiss::ReconstructFromNeighbors::idx_t *|faiss::IndexBinary::idx_t *|faiss::IDSelector::idx_t *|faiss::BufferList::idx_t *|faiss::HeapArray< faiss::CMin< int,long > >::TI *|faiss::HeapArray< faiss::CMax< int,long > >::TI *|long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_omp_lock_t = {"_p_omp_lock_t", "omp_lock_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__Index = {"_p_p_faiss__Index", "faiss::Index **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexPreTransform = {"_p_p_faiss__IndexPreTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVF = {"_p_p_faiss__IndexIVF", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatL2 = {"_p_p_faiss__IndexFlatL2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWFlat = {"_p_p_faiss__IndexHNSWFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__Index2Layer = {"_p_p_faiss__Index2Layer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWPQ = {"_p_p_faiss__IndexHNSWPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t = {"_p_p_faiss__IndexReplicasTemplateT_faiss__Index_t", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t = {"_p_p_faiss__IndexShardsTemplateT_faiss__Index_t", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatIP = {"_p_p_faiss__IndexFlatIP", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSW = {"_p_p_faiss__IndexHNSW", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFFlat = {"_p_p_faiss__IndexIVFFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexLSH = {"_p_p_faiss__IndexLSH", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFPQR = {"_p_p_faiss__IndexIVFPQR", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFFlatDedup = {"_p_p_faiss__IndexIVFFlatDedup", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlat = {"_p_p_faiss__IndexFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlat1D = {"_p_p_faiss__IndexFlat1D", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexFlatL2BaseShift = {"_p_p_faiss__IndexFlatL2BaseShift", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSW2Level = {"_p_p_faiss__IndexHNSW2Level", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIDMap2 = {"_p_p_faiss__IndexIDMap2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexSplitVectors = {"_p_p_faiss__IndexSplitVectors", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexRefineFlat = {"_p_p_faiss__IndexRefineFlat", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexHNSWSQ = {"_p_p_faiss__IndexHNSWSQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__MultiIndexQuantizer2 = {"_p_p_faiss__MultiIndexQuantizer2", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexPQ = {"_p_p_faiss__IndexPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIDMap = {"_p_p_faiss__IndexIDMap", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFPQ = {"_p_p_faiss__IndexIVFPQ", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexIVFScalarQuantizer = {"_p_p_faiss__IndexIVFScalarQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__IndexScalarQuantizer = {"_p_p_faiss__IndexScalarQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__MultiIndexQuantizer = {"_p_p_faiss__MultiIndexQuantizer", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__InvertedLists = {"_p_p_faiss__InvertedLists", "faiss::InvertedLists **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__ArrayInvertedLists = {"_p_p_faiss__ArrayInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__ConcatenatedInvertedLists = {"_p_p_faiss__ConcatenatedInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__OnDiskInvertedLists = {"_p_p_faiss__OnDiskInvertedLists", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__VectorTransform = {"_p_p_faiss__VectorTransform", "faiss::VectorTransform **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_faiss__RandomRotationMatrix = {"_p_p_faiss__RandomRotationMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__PCAMatrix = {"_p_p_faiss__PCAMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__OPQMatrix = {"_p_p_faiss__OPQMatrix", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__LinearTransform = {"_p_p_faiss__LinearTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__RemapDimensionsTransform = {"_p_p_faiss__RemapDimensionsTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__NormalizationTransform = {"_p_p_faiss__NormalizationTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_p_faiss__CenteringTransform = {"_p_p_faiss__CenteringTransform", 0, 0, 0, 0, 0}; -static swig_type_info _swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t = {"_p_std__functionT_void_ffaiss__IndexBinary_pF_t", "std::function< void (faiss::IndexBinary *) > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__functionT_void_ffaiss__Index_pF_t = {"_p_std__functionT_void_ffaiss__Index_pF_t", "std::function< void (faiss::Index *) > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t = {"_p_std__listT_faiss__OnDiskInvertedLists__Slot_t", "std::list< faiss::OnDiskInvertedLists::Slot > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__mt19937 = {"_p_std__mt19937", "std::mt19937 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__pairT_float_int_t = {"_p_std__pairT_float_int_t", "std::pair< float,int > *|faiss::HNSW::Node *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t = {"_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t", "std::priority_queue< faiss::HNSW::NodeDistFarther > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__priority_queueT_std__pairT_float_int_t_t = {"_p_std__priority_queueT_std__pairT_float_int_t_t", "std::priority_queue< std::pair< float,int > > *|std::priority_queue< faiss::HNSW::Node > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_mapT_long_long_t = {"_p_std__unordered_mapT_long_long_t", "std::unordered_map< long,long > *|std::unordered_map< faiss::Index::idx_t,faiss::Index::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t = {"_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t", "std::unordered_map< uint64_t,faiss::MatrixStats::Occurrence > *|std::unordered_map< unsigned long,faiss::MatrixStats::Occurrence > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__unordered_multimapT_long_long_t = {"_p_std__unordered_multimapT_long_long_t", "std::unordered_multimap< long,long > *|std::unordered_multimap< faiss::Index::idx_t,faiss::Index::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_char_t = {"_p_std__vectorT_char_t", "std::vector< char > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_double_t = {"_p_std__vectorT_double_t", "std::vector< double > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__BufferList__Buffer_t = {"_p_std__vectorT_faiss__BufferList__Buffer_t", "std::vector< faiss::BufferList::Buffer > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t = {"_p_std__vectorT_faiss__HNSW__NodeDistFarther_t", "std::vector< faiss::HNSW::NodeDistFarther > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__IndexBinary_p_t = {"_p_std__vectorT_faiss__IndexBinary_p_t", "std::vector< faiss::IndexBinary * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__Index_p_t = {"_p_std__vectorT_faiss__Index_p_t", "std::vector< faiss::Index * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__InvertedLists_const_p_t = {"_p_std__vectorT_faiss__InvertedLists_const_p_t", "std::vector< faiss::InvertedLists const * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__InvertedLists_p_t = {"_p_std__vectorT_faiss__InvertedLists_p_t", "std::vector< faiss::InvertedLists * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t = {"_p_std__vectorT_faiss__MatrixStats__PerDimStats_t", "std::vector< faiss::MatrixStats::PerDimStats > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t = {"_p_std__vectorT_faiss__OnDiskInvertedLists__List_t", "std::vector< faiss::OnDiskInvertedLists::List > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__OperatingPoint_t = {"_p_std__vectorT_faiss__OperatingPoint_t", "std::vector< faiss::OperatingPoint > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__ParameterRange_t = {"_p_std__vectorT_faiss__ParameterRange_t", "std::vector< faiss::ParameterRange > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__RangeQueryResult_t = {"_p_std__vectorT_faiss__RangeQueryResult_t", "std::vector< faiss::RangeQueryResult > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_faiss__VectorTransform_p_t = {"_p_std__vectorT_faiss__VectorTransform_p_t", "std::vector< faiss::VectorTransform * > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_float_t = {"_p_std__vectorT_float_t", "std::vector< float > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_int_t = {"_p_std__vectorT_int_t", "std::vector< faiss::HNSW::storage_idx_t > *|std::vector< int > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_long_t = {"_p_std__vectorT_long_t", "std::vector< long > *|std::vector< faiss::Index::idx_t > *|std::vector< faiss::AutoTuneCriterion::idx_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_omp_lock_t_t = {"_p_std__vectorT_omp_lock_t_t", "std::vector< omp_lock_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_float_t_t = {"_p_std__vectorT_std__vectorT_float_t_t", "std::vector< std::vector< float > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_long_t_t = {"_p_std__vectorT_std__vectorT_long_t_t", "std::vector< std::vector< long > > *|std::vector< std::vector< faiss::InvertedLists::idx_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_uint8_t_t_t = {"_p_std__vectorT_std__vectorT_uint8_t_t_t", "std::vector< std::vector< unsigned char > > *|std::vector< std::vector< uint8_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t = {"_p_std__vectorT_std__vectorT_unsigned_long_t_t", "std::vector< std::vector< unsigned long > > *|std::vector< std::vector< size_t > > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_unsigned_char_t = {"_p_std__vectorT_unsigned_char_t", "std::vector< unsigned char > *|std::vector< uint8_t > *|std::vector< faiss::IndexLSH::uint8_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorT_unsigned_long_t = {"_p_std__vectorT_unsigned_long_t", "std::vector< unsigned long > *|std::vector< size_t > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_storage_idx_t = {"_p_storage_idx_t", "storage_idx_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "faiss::IndexShardsTemplate< faiss::IndexBinary >::component_t *|unsigned char *|faiss::IndexReplicasTemplate< faiss::IndexBinary >::component_t *|uint8_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uint64_t *|size_t *|unsigned long *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_Crev, - &_swigt__p_FILE, - &_swigt__p_MapLong2Long, - &_swigt__p_Node, - &_swigt__p_T, - &_swigt__p_TI, - &_swigt__p_char, - &_swigt__p_component_t, - &_swigt__p_distance_t, - &_swigt__p_double, - &_swigt__p_faiss__ArrayInvertedLists, - &_swigt__p_faiss__AutoTuneCriterion, - &_swigt__p_faiss__BinaryInvertedListScanner, - &_swigt__p_faiss__BufferList, - &_swigt__p_faiss__CenteringTransform, - &_swigt__p_faiss__Cloner, - &_swigt__p_faiss__Clustering, - &_swigt__p_faiss__ClusteringParameters, - &_swigt__p_faiss__ConcatenatedInvertedLists, - &_swigt__p_faiss__DistanceComputer, - &_swigt__p_faiss__GenHammingComputer16, - &_swigt__p_faiss__GenHammingComputer32, - &_swigt__p_faiss__GenHammingComputer8, - &_swigt__p_faiss__GenHammingComputerM8, - &_swigt__p_faiss__HNSW, - &_swigt__p_faiss__HNSWStats, - &_swigt__p_faiss__HNSW__MinimaxHeap, - &_swigt__p_faiss__HammingComputer16, - &_swigt__p_faiss__HammingComputer20, - &_swigt__p_faiss__HammingComputer32, - &_swigt__p_faiss__HammingComputer4, - &_swigt__p_faiss__HammingComputer64, - &_swigt__p_faiss__HammingComputer8, - &_swigt__p_faiss__HammingComputerDefault, - &_swigt__p_faiss__HammingComputerM4, - &_swigt__p_faiss__HammingComputerM8, - &_swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, - &_swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, - &_swigt__p_faiss__IDSelector, - &_swigt__p_faiss__IDSelectorBatch, - &_swigt__p_faiss__IDSelectorRange, - &_swigt__p_faiss__IOReader, - &_swigt__p_faiss__IOWriter, - &_swigt__p_faiss__IVFPQSearchParameters, - &_swigt__p_faiss__IVFSearchParameters, - &_swigt__p_faiss__Index, - &_swigt__p_faiss__Index2Layer, - &_swigt__p_faiss__IndexBinary, - &_swigt__p_faiss__IndexBinaryFlat, - &_swigt__p_faiss__IndexBinaryFromFloat, - &_swigt__p_faiss__IndexBinaryHNSW, - &_swigt__p_faiss__IndexBinaryIVF, - &_swigt__p_faiss__IndexFlat, - &_swigt__p_faiss__IndexFlat1D, - &_swigt__p_faiss__IndexFlatIP, - &_swigt__p_faiss__IndexFlatL2, - &_swigt__p_faiss__IndexFlatL2BaseShift, - &_swigt__p_faiss__IndexHNSW, - &_swigt__p_faiss__IndexHNSW2Level, - &_swigt__p_faiss__IndexHNSWFlat, - &_swigt__p_faiss__IndexHNSWPQ, - &_swigt__p_faiss__IndexHNSWSQ, - &_swigt__p_faiss__IndexIDMap, - &_swigt__p_faiss__IndexIDMap2, - &_swigt__p_faiss__IndexIVF, - &_swigt__p_faiss__IndexIVFFlat, - &_swigt__p_faiss__IndexIVFFlatDedup, - &_swigt__p_faiss__IndexIVFPQ, - &_swigt__p_faiss__IndexIVFPQR, - &_swigt__p_faiss__IndexIVFPQStats, - &_swigt__p_faiss__IndexIVFScalarQuantizer, - &_swigt__p_faiss__IndexIVFStats, - &_swigt__p_faiss__IndexLSH, - &_swigt__p_faiss__IndexPQ, - &_swigt__p_faiss__IndexPQStats, - &_swigt__p_faiss__IndexPreTransform, - &_swigt__p_faiss__IndexRefineFlat, - &_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, - &_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, - &_swigt__p_faiss__IndexScalarQuantizer, - &_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, - &_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, - &_swigt__p_faiss__IndexSplitVectors, - &_swigt__p_faiss__InterruptCallback, - &_swigt__p_faiss__IntersectionCriterion, - &_swigt__p_faiss__InvertedListScanner, - &_swigt__p_faiss__InvertedLists, - &_swigt__p_faiss__Level1Quantizer, - &_swigt__p_faiss__LinearTransform, - &_swigt__p_faiss__LockLevels, - &_swigt__p_faiss__MatrixStats, - &_swigt__p_faiss__MultiIndexQuantizer, - &_swigt__p_faiss__MultiIndexQuantizer2, - &_swigt__p_faiss__NormalizationTransform, - &_swigt__p_faiss__OPQMatrix, - &_swigt__p_faiss__OnDiskInvertedLists, - &_swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch, - &_swigt__p_faiss__OneRecallAtRCriterion, - &_swigt__p_faiss__OperatingPoint, - &_swigt__p_faiss__OperatingPoints, - &_swigt__p_faiss__PCAMatrix, - &_swigt__p_faiss__ParameterRange, - &_swigt__p_faiss__ParameterSpace, - &_swigt__p_faiss__PermutationObjective, - &_swigt__p_faiss__PolysemousTraining, - &_swigt__p_faiss__ProductQuantizer, - &_swigt__p_faiss__RandomGenerator, - &_swigt__p_faiss__RandomRotationMatrix, - &_swigt__p_faiss__RangeQueryResult, - &_swigt__p_faiss__RangeSearchPartialResult, - &_swigt__p_faiss__RangeSearchResult, - &_swigt__p_faiss__ReconstructFromNeighbors, - &_swigt__p_faiss__RemapDimensionsTransform, - &_swigt__p_faiss__ReproduceDistancesObjective, - &_swigt__p_faiss__SQDistanceComputer, - &_swigt__p_faiss__ScalarQuantizer, - &_swigt__p_faiss__SimulatedAnnealingOptimizer, - &_swigt__p_faiss__SimulatedAnnealingParameters, - &_swigt__p_faiss__VectorIOReader, - &_swigt__p_faiss__VectorIOWriter, - &_swigt__p_faiss__VectorTransform, - &_swigt__p_faiss__VisitedTable, - &_swigt__p_faiss__ivflib__SlidingIndexWindow, - &_swigt__p_float, - &_swigt__p_idx_t, - &_swigt__p_int, - &_swigt__p_long, - &_swigt__p_omp_lock_t, - &_swigt__p_p_faiss__ArrayInvertedLists, - &_swigt__p_p_faiss__CenteringTransform, - &_swigt__p_p_faiss__ConcatenatedInvertedLists, - &_swigt__p_p_faiss__Index, - &_swigt__p_p_faiss__Index2Layer, - &_swigt__p_p_faiss__IndexFlat, - &_swigt__p_p_faiss__IndexFlat1D, - &_swigt__p_p_faiss__IndexFlatIP, - &_swigt__p_p_faiss__IndexFlatL2, - &_swigt__p_p_faiss__IndexFlatL2BaseShift, - &_swigt__p_p_faiss__IndexHNSW, - &_swigt__p_p_faiss__IndexHNSW2Level, - &_swigt__p_p_faiss__IndexHNSWFlat, - &_swigt__p_p_faiss__IndexHNSWPQ, - &_swigt__p_p_faiss__IndexHNSWSQ, - &_swigt__p_p_faiss__IndexIDMap, - &_swigt__p_p_faiss__IndexIDMap2, - &_swigt__p_p_faiss__IndexIVF, - &_swigt__p_p_faiss__IndexIVFFlat, - &_swigt__p_p_faiss__IndexIVFFlatDedup, - &_swigt__p_p_faiss__IndexIVFPQ, - &_swigt__p_p_faiss__IndexIVFPQR, - &_swigt__p_p_faiss__IndexIVFScalarQuantizer, - &_swigt__p_p_faiss__IndexLSH, - &_swigt__p_p_faiss__IndexPQ, - &_swigt__p_p_faiss__IndexPreTransform, - &_swigt__p_p_faiss__IndexRefineFlat, - &_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, - &_swigt__p_p_faiss__IndexScalarQuantizer, - &_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, - &_swigt__p_p_faiss__IndexSplitVectors, - &_swigt__p_p_faiss__InvertedLists, - &_swigt__p_p_faiss__LinearTransform, - &_swigt__p_p_faiss__MultiIndexQuantizer, - &_swigt__p_p_faiss__MultiIndexQuantizer2, - &_swigt__p_p_faiss__NormalizationTransform, - &_swigt__p_p_faiss__OPQMatrix, - &_swigt__p_p_faiss__OnDiskInvertedLists, - &_swigt__p_p_faiss__PCAMatrix, - &_swigt__p_p_faiss__RandomRotationMatrix, - &_swigt__p_p_faiss__RemapDimensionsTransform, - &_swigt__p_p_faiss__VectorTransform, - &_swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t, - &_swigt__p_std__functionT_void_ffaiss__Index_pF_t, - &_swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, - &_swigt__p_std__mt19937, - &_swigt__p_std__pairT_float_int_t, - &_swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, - &_swigt__p_std__priority_queueT_std__pairT_float_int_t_t, - &_swigt__p_std__unordered_mapT_long_long_t, - &_swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, - &_swigt__p_std__unordered_multimapT_long_long_t, - &_swigt__p_std__vectorT_char_t, - &_swigt__p_std__vectorT_double_t, - &_swigt__p_std__vectorT_faiss__BufferList__Buffer_t, - &_swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, - &_swigt__p_std__vectorT_faiss__IndexBinary_p_t, - &_swigt__p_std__vectorT_faiss__Index_p_t, - &_swigt__p_std__vectorT_faiss__InvertedLists_const_p_t, - &_swigt__p_std__vectorT_faiss__InvertedLists_p_t, - &_swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, - &_swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, - &_swigt__p_std__vectorT_faiss__OperatingPoint_t, - &_swigt__p_std__vectorT_faiss__ParameterRange_t, - &_swigt__p_std__vectorT_faiss__RangeQueryResult_t, - &_swigt__p_std__vectorT_faiss__VectorTransform_p_t, - &_swigt__p_std__vectorT_float_t, - &_swigt__p_std__vectorT_int_t, - &_swigt__p_std__vectorT_long_t, - &_swigt__p_std__vectorT_omp_lock_t_t, - &_swigt__p_std__vectorT_std__vectorT_float_t_t, - &_swigt__p_std__vectorT_std__vectorT_long_t_t, - &_swigt__p_std__vectorT_std__vectorT_uint8_t_t_t, - &_swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t, - &_swigt__p_std__vectorT_unsigned_char_t, - &_swigt__p_std__vectorT_unsigned_long_t, - &_swigt__p_storage_idx_t, - &_swigt__p_uint32_t, - &_swigt__p_unsigned_char, - &_swigt__p_unsigned_long, - &_swigt__p_void, -}; - -static swig_cast_info _swigc__p_Crev[] = { {&_swigt__p_Crev, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_MapLong2Long[] = { {&_swigt__p_MapLong2Long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Node[] = { {&_swigt__p_Node, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_T[] = { {&_swigt__p_T, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_TI[] = { {&_swigt__p_TI, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_component_t[] = { {&_swigt__p_component_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_distance_t[] = { {&_swigt__p_distance_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ArrayInvertedLists[] = { {&_swigt__p_faiss__ArrayInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__AutoTuneCriterion[] = { {&_swigt__p_faiss__AutoTuneCriterion, 0, 0, 0}, {&_swigt__p_faiss__OneRecallAtRCriterion, _p_faiss__OneRecallAtRCriterionTo_p_faiss__AutoTuneCriterion, 0, 0}, {&_swigt__p_faiss__IntersectionCriterion, _p_faiss__IntersectionCriterionTo_p_faiss__AutoTuneCriterion, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__BinaryInvertedListScanner[] = { {&_swigt__p_faiss__BinaryInvertedListScanner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__BufferList[] = { {&_swigt__p_faiss__RangeSearchPartialResult, _p_faiss__RangeSearchPartialResultTo_p_faiss__BufferList, 0, 0}, {&_swigt__p_faiss__BufferList, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__CenteringTransform[] = { {&_swigt__p_faiss__CenteringTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Cloner[] = { {&_swigt__p_faiss__Cloner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Clustering[] = { {&_swigt__p_faiss__Clustering, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ClusteringParameters[] = { {&_swigt__p_faiss__Clustering, _p_faiss__ClusteringTo_p_faiss__ClusteringParameters, 0, 0}, {&_swigt__p_faiss__ClusteringParameters, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ConcatenatedInvertedLists[] = { {&_swigt__p_faiss__ConcatenatedInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__DistanceComputer[] = { {&_swigt__p_faiss__DistanceComputer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer16[] = { {&_swigt__p_faiss__GenHammingComputer16, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer32[] = { {&_swigt__p_faiss__GenHammingComputer32, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputer8[] = { {&_swigt__p_faiss__GenHammingComputer8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__GenHammingComputerM8[] = { {&_swigt__p_faiss__GenHammingComputerM8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSW[] = { {&_swigt__p_faiss__HNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSWStats[] = { {&_swigt__p_faiss__HNSWStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HNSW__MinimaxHeap[] = { {&_swigt__p_faiss__HNSW__MinimaxHeap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer16[] = { {&_swigt__p_faiss__HammingComputer16, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer20[] = { {&_swigt__p_faiss__HammingComputer20, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer32[] = { {&_swigt__p_faiss__HammingComputer32, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer4[] = { {&_swigt__p_faiss__HammingComputer4, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer64[] = { {&_swigt__p_faiss__HammingComputer64, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputer8[] = { {&_swigt__p_faiss__HammingComputer8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerDefault[] = { {&_swigt__p_faiss__HammingComputerDefault, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerM4[] = { {&_swigt__p_faiss__HammingComputerM4, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HammingComputerM8[] = { {&_swigt__p_faiss__HammingComputerM8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t[] = { {&_swigt__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelector[] = { {&_swigt__p_faiss__IDSelector, 0, 0, 0}, {&_swigt__p_faiss__IDSelectorBatch, _p_faiss__IDSelectorBatchTo_p_faiss__IDSelector, 0, 0}, {&_swigt__p_faiss__IDSelectorRange, _p_faiss__IDSelectorRangeTo_p_faiss__IDSelector, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelectorBatch[] = { {&_swigt__p_faiss__IDSelectorBatch, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IDSelectorRange[] = { {&_swigt__p_faiss__IDSelectorRange, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IOReader[] = { {&_swigt__p_faiss__IOReader, 0, 0, 0}, {&_swigt__p_faiss__VectorIOReader, _p_faiss__VectorIOReaderTo_p_faiss__IOReader, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IOWriter[] = { {&_swigt__p_faiss__IOWriter, 0, 0, 0}, {&_swigt__p_faiss__VectorIOWriter, _p_faiss__VectorIOWriterTo_p_faiss__IOWriter, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IVFPQSearchParameters[] = { {&_swigt__p_faiss__IVFPQSearchParameters, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IVFSearchParameters[] = { {&_swigt__p_faiss__IVFSearchParameters, 0, 0, 0}, {&_swigt__p_faiss__IVFPQSearchParameters, _p_faiss__IVFPQSearchParametersTo_p_faiss__IVFSearchParameters, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Index[] = { {&_swigt__p_faiss__IndexPreTransform, _p_faiss__IndexPreTransformTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVF, _p_faiss__IndexIVFTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatL2, _p_faiss__IndexFlatL2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWFlat, _p_faiss__IndexHNSWFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__Index2Layer, _p_faiss__Index2LayerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWPQ, _p_faiss__IndexHNSWPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSW, _p_faiss__IndexHNSWTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatIP, _p_faiss__IndexFlatIPTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, _p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, _p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexLSH, _p_faiss__IndexLSHTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlat, _p_faiss__IndexFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSW2Level, _p_faiss__IndexHNSW2LevelTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIDMap2, _p_faiss__IndexIDMap2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexSplitVectors, _p_faiss__IndexSplitVectorsTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__Index, 0, 0, 0}, {&_swigt__p_faiss__IndexRefineFlat, _p_faiss__IndexRefineFlatTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexHNSWSQ, _p_faiss__IndexHNSWSQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer2, _p_faiss__MultiIndexQuantizer2To_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexPQ, _p_faiss__IndexPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIDMap, _p_faiss__IndexIDMapTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__IndexScalarQuantizer, _p_faiss__IndexScalarQuantizerTo_p_faiss__Index, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer, _p_faiss__MultiIndexQuantizerTo_p_faiss__Index, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Index2Layer[] = { {&_swigt__p_faiss__Index2Layer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinary[] = { {&_swigt__p_faiss__IndexBinaryFlat, _p_faiss__IndexBinaryFlatTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinary, 0, 0, 0}, {&_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, _p_faiss__IndexShardsTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, _p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_tTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryHNSW, _p_faiss__IndexBinaryHNSWTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryIVF, _p_faiss__IndexBinaryIVFTo_p_faiss__IndexBinary, 0, 0}, {&_swigt__p_faiss__IndexBinaryFromFloat, _p_faiss__IndexBinaryFromFloatTo_p_faiss__IndexBinary, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryFlat[] = { {&_swigt__p_faiss__IndexBinaryFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryFromFloat[] = { {&_swigt__p_faiss__IndexBinaryFromFloat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryHNSW[] = { {&_swigt__p_faiss__IndexBinaryHNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexBinaryIVF[] = { {&_swigt__p_faiss__IndexBinaryIVF, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlat[] = { {&_swigt__p_faiss__IndexFlat, 0, 0, 0}, {&_swigt__p_faiss__IndexFlatL2, _p_faiss__IndexFlatL2To_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlat, 0, 0}, {&_swigt__p_faiss__IndexFlatIP, _p_faiss__IndexFlatIPTo_p_faiss__IndexFlat, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlat1D[] = { {&_swigt__p_faiss__IndexFlat1D, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatIP[] = { {&_swigt__p_faiss__IndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatL2[] = { {&_swigt__p_faiss__IndexFlatL2, 0, 0, 0}, {&_swigt__p_faiss__IndexFlat1D, _p_faiss__IndexFlat1DTo_p_faiss__IndexFlatL2, 0, 0}, {&_swigt__p_faiss__IndexFlatL2BaseShift, _p_faiss__IndexFlatL2BaseShiftTo_p_faiss__IndexFlatL2, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexFlatL2BaseShift[] = { {&_swigt__p_faiss__IndexFlatL2BaseShift, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSW[] = { {&_swigt__p_faiss__IndexHNSWFlat, _p_faiss__IndexHNSWFlatTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSW, 0, 0, 0}, {&_swigt__p_faiss__IndexHNSWSQ, _p_faiss__IndexHNSWSQTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSWPQ, _p_faiss__IndexHNSWPQTo_p_faiss__IndexHNSW, 0, 0}, {&_swigt__p_faiss__IndexHNSW2Level, _p_faiss__IndexHNSW2LevelTo_p_faiss__IndexHNSW, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSW2Level[] = { {&_swigt__p_faiss__IndexHNSW2Level, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWFlat[] = { {&_swigt__p_faiss__IndexHNSWFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWPQ[] = { {&_swigt__p_faiss__IndexHNSWPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexHNSWSQ[] = { {&_swigt__p_faiss__IndexHNSWSQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIDMap[] = { {&_swigt__p_faiss__IndexIDMap2, _p_faiss__IndexIDMap2To_p_faiss__IndexIDMap, 0, 0}, {&_swigt__p_faiss__IndexIDMap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIDMap2[] = { {&_swigt__p_faiss__IndexIDMap2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVF[] = { {&_swigt__p_faiss__IndexIVF, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVF, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__IndexIVF, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFFlat[] = { {&_swigt__p_faiss__IndexIVFFlat, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__IndexIVFFlat, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFFlatDedup[] = { {&_swigt__p_faiss__IndexIVFFlatDedup, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQ[] = { {&_swigt__p_faiss__IndexIVFPQ, 0, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__IndexIVFPQ, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQR[] = { {&_swigt__p_faiss__IndexIVFPQR, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFPQStats[] = { {&_swigt__p_faiss__IndexIVFPQStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFScalarQuantizer[] = { {&_swigt__p_faiss__IndexIVFScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexIVFStats[] = { {&_swigt__p_faiss__IndexIVFStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexLSH[] = { {&_swigt__p_faiss__IndexLSH, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPQ[] = { {&_swigt__p_faiss__IndexPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPQStats[] = { {&_swigt__p_faiss__IndexPQStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexPreTransform[] = { {&_swigt__p_faiss__IndexPreTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexRefineFlat[] = { {&_swigt__p_faiss__IndexRefineFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t[] = { {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexReplicasTemplateT_faiss__Index_t[] = { {&_swigt__p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexScalarQuantizer[] = { {&_swigt__p_faiss__IndexScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t[] = { {&_swigt__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexShardsTemplateT_faiss__Index_t[] = { {&_swigt__p_faiss__IndexShardsTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IndexSplitVectors[] = { {&_swigt__p_faiss__IndexSplitVectors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InterruptCallback[] = { {&_swigt__p_faiss__InterruptCallback, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__IntersectionCriterion[] = { {&_swigt__p_faiss__IntersectionCriterion, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InvertedListScanner[] = { {&_swigt__p_faiss__InvertedListScanner, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__InvertedLists[] = { {&_swigt__p_faiss__InvertedLists, 0, 0, 0}, {&_swigt__p_faiss__ArrayInvertedLists, _p_faiss__ArrayInvertedListsTo_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_faiss__ConcatenatedInvertedLists, _p_faiss__ConcatenatedInvertedListsTo_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_faiss__OnDiskInvertedLists, _p_faiss__OnDiskInvertedListsTo_p_faiss__InvertedLists, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__Level1Quantizer[] = { {&_swigt__p_faiss__Level1Quantizer, 0, 0, 0}, {&_swigt__p_faiss__IndexIVF, _p_faiss__IndexIVFTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFScalarQuantizer, _p_faiss__IndexIVFScalarQuantizerTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFPQ, _p_faiss__IndexIVFPQTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFFlat, _p_faiss__IndexIVFFlatTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFFlatDedup, _p_faiss__IndexIVFFlatDedupTo_p_faiss__Level1Quantizer, 0, 0}, {&_swigt__p_faiss__IndexIVFPQR, _p_faiss__IndexIVFPQRTo_p_faiss__Level1Quantizer, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__LinearTransform[] = { {&_swigt__p_faiss__RandomRotationMatrix, _p_faiss__RandomRotationMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__PCAMatrix, _p_faiss__PCAMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__OPQMatrix, _p_faiss__OPQMatrixTo_p_faiss__LinearTransform, 0, 0}, {&_swigt__p_faiss__LinearTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__LockLevels[] = { {&_swigt__p_faiss__LockLevels, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MatrixStats[] = { {&_swigt__p_faiss__MatrixStats, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MultiIndexQuantizer[] = { {&_swigt__p_faiss__MultiIndexQuantizer, 0, 0, 0}, {&_swigt__p_faiss__MultiIndexQuantizer2, _p_faiss__MultiIndexQuantizer2To_p_faiss__MultiIndexQuantizer, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__MultiIndexQuantizer2[] = { {&_swigt__p_faiss__MultiIndexQuantizer2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__NormalizationTransform[] = { {&_swigt__p_faiss__NormalizationTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OPQMatrix[] = { {&_swigt__p_faiss__OPQMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OnDiskInvertedLists[] = { {&_swigt__p_faiss__OnDiskInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OnDiskInvertedLists__OngoingPrefetch[] = { {&_swigt__p_faiss__OnDiskInvertedLists__OngoingPrefetch, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OneRecallAtRCriterion[] = { {&_swigt__p_faiss__OneRecallAtRCriterion, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OperatingPoint[] = { {&_swigt__p_faiss__OperatingPoint, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__OperatingPoints[] = { {&_swigt__p_faiss__OperatingPoints, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PCAMatrix[] = { {&_swigt__p_faiss__PCAMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ParameterRange[] = { {&_swigt__p_faiss__ParameterRange, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ParameterSpace[] = { {&_swigt__p_faiss__ParameterSpace, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PermutationObjective[] = { {&_swigt__p_faiss__PermutationObjective, 0, 0, 0}, {&_swigt__p_faiss__ReproduceDistancesObjective, _p_faiss__ReproduceDistancesObjectiveTo_p_faiss__PermutationObjective, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__PolysemousTraining[] = { {&_swigt__p_faiss__PolysemousTraining, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ProductQuantizer[] = { {&_swigt__p_faiss__ProductQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RandomGenerator[] = { {&_swigt__p_faiss__RandomGenerator, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RandomRotationMatrix[] = { {&_swigt__p_faiss__RandomRotationMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeQueryResult[] = { {&_swigt__p_faiss__RangeQueryResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeSearchPartialResult[] = { {&_swigt__p_faiss__RangeSearchPartialResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RangeSearchResult[] = { {&_swigt__p_faiss__RangeSearchResult, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ReconstructFromNeighbors[] = { {&_swigt__p_faiss__ReconstructFromNeighbors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__RemapDimensionsTransform[] = { {&_swigt__p_faiss__RemapDimensionsTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ReproduceDistancesObjective[] = { {&_swigt__p_faiss__ReproduceDistancesObjective, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SQDistanceComputer[] = { {&_swigt__p_faiss__SQDistanceComputer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ScalarQuantizer[] = { {&_swigt__p_faiss__ScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SimulatedAnnealingOptimizer[] = { {&_swigt__p_faiss__SimulatedAnnealingOptimizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__SimulatedAnnealingParameters[] = { {&_swigt__p_faiss__SimulatedAnnealingParameters, 0, 0, 0}, {&_swigt__p_faiss__PolysemousTraining, _p_faiss__PolysemousTrainingTo_p_faiss__SimulatedAnnealingParameters, 0, 0}, {&_swigt__p_faiss__SimulatedAnnealingOptimizer, _p_faiss__SimulatedAnnealingOptimizerTo_p_faiss__SimulatedAnnealingParameters, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorIOReader[] = { {&_swigt__p_faiss__VectorIOReader, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorIOWriter[] = { {&_swigt__p_faiss__VectorIOWriter, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VectorTransform[] = { {&_swigt__p_faiss__RandomRotationMatrix, _p_faiss__RandomRotationMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__PCAMatrix, _p_faiss__PCAMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__OPQMatrix, _p_faiss__OPQMatrixTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__VectorTransform, 0, 0, 0}, {&_swigt__p_faiss__LinearTransform, _p_faiss__LinearTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__RemapDimensionsTransform, _p_faiss__RemapDimensionsTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__NormalizationTransform, _p_faiss__NormalizationTransformTo_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_faiss__CenteringTransform, _p_faiss__CenteringTransformTo_p_faiss__VectorTransform, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__VisitedTable[] = { {&_swigt__p_faiss__VisitedTable, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_faiss__ivflib__SlidingIndexWindow[] = { {&_swigt__p_faiss__ivflib__SlidingIndexWindow, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_idx_t[] = { {&_swigt__p_idx_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_omp_lock_t[] = { {&_swigt__p_omp_lock_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexPreTransform[] = {{&_swigt__p_p_faiss__IndexPreTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVF[] = {{&_swigt__p_p_faiss__IndexIVF, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatL2[] = {{&_swigt__p_p_faiss__IndexFlatL2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWFlat[] = {{&_swigt__p_p_faiss__IndexHNSWFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__Index2Layer[] = {{&_swigt__p_p_faiss__Index2Layer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWPQ[] = {{&_swigt__p_p_faiss__IndexHNSWPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t[] = {{&_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexShardsTemplateT_faiss__Index_t[] = {{&_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatIP[] = {{&_swigt__p_p_faiss__IndexFlatIP, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSW[] = {{&_swigt__p_p_faiss__IndexHNSW, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFFlat[] = {{&_swigt__p_p_faiss__IndexIVFFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexLSH[] = {{&_swigt__p_p_faiss__IndexLSH, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFPQR[] = {{&_swigt__p_p_faiss__IndexIVFPQR, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFFlatDedup[] = {{&_swigt__p_p_faiss__IndexIVFFlatDedup, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlat[] = {{&_swigt__p_p_faiss__IndexFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlat1D[] = {{&_swigt__p_p_faiss__IndexFlat1D, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexFlatL2BaseShift[] = {{&_swigt__p_p_faiss__IndexFlatL2BaseShift, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSW2Level[] = {{&_swigt__p_p_faiss__IndexHNSW2Level, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIDMap2[] = {{&_swigt__p_p_faiss__IndexIDMap2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexSplitVectors[] = {{&_swigt__p_p_faiss__IndexSplitVectors, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexRefineFlat[] = {{&_swigt__p_p_faiss__IndexRefineFlat, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexHNSWSQ[] = {{&_swigt__p_p_faiss__IndexHNSWSQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__MultiIndexQuantizer2[] = {{&_swigt__p_p_faiss__MultiIndexQuantizer2, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexPQ[] = {{&_swigt__p_p_faiss__IndexPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIDMap[] = {{&_swigt__p_p_faiss__IndexIDMap, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFPQ[] = {{&_swigt__p_p_faiss__IndexIVFPQ, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexIVFScalarQuantizer[] = {{&_swigt__p_p_faiss__IndexIVFScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__IndexScalarQuantizer[] = {{&_swigt__p_p_faiss__IndexScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__MultiIndexQuantizer[] = {{&_swigt__p_p_faiss__MultiIndexQuantizer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__Index[] = { {&_swigt__p_p_faiss__IndexPreTransform, _p_p_faiss__IndexPreTransformTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVF, _p_p_faiss__IndexIVFTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatL2, _p_p_faiss__IndexFlatL2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWFlat, _p_p_faiss__IndexHNSWFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__Index2Layer, _p_p_faiss__Index2LayerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWPQ, _p_p_faiss__IndexHNSWPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, _p_p_faiss__IndexReplicasTemplateT_faiss__Index_tTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, _p_p_faiss__IndexShardsTemplateT_faiss__Index_tTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatIP, _p_p_faiss__IndexFlatIPTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSW, _p_p_faiss__IndexHNSWTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFFlat, _p_p_faiss__IndexIVFFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexLSH, _p_p_faiss__IndexLSHTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFPQR, _p_p_faiss__IndexIVFPQRTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFFlatDedup, _p_p_faiss__IndexIVFFlatDedupTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlat, _p_p_faiss__IndexFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlat1D, _p_p_faiss__IndexFlat1DTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexFlatL2BaseShift, _p_p_faiss__IndexFlatL2BaseShiftTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSW2Level, _p_p_faiss__IndexHNSW2LevelTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIDMap2, _p_p_faiss__IndexIDMap2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexSplitVectors, _p_p_faiss__IndexSplitVectorsTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__Index, 0, 0, 0}, {&_swigt__p_p_faiss__IndexRefineFlat, _p_p_faiss__IndexRefineFlatTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexHNSWSQ, _p_p_faiss__IndexHNSWSQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__MultiIndexQuantizer2, _p_p_faiss__MultiIndexQuantizer2To_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexPQ, _p_p_faiss__IndexPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIDMap, _p_p_faiss__IndexIDMapTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFPQ, _p_p_faiss__IndexIVFPQTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexIVFScalarQuantizer, _p_p_faiss__IndexIVFScalarQuantizerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__IndexScalarQuantizer, _p_p_faiss__IndexScalarQuantizerTo_p_p_faiss__Index, 0, 0}, {&_swigt__p_p_faiss__MultiIndexQuantizer, _p_p_faiss__MultiIndexQuantizerTo_p_p_faiss__Index, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__ArrayInvertedLists[] = {{&_swigt__p_p_faiss__ArrayInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__ConcatenatedInvertedLists[] = {{&_swigt__p_p_faiss__ConcatenatedInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__OnDiskInvertedLists[] = {{&_swigt__p_p_faiss__OnDiskInvertedLists, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__InvertedLists[] = { {&_swigt__p_p_faiss__InvertedLists, 0, 0, 0}, {&_swigt__p_p_faiss__ArrayInvertedLists, _p_p_faiss__ArrayInvertedListsTo_p_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_p_faiss__ConcatenatedInvertedLists, _p_p_faiss__ConcatenatedInvertedListsTo_p_p_faiss__InvertedLists, 0, 0}, {&_swigt__p_p_faiss__OnDiskInvertedLists, _p_p_faiss__OnDiskInvertedListsTo_p_p_faiss__InvertedLists, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__RandomRotationMatrix[] = {{&_swigt__p_p_faiss__RandomRotationMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__PCAMatrix[] = {{&_swigt__p_p_faiss__PCAMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__OPQMatrix[] = {{&_swigt__p_p_faiss__OPQMatrix, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__LinearTransform[] = {{&_swigt__p_p_faiss__LinearTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__RemapDimensionsTransform[] = {{&_swigt__p_p_faiss__RemapDimensionsTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__NormalizationTransform[] = {{&_swigt__p_p_faiss__NormalizationTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__CenteringTransform[] = {{&_swigt__p_p_faiss__CenteringTransform, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_faiss__VectorTransform[] = { {&_swigt__p_p_faiss__RandomRotationMatrix, _p_p_faiss__RandomRotationMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__PCAMatrix, _p_p_faiss__PCAMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__OPQMatrix, _p_p_faiss__OPQMatrixTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__VectorTransform, 0, 0, 0}, {&_swigt__p_p_faiss__LinearTransform, _p_p_faiss__LinearTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__RemapDimensionsTransform, _p_p_faiss__RemapDimensionsTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__NormalizationTransform, _p_p_faiss__NormalizationTransformTo_p_p_faiss__VectorTransform, 0, 0}, {&_swigt__p_p_faiss__CenteringTransform, _p_p_faiss__CenteringTransformTo_p_p_faiss__VectorTransform, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__functionT_void_ffaiss__IndexBinary_pF_t[] = { {&_swigt__p_std__functionT_void_ffaiss__IndexBinary_pF_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__functionT_void_ffaiss__Index_pF_t[] = { {&_swigt__p_std__functionT_void_ffaiss__Index_pF_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__listT_faiss__OnDiskInvertedLists__Slot_t[] = { {&_swigt__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__mt19937[] = { {&_swigt__p_std__mt19937, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__pairT_float_int_t[] = { {&_swigt__p_std__pairT_float_int_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t[] = { {&_swigt__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__priority_queueT_std__pairT_float_int_t_t[] = { {&_swigt__p_std__priority_queueT_std__pairT_float_int_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_mapT_long_long_t[] = { {&_swigt__p_std__unordered_mapT_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t[] = { {&_swigt__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__unordered_multimapT_long_long_t[] = { {&_swigt__p_std__unordered_multimapT_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_char_t[] = { {&_swigt__p_std__vectorT_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_double_t[] = { {&_swigt__p_std__vectorT_double_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__BufferList__Buffer_t[] = { {&_swigt__p_std__vectorT_faiss__BufferList__Buffer_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__HNSW__NodeDistFarther_t[] = { {&_swigt__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__IndexBinary_p_t[] = { {&_swigt__p_std__vectorT_faiss__IndexBinary_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__Index_p_t[] = { {&_swigt__p_std__vectorT_faiss__Index_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__InvertedLists_const_p_t[] = { {&_swigt__p_std__vectorT_faiss__InvertedLists_const_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__InvertedLists_p_t[] = { {&_swigt__p_std__vectorT_faiss__InvertedLists_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__MatrixStats__PerDimStats_t[] = { {&_swigt__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__OnDiskInvertedLists__List_t[] = { {&_swigt__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__OperatingPoint_t[] = { {&_swigt__p_std__vectorT_faiss__OperatingPoint_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__ParameterRange_t[] = { {&_swigt__p_std__vectorT_faiss__ParameterRange_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__RangeQueryResult_t[] = { {&_swigt__p_std__vectorT_faiss__RangeQueryResult_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_faiss__VectorTransform_p_t[] = { {&_swigt__p_std__vectorT_faiss__VectorTransform_p_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_float_t[] = { {&_swigt__p_std__vectorT_float_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_int_t[] = { {&_swigt__p_std__vectorT_int_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_long_t[] = { {&_swigt__p_std__vectorT_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_omp_lock_t_t[] = { {&_swigt__p_std__vectorT_omp_lock_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_float_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_float_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_long_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_uint8_t_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_uint8_t_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_std__vectorT_unsigned_long_t_t[] = { {&_swigt__p_std__vectorT_std__vectorT_unsigned_long_t_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_unsigned_char_t[] = { {&_swigt__p_std__vectorT_unsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorT_unsigned_long_t[] = { {&_swigt__p_std__vectorT_unsigned_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_storage_idx_t[] = { {&_swigt__p_storage_idx_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_Crev, - _swigc__p_FILE, - _swigc__p_MapLong2Long, - _swigc__p_Node, - _swigc__p_T, - _swigc__p_TI, - _swigc__p_char, - _swigc__p_component_t, - _swigc__p_distance_t, - _swigc__p_double, - _swigc__p_faiss__ArrayInvertedLists, - _swigc__p_faiss__AutoTuneCriterion, - _swigc__p_faiss__BinaryInvertedListScanner, - _swigc__p_faiss__BufferList, - _swigc__p_faiss__CenteringTransform, - _swigc__p_faiss__Cloner, - _swigc__p_faiss__Clustering, - _swigc__p_faiss__ClusteringParameters, - _swigc__p_faiss__ConcatenatedInvertedLists, - _swigc__p_faiss__DistanceComputer, - _swigc__p_faiss__GenHammingComputer16, - _swigc__p_faiss__GenHammingComputer32, - _swigc__p_faiss__GenHammingComputer8, - _swigc__p_faiss__GenHammingComputerM8, - _swigc__p_faiss__HNSW, - _swigc__p_faiss__HNSWStats, - _swigc__p_faiss__HNSW__MinimaxHeap, - _swigc__p_faiss__HammingComputer16, - _swigc__p_faiss__HammingComputer20, - _swigc__p_faiss__HammingComputer32, - _swigc__p_faiss__HammingComputer4, - _swigc__p_faiss__HammingComputer64, - _swigc__p_faiss__HammingComputer8, - _swigc__p_faiss__HammingComputerDefault, - _swigc__p_faiss__HammingComputerM4, - _swigc__p_faiss__HammingComputerM8, - _swigc__p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, - _swigc__p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t, - _swigc__p_faiss__IDSelector, - _swigc__p_faiss__IDSelectorBatch, - _swigc__p_faiss__IDSelectorRange, - _swigc__p_faiss__IOReader, - _swigc__p_faiss__IOWriter, - _swigc__p_faiss__IVFPQSearchParameters, - _swigc__p_faiss__IVFSearchParameters, - _swigc__p_faiss__Index, - _swigc__p_faiss__Index2Layer, - _swigc__p_faiss__IndexBinary, - _swigc__p_faiss__IndexBinaryFlat, - _swigc__p_faiss__IndexBinaryFromFloat, - _swigc__p_faiss__IndexBinaryHNSW, - _swigc__p_faiss__IndexBinaryIVF, - _swigc__p_faiss__IndexFlat, - _swigc__p_faiss__IndexFlat1D, - _swigc__p_faiss__IndexFlatIP, - _swigc__p_faiss__IndexFlatL2, - _swigc__p_faiss__IndexFlatL2BaseShift, - _swigc__p_faiss__IndexHNSW, - _swigc__p_faiss__IndexHNSW2Level, - _swigc__p_faiss__IndexHNSWFlat, - _swigc__p_faiss__IndexHNSWPQ, - _swigc__p_faiss__IndexHNSWSQ, - _swigc__p_faiss__IndexIDMap, - _swigc__p_faiss__IndexIDMap2, - _swigc__p_faiss__IndexIVF, - _swigc__p_faiss__IndexIVFFlat, - _swigc__p_faiss__IndexIVFFlatDedup, - _swigc__p_faiss__IndexIVFPQ, - _swigc__p_faiss__IndexIVFPQR, - _swigc__p_faiss__IndexIVFPQStats, - _swigc__p_faiss__IndexIVFScalarQuantizer, - _swigc__p_faiss__IndexIVFStats, - _swigc__p_faiss__IndexLSH, - _swigc__p_faiss__IndexPQ, - _swigc__p_faiss__IndexPQStats, - _swigc__p_faiss__IndexPreTransform, - _swigc__p_faiss__IndexRefineFlat, - _swigc__p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t, - _swigc__p_faiss__IndexReplicasTemplateT_faiss__Index_t, - _swigc__p_faiss__IndexScalarQuantizer, - _swigc__p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t, - _swigc__p_faiss__IndexShardsTemplateT_faiss__Index_t, - _swigc__p_faiss__IndexSplitVectors, - _swigc__p_faiss__InterruptCallback, - _swigc__p_faiss__IntersectionCriterion, - _swigc__p_faiss__InvertedListScanner, - _swigc__p_faiss__InvertedLists, - _swigc__p_faiss__Level1Quantizer, - _swigc__p_faiss__LinearTransform, - _swigc__p_faiss__LockLevels, - _swigc__p_faiss__MatrixStats, - _swigc__p_faiss__MultiIndexQuantizer, - _swigc__p_faiss__MultiIndexQuantizer2, - _swigc__p_faiss__NormalizationTransform, - _swigc__p_faiss__OPQMatrix, - _swigc__p_faiss__OnDiskInvertedLists, - _swigc__p_faiss__OnDiskInvertedLists__OngoingPrefetch, - _swigc__p_faiss__OneRecallAtRCriterion, - _swigc__p_faiss__OperatingPoint, - _swigc__p_faiss__OperatingPoints, - _swigc__p_faiss__PCAMatrix, - _swigc__p_faiss__ParameterRange, - _swigc__p_faiss__ParameterSpace, - _swigc__p_faiss__PermutationObjective, - _swigc__p_faiss__PolysemousTraining, - _swigc__p_faiss__ProductQuantizer, - _swigc__p_faiss__RandomGenerator, - _swigc__p_faiss__RandomRotationMatrix, - _swigc__p_faiss__RangeQueryResult, - _swigc__p_faiss__RangeSearchPartialResult, - _swigc__p_faiss__RangeSearchResult, - _swigc__p_faiss__ReconstructFromNeighbors, - _swigc__p_faiss__RemapDimensionsTransform, - _swigc__p_faiss__ReproduceDistancesObjective, - _swigc__p_faiss__SQDistanceComputer, - _swigc__p_faiss__ScalarQuantizer, - _swigc__p_faiss__SimulatedAnnealingOptimizer, - _swigc__p_faiss__SimulatedAnnealingParameters, - _swigc__p_faiss__VectorIOReader, - _swigc__p_faiss__VectorIOWriter, - _swigc__p_faiss__VectorTransform, - _swigc__p_faiss__VisitedTable, - _swigc__p_faiss__ivflib__SlidingIndexWindow, - _swigc__p_float, - _swigc__p_idx_t, - _swigc__p_int, - _swigc__p_long, - _swigc__p_omp_lock_t, - _swigc__p_p_faiss__ArrayInvertedLists, - _swigc__p_p_faiss__CenteringTransform, - _swigc__p_p_faiss__ConcatenatedInvertedLists, - _swigc__p_p_faiss__Index, - _swigc__p_p_faiss__Index2Layer, - _swigc__p_p_faiss__IndexFlat, - _swigc__p_p_faiss__IndexFlat1D, - _swigc__p_p_faiss__IndexFlatIP, - _swigc__p_p_faiss__IndexFlatL2, - _swigc__p_p_faiss__IndexFlatL2BaseShift, - _swigc__p_p_faiss__IndexHNSW, - _swigc__p_p_faiss__IndexHNSW2Level, - _swigc__p_p_faiss__IndexHNSWFlat, - _swigc__p_p_faiss__IndexHNSWPQ, - _swigc__p_p_faiss__IndexHNSWSQ, - _swigc__p_p_faiss__IndexIDMap, - _swigc__p_p_faiss__IndexIDMap2, - _swigc__p_p_faiss__IndexIVF, - _swigc__p_p_faiss__IndexIVFFlat, - _swigc__p_p_faiss__IndexIVFFlatDedup, - _swigc__p_p_faiss__IndexIVFPQ, - _swigc__p_p_faiss__IndexIVFPQR, - _swigc__p_p_faiss__IndexIVFScalarQuantizer, - _swigc__p_p_faiss__IndexLSH, - _swigc__p_p_faiss__IndexPQ, - _swigc__p_p_faiss__IndexPreTransform, - _swigc__p_p_faiss__IndexRefineFlat, - _swigc__p_p_faiss__IndexReplicasTemplateT_faiss__Index_t, - _swigc__p_p_faiss__IndexScalarQuantizer, - _swigc__p_p_faiss__IndexShardsTemplateT_faiss__Index_t, - _swigc__p_p_faiss__IndexSplitVectors, - _swigc__p_p_faiss__InvertedLists, - _swigc__p_p_faiss__LinearTransform, - _swigc__p_p_faiss__MultiIndexQuantizer, - _swigc__p_p_faiss__MultiIndexQuantizer2, - _swigc__p_p_faiss__NormalizationTransform, - _swigc__p_p_faiss__OPQMatrix, - _swigc__p_p_faiss__OnDiskInvertedLists, - _swigc__p_p_faiss__PCAMatrix, - _swigc__p_p_faiss__RandomRotationMatrix, - _swigc__p_p_faiss__RemapDimensionsTransform, - _swigc__p_p_faiss__VectorTransform, - _swigc__p_std__functionT_void_ffaiss__IndexBinary_pF_t, - _swigc__p_std__functionT_void_ffaiss__Index_pF_t, - _swigc__p_std__listT_faiss__OnDiskInvertedLists__Slot_t, - _swigc__p_std__mt19937, - _swigc__p_std__pairT_float_int_t, - _swigc__p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t, - _swigc__p_std__priority_queueT_std__pairT_float_int_t_t, - _swigc__p_std__unordered_mapT_long_long_t, - _swigc__p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t, - _swigc__p_std__unordered_multimapT_long_long_t, - _swigc__p_std__vectorT_char_t, - _swigc__p_std__vectorT_double_t, - _swigc__p_std__vectorT_faiss__BufferList__Buffer_t, - _swigc__p_std__vectorT_faiss__HNSW__NodeDistFarther_t, - _swigc__p_std__vectorT_faiss__IndexBinary_p_t, - _swigc__p_std__vectorT_faiss__Index_p_t, - _swigc__p_std__vectorT_faiss__InvertedLists_const_p_t, - _swigc__p_std__vectorT_faiss__InvertedLists_p_t, - _swigc__p_std__vectorT_faiss__MatrixStats__PerDimStats_t, - _swigc__p_std__vectorT_faiss__OnDiskInvertedLists__List_t, - _swigc__p_std__vectorT_faiss__OperatingPoint_t, - _swigc__p_std__vectorT_faiss__ParameterRange_t, - _swigc__p_std__vectorT_faiss__RangeQueryResult_t, - _swigc__p_std__vectorT_faiss__VectorTransform_p_t, - _swigc__p_std__vectorT_float_t, - _swigc__p_std__vectorT_int_t, - _swigc__p_std__vectorT_long_t, - _swigc__p_std__vectorT_omp_lock_t_t, - _swigc__p_std__vectorT_std__vectorT_float_t_t, - _swigc__p_std__vectorT_std__vectorT_long_t_t, - _swigc__p_std__vectorT_std__vectorT_uint8_t_t_t, - _swigc__p_std__vectorT_std__vectorT_unsigned_long_t_t, - _swigc__p_std__vectorT_unsigned_char_t, - _swigc__p_std__vectorT_unsigned_long_t, - _swigc__p_storage_idx_t, - _swigc__p_uint32_t, - _swigc__p_unsigned_char, - _swigc__p_unsigned_long, - _swigc__p_void, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; - } - - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp = { -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(NULL, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"swigvarlink", /* tp_name */ - sizeof(swig_varlinkobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ - (getattrfunc) swig_varlink_getattr, /* tp_getattr */ - (setattrfunc) swig_varlink_setattr, /* tp_setattr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version_tag */ -#endif -#if PY_VERSION_HEX >= 0x03040000 - 0, /* tp_finalize */ -#endif -#ifdef COUNT_ALLOCS - 0, /* tp_allocs */ - 0, /* tp_frees */ - 0, /* tp_maxalloc */ -#if PY_VERSION_HEX >= 0x02050000 - 0, /* tp_prev */ -#endif - 0 /* tp_next */ -#endif - }; - varlink_type = tmp; - type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else - if (PyType_Ready(&varlink_type) < 0) - return NULL; -#endif - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - strncpy(gv->name,name,size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (!c) continue; - c = strstr(c, "swig_ptr: "); - if (c) { - int j; - swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d, *md; -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { -# if PY_VERSION_HEX >= 0x03020000 - PyModuleDef_HEAD_INIT, -# else - { - PyObject_HEAD_INIT(NULL) - NULL, /* m_init */ - 0, /* m_index */ - NULL, /* m_copy */ - }, -# endif - (char *) SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - -#if defined(SWIGPYTHON_BUILTIN) - static SwigPyClientData SwigPyObject_clientdata = { - 0, 0, 0, 0, 0, 0, 0 - }; - static PyGetSetDef this_getset_def = { - (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL - }; - static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own - }; - static PyGetSetDef thisown_getset_def = { - (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure - }; - PyTypeObject *builtin_pytype; - int builtin_base_count; - swig_type_info *builtin_basetype; - PyObject *tuple; - PyGetSetDescrObject *static_getset; - PyTypeObject *metatype; - PyTypeObject *swigpyobject; - SwigPyClientData *cd; - PyObject *public_interface, *public_symbol; - PyObject *this_descr; - PyObject *thisown_descr; - PyObject *self = 0; - int i; - - (void)builtin_pytype; - (void)builtin_base_count; - (void)builtin_basetype; - (void)tuple; - (void)static_getset; - (void)self; - - /* Metaclass is used to implement static member variables */ - metatype = SwigPyObjectType(); - assert(metatype); -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule((char *) SWIG_name, SwigMethods); -#endif - - md = d = PyModule_GetDict(m); - (void)md; - - SWIG_InitializeModule(0); - -#ifdef SWIGPYTHON_BUILTIN - swigpyobject = SwigPyObject_TypeOnce(); - - SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); - assert(SwigPyObject_stype); - cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; - if (!cd) { - SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = swigpyobject; - } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { - PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); -# if PY_VERSION_HEX >= 0x03000000 - return NULL; -# else - return; -# endif - } - - /* All objects have a 'this' attribute */ - this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); - (void)this_descr; - - /* All objects have a 'thisown' attribute */ - thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); - (void)thisown_descr; - - public_interface = PyList_New(0); - public_symbol = 0; - (void)public_symbol; - - PyDict_SetItemString(md, "__all__", public_interface); - Py_DECREF(public_interface); - for (i = 0; SwigMethods[i].ml_name != NULL; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); - for (i = 0; swig_const_table[i].name != 0; ++i) - SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); -#endif - - SWIG_InstallConstants(d,swig_const_table); - - PyDict_SetItemString(md,(char *)"cvar", SWIG_globals()); - SWIG_addvarlink(SWIG_globals(),(char *)"hamming_batch_size",Swig_var_hamming_batch_size_get, Swig_var_hamming_batch_size_set); - SWIG_addvarlink(SWIG_globals(),(char *)"distance_compute_blas_threshold",Swig_var_distance_compute_blas_threshold_get, Swig_var_distance_compute_blas_threshold_set); - SWIG_Python_SetConstant(d, "FAISS_VERSION_MAJOR",SWIG_From_int(static_cast< int >(1))); - SWIG_Python_SetConstant(d, "FAISS_VERSION_MINOR",SWIG_From_int(static_cast< int >(4))); - SWIG_Python_SetConstant(d, "FAISS_VERSION_PATCH",SWIG_From_int(static_cast< int >(0))); - SWIG_Python_SetConstant(d, "METRIC_INNER_PRODUCT",SWIG_From_int(static_cast< int >(faiss::METRIC_INNER_PRODUCT))); - SWIG_Python_SetConstant(d, "METRIC_L2",SWIG_From_int(static_cast< int >(faiss::METRIC_L2))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_default",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_default))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hot_start",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hot_start))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_shared",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_shared))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hypercube",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hypercube))); - SWIG_Python_SetConstant(d, "ProductQuantizer_Train_hypercube_pca",SWIG_From_int(static_cast< int >(faiss::ProductQuantizer::Train_hypercube_pca))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_None",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_None))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_ReproduceDistances_affine",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_ReproduceDistances_affine))); - SWIG_Python_SetConstant(d, "PolysemousTraining_OT_Ranking_weighted_diff",SWIG_From_int(static_cast< int >(faiss::PolysemousTraining::OT_Ranking_weighted_diff))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_PQ",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_PQ))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_HE",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_HE))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_generalized_HE",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_generalized_HE))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_SDC",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_SDC))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_polysemous",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_polysemous))); - SWIG_Python_SetConstant(d, "IndexPQ_ST_polysemous_generalize",SWIG_From_int(static_cast< int >(faiss::IndexPQ::ST_polysemous_generalize))); - SWIG_addvarlink(SWIG_globals(),(char *)"indexPQ_stats",Swig_var_indexPQ_stats_get, Swig_var_indexPQ_stats_set); - SWIG_addvarlink(SWIG_globals(),(char *)"indexIVF_stats",Swig_var_indexIVF_stats_get, Swig_var_indexIVF_stats_set); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_4bit",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_4bit))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit_uniform",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit_uniform))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_4bit_uniform",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_4bit_uniform))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_fp16",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_fp16))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_QT_8bit_direct",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::QT_8bit_direct))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_minmax",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_minmax))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_meanstd",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_meanstd))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_quantiles",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_quantiles))); - SWIG_Python_SetConstant(d, "ScalarQuantizer_RS_optim",SWIG_From_int(static_cast< int >(faiss::ScalarQuantizer::RS_optim))); - SWIG_addvarlink(SWIG_globals(),(char *)"hnsw_stats",Swig_var_hnsw_stats_get, Swig_var_hnsw_stats_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IndexIVFPQ_precomputed_table_max_bytes",Swig_var_IndexIVFPQ_precomputed_table_max_bytes_get, Swig_var_IndexIVFPQ_precomputed_table_max_bytes_set); - SWIG_addvarlink(SWIG_globals(),(char *)"indexIVFPQ_stats",Swig_var_indexIVFPQ_stats_get, Swig_var_indexIVFPQ_stats_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_MMAP",Swig_var_IO_FLAG_MMAP_get, Swig_var_IO_FLAG_MMAP_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_READ_ONLY",Swig_var_IO_FLAG_READ_ONLY_get, Swig_var_IO_FLAG_READ_ONLY_set); - SWIG_addvarlink(SWIG_globals(),(char *)"IO_FLAG_ONDISK_SAME_DIR",Swig_var_IO_FLAG_ONDISK_SAME_DIR_get, Swig_var_IO_FLAG_ONDISK_SAME_DIR_set); - - /* needed, else crash at runtime */ - import_array(); - - faiss::InterruptCallback::instance.reset(new PythonInterruptCallback()); - - -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/tests/Makefile b/tests/Makefile index e7696bbd2..d4198ed1f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -7,21 +7,22 @@ -include ../makefile.inc TESTS_SRC = $(wildcard *.cpp) -TESTS = $(TESTS_SRC:.cpp=.o) +TESTS_OBJ = $(TESTS_SRC:.cpp=.o) + all: run run: tests ./tests -tests: $(TESTS) ../libfaiss.a gtest/make/gtest_main.a +tests: $(TESTS_OBJ) ../libfaiss.a gtest/make/gtest_main.a $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) %.o: %.cpp gtest $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) -c -o $@ $< -Igtest/include -I../.. gtest/make/gtest_main.a: gtest - make -C gtest/make CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" gtest_main.a + $(MAKE) -C gtest/make CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" gtest_main.a gtest: curl -L https://github.com/google/googletest/archive/release-1.8.0.tar.gz | tar xz && \ @@ -29,8 +30,8 @@ gtest: rm -rf googletest-release-1.8.0 clean: - rm -f test_runner - rm -f *.o + rm -f tests + rm -f $(TESTS_OBJ) rm -rf gtest