/* ----------------------------------------------------------------------------
 * 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<typename T> 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<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& 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 <typename T> 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 <Python.h>
# define _DEBUG
#else
# include <Python.h>
#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 (<obj is ok>) {
          if (<need new object>) {
            *ptr = <ptr to new allocated object>;
            return SWIG_NEWOBJ;
          } else {
            *ptr = <ptr to old object>;
            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 <string.h>

#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<int>" == "Class<int >", 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 <name1>|<name2>|...
  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 <name1>|<name2>|...
  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("<Swig Object of type '%s' at %p>", (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("<Swig Packed ", fp); 
  if (SWIG_PackDataName(result, v->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("<Swig Packed at %s%s>", result, v->ty->name);
  } else {
    return SWIG_Python_str_FromFormat("<Swig Packed %s>", 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_cublasHandle_t swig_types[7]
#define SWIGTYPE_p_cudaStream_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__Cloner swig_types[14]
#define SWIGTYPE_p_faiss__Clustering swig_types[15]
#define SWIGTYPE_p_faiss__ClusteringParameters swig_types[16]
#define SWIGTYPE_p_faiss__ConcatenatedInvertedLists swig_types[17]
#define SWIGTYPE_p_faiss__GenHammingComputer16 swig_types[18]
#define SWIGTYPE_p_faiss__GenHammingComputer32 swig_types[19]
#define SWIGTYPE_p_faiss__GenHammingComputer8 swig_types[20]
#define SWIGTYPE_p_faiss__GenHammingComputerM8 swig_types[21]
#define SWIGTYPE_p_faiss__HNSW swig_types[22]
#define SWIGTYPE_p_faiss__HNSWStats swig_types[23]
#define SWIGTYPE_p_faiss__HNSW__DistanceComputer swig_types[24]
#define SWIGTYPE_p_faiss__HNSW__MinimaxHeap swig_types[25]
#define SWIGTYPE_p_faiss__HammingComputer16 swig_types[26]
#define SWIGTYPE_p_faiss__HammingComputer20 swig_types[27]
#define SWIGTYPE_p_faiss__HammingComputer32 swig_types[28]
#define SWIGTYPE_p_faiss__HammingComputer4 swig_types[29]
#define SWIGTYPE_p_faiss__HammingComputer64 swig_types[30]
#define SWIGTYPE_p_faiss__HammingComputer8 swig_types[31]
#define SWIGTYPE_p_faiss__HammingComputerDefault swig_types[32]
#define SWIGTYPE_p_faiss__HammingComputerM4 swig_types[33]
#define SWIGTYPE_p_faiss__HammingComputerM8 swig_types[34]
#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t swig_types[35]
#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t swig_types[36]
#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t swig_types[37]
#define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t swig_types[38]
#define SWIGTYPE_p_faiss__IDSelector swig_types[39]
#define SWIGTYPE_p_faiss__IDSelectorBatch swig_types[40]
#define SWIGTYPE_p_faiss__IDSelectorRange swig_types[41]
#define SWIGTYPE_p_faiss__IOReader swig_types[42]
#define SWIGTYPE_p_faiss__IOWriter swig_types[43]
#define SWIGTYPE_p_faiss__IVFPQSearchParameters swig_types[44]
#define SWIGTYPE_p_faiss__IVFSearchParameters swig_types[45]
#define SWIGTYPE_p_faiss__Index swig_types[46]
#define SWIGTYPE_p_faiss__Index2Layer swig_types[47]
#define SWIGTYPE_p_faiss__IndexBinary swig_types[48]
#define SWIGTYPE_p_faiss__IndexBinaryFlat swig_types[49]
#define SWIGTYPE_p_faiss__IndexBinaryFromFloat swig_types[50]
#define SWIGTYPE_p_faiss__IndexBinaryHNSW swig_types[51]
#define SWIGTYPE_p_faiss__IndexBinaryIVF swig_types[52]
#define SWIGTYPE_p_faiss__IndexFlat swig_types[53]
#define SWIGTYPE_p_faiss__IndexFlat1D swig_types[54]
#define SWIGTYPE_p_faiss__IndexFlatIP swig_types[55]
#define SWIGTYPE_p_faiss__IndexFlatL2 swig_types[56]
#define SWIGTYPE_p_faiss__IndexFlatL2BaseShift swig_types[57]
#define SWIGTYPE_p_faiss__IndexHNSW swig_types[58]
#define SWIGTYPE_p_faiss__IndexHNSW2Level swig_types[59]
#define SWIGTYPE_p_faiss__IndexHNSWFlat swig_types[60]
#define SWIGTYPE_p_faiss__IndexHNSWPQ swig_types[61]
#define SWIGTYPE_p_faiss__IndexHNSWSQ swig_types[62]
#define SWIGTYPE_p_faiss__IndexIDMap swig_types[63]
#define SWIGTYPE_p_faiss__IndexIDMap2 swig_types[64]
#define SWIGTYPE_p_faiss__IndexIVF swig_types[65]
#define SWIGTYPE_p_faiss__IndexIVFFlat swig_types[66]
#define SWIGTYPE_p_faiss__IndexIVFFlatDedup swig_types[67]
#define SWIGTYPE_p_faiss__IndexIVFPQ swig_types[68]
#define SWIGTYPE_p_faiss__IndexIVFPQR swig_types[69]
#define SWIGTYPE_p_faiss__IndexIVFPQStats swig_types[70]
#define SWIGTYPE_p_faiss__IndexIVFScalarQuantizer swig_types[71]
#define SWIGTYPE_p_faiss__IndexIVFStats swig_types[72]
#define SWIGTYPE_p_faiss__IndexLSH swig_types[73]
#define SWIGTYPE_p_faiss__IndexPQ swig_types[74]
#define SWIGTYPE_p_faiss__IndexPQStats swig_types[75]
#define SWIGTYPE_p_faiss__IndexPreTransform swig_types[76]
#define SWIGTYPE_p_faiss__IndexRefineFlat swig_types[77]
#define SWIGTYPE_p_faiss__IndexScalarQuantizer swig_types[78]
#define SWIGTYPE_p_faiss__IndexShards swig_types[79]
#define SWIGTYPE_p_faiss__IndexSplitVectors swig_types[80]
#define SWIGTYPE_p_faiss__IntersectionCriterion swig_types[81]
#define SWIGTYPE_p_faiss__InvertedListScanner swig_types[82]
#define SWIGTYPE_p_faiss__InvertedLists swig_types[83]
#define SWIGTYPE_p_faiss__Level1Quantizer swig_types[84]
#define SWIGTYPE_p_faiss__LinearTransform swig_types[85]
#define SWIGTYPE_p_faiss__LockLevels swig_types[86]
#define SWIGTYPE_p_faiss__MultiIndexQuantizer swig_types[87]
#define SWIGTYPE_p_faiss__MultiIndexQuantizer2 swig_types[88]
#define SWIGTYPE_p_faiss__NormalizationTransform swig_types[89]
#define SWIGTYPE_p_faiss__OPQMatrix swig_types[90]
#define SWIGTYPE_p_faiss__OnDiskInvertedLists swig_types[91]
#define SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch swig_types[92]
#define SWIGTYPE_p_faiss__OneRecallAtRCriterion swig_types[93]
#define SWIGTYPE_p_faiss__OperatingPoint swig_types[94]
#define SWIGTYPE_p_faiss__OperatingPoints swig_types[95]
#define SWIGTYPE_p_faiss__PCAMatrix swig_types[96]
#define SWIGTYPE_p_faiss__ParameterRange swig_types[97]
#define SWIGTYPE_p_faiss__ParameterSpace swig_types[98]
#define SWIGTYPE_p_faiss__PermutationObjective swig_types[99]
#define SWIGTYPE_p_faiss__PolysemousTraining swig_types[100]
#define SWIGTYPE_p_faiss__ProductQuantizer swig_types[101]
#define SWIGTYPE_p_faiss__RandomGenerator swig_types[102]
#define SWIGTYPE_p_faiss__RandomRotationMatrix swig_types[103]
#define SWIGTYPE_p_faiss__RangeSearchPartialResult swig_types[104]
#define SWIGTYPE_p_faiss__RangeSearchPartialResult__QueryResult swig_types[105]
#define SWIGTYPE_p_faiss__RangeSearchResult swig_types[106]
#define SWIGTYPE_p_faiss__ReconstructFromNeighbors swig_types[107]
#define SWIGTYPE_p_faiss__RemapDimensionsTransform swig_types[108]
#define SWIGTYPE_p_faiss__ReproduceDistancesObjective swig_types[109]
#define SWIGTYPE_p_faiss__ScalarQuantizer swig_types[110]
#define SWIGTYPE_p_faiss__ScalarQuantizer__DistanceComputer swig_types[111]
#define SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer swig_types[112]
#define SWIGTYPE_p_faiss__SimulatedAnnealingParameters swig_types[113]
#define SWIGTYPE_p_faiss__VectorIOReader swig_types[114]
#define SWIGTYPE_p_faiss__VectorIOWriter swig_types[115]
#define SWIGTYPE_p_faiss__VectorTransform swig_types[116]
#define SWIGTYPE_p_faiss__VisitedTable swig_types[117]
#define SWIGTYPE_p_faiss__gpu__FlatIndex swig_types[118]
#define SWIGTYPE_p_faiss__gpu__GpuClonerOptions swig_types[119]
#define SWIGTYPE_p_faiss__gpu__GpuIndex swig_types[120]
#define SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat swig_types[121]
#define SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlatConfig swig_types[122]
#define SWIGTYPE_p_faiss__gpu__GpuIndexConfig swig_types[123]
#define SWIGTYPE_p_faiss__gpu__GpuIndexFlat swig_types[124]
#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatConfig swig_types[125]
#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatIP swig_types[126]
#define SWIGTYPE_p_faiss__gpu__GpuIndexFlatL2 swig_types[127]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVF swig_types[128]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFConfig swig_types[129]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat swig_types[130]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlatConfig swig_types[131]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ swig_types[132]
#define SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQConfig swig_types[133]
#define SWIGTYPE_p_faiss__gpu__GpuMultipleClonerOptions swig_types[134]
#define SWIGTYPE_p_faiss__gpu__GpuParameterSpace swig_types[135]
#define SWIGTYPE_p_faiss__gpu__GpuResources swig_types[136]
#define SWIGTYPE_p_faiss__gpu__IndexProxy swig_types[137]
#define SWIGTYPE_p_faiss__gpu__StandardGpuResources swig_types[138]
#define SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow swig_types[139]
#define SWIGTYPE_p_float swig_types[140]
#define SWIGTYPE_p_idx_t swig_types[141]
#define SWIGTYPE_p_int swig_types[142]
#define SWIGTYPE_p_long swig_types[143]
#define SWIGTYPE_p_omp_lock_t swig_types[144]
#define SWIGTYPE_p_p_faiss__ArrayInvertedLists swig_types[145]
#define SWIGTYPE_p_p_faiss__ConcatenatedInvertedLists swig_types[146]
#define SWIGTYPE_p_p_faiss__Index swig_types[147]
#define SWIGTYPE_p_p_faiss__Index2Layer swig_types[148]
#define SWIGTYPE_p_p_faiss__IndexFlat swig_types[149]
#define SWIGTYPE_p_p_faiss__IndexFlat1D swig_types[150]
#define SWIGTYPE_p_p_faiss__IndexFlatIP swig_types[151]
#define SWIGTYPE_p_p_faiss__IndexFlatL2 swig_types[152]
#define SWIGTYPE_p_p_faiss__IndexFlatL2BaseShift swig_types[153]
#define SWIGTYPE_p_p_faiss__IndexHNSW swig_types[154]
#define SWIGTYPE_p_p_faiss__IndexHNSW2Level swig_types[155]
#define SWIGTYPE_p_p_faiss__IndexHNSWFlat swig_types[156]
#define SWIGTYPE_p_p_faiss__IndexHNSWPQ swig_types[157]
#define SWIGTYPE_p_p_faiss__IndexHNSWSQ swig_types[158]
#define SWIGTYPE_p_p_faiss__IndexIDMap swig_types[159]
#define SWIGTYPE_p_p_faiss__IndexIDMap2 swig_types[160]
#define SWIGTYPE_p_p_faiss__IndexIVF swig_types[161]
#define SWIGTYPE_p_p_faiss__IndexIVFFlat swig_types[162]
#define SWIGTYPE_p_p_faiss__IndexIVFFlatDedup swig_types[163]
#define SWIGTYPE_p_p_faiss__IndexIVFPQ swig_types[164]
#define SWIGTYPE_p_p_faiss__IndexIVFPQR swig_types[165]
#define SWIGTYPE_p_p_faiss__IndexIVFScalarQuantizer swig_types[166]
#define SWIGTYPE_p_p_faiss__IndexLSH swig_types[167]
#define SWIGTYPE_p_p_faiss__IndexPQ swig_types[168]
#define SWIGTYPE_p_p_faiss__IndexPreTransform swig_types[169]
#define SWIGTYPE_p_p_faiss__IndexRefineFlat swig_types[170]
#define SWIGTYPE_p_p_faiss__IndexScalarQuantizer swig_types[171]
#define SWIGTYPE_p_p_faiss__IndexShards swig_types[172]
#define SWIGTYPE_p_p_faiss__IndexSplitVectors swig_types[173]
#define SWIGTYPE_p_p_faiss__InvertedLists swig_types[174]
#define SWIGTYPE_p_p_faiss__LinearTransform swig_types[175]
#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer swig_types[176]
#define SWIGTYPE_p_p_faiss__MultiIndexQuantizer2 swig_types[177]
#define SWIGTYPE_p_p_faiss__NormalizationTransform swig_types[178]
#define SWIGTYPE_p_p_faiss__OPQMatrix swig_types[179]
#define SWIGTYPE_p_p_faiss__OnDiskInvertedLists swig_types[180]
#define SWIGTYPE_p_p_faiss__PCAMatrix swig_types[181]
#define SWIGTYPE_p_p_faiss__RandomRotationMatrix swig_types[182]
#define SWIGTYPE_p_p_faiss__RemapDimensionsTransform swig_types[183]
#define SWIGTYPE_p_p_faiss__VectorTransform swig_types[184]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndex swig_types[185]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlat swig_types[186]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlatIP swig_types[187]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexFlatL2 swig_types[188]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVF swig_types[189]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVFFlat swig_types[190]
#define SWIGTYPE_p_p_faiss__gpu__GpuIndexIVFPQ swig_types[191]
#define SWIGTYPE_p_p_faiss__gpu__GpuResources swig_types[192]
#define SWIGTYPE_p_p_faiss__gpu__IndexProxy swig_types[193]
#define SWIGTYPE_p_p_faiss__gpu__StandardGpuResources swig_types[194]
#define SWIGTYPE_p_p_void swig_types[195]
#define SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t swig_types[196]
#define SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t swig_types[197]
#define SWIGTYPE_p_std__mt19937 swig_types[198]
#define SWIGTYPE_p_std__pairT_float_int_t swig_types[199]
#define SWIGTYPE_p_std__pairT_void_p_unsigned_long_t swig_types[200]
#define SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t swig_types[201]
#define SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t swig_types[202]
#define SWIGTYPE_p_std__unordered_mapT_long_long_t swig_types[203]
#define SWIGTYPE_p_std__unordered_multimapT_long_long_t swig_types[204]
#define SWIGTYPE_p_std__vectorT_char_t swig_types[205]
#define SWIGTYPE_p_std__vectorT_cudaStream_t_t swig_types[206]
#define SWIGTYPE_p_std__vectorT_double_t swig_types[207]
#define SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t swig_types[208]
#define SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t swig_types[209]
#define SWIGTYPE_p_std__vectorT_faiss__Index_p_t swig_types[210]
#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t swig_types[211]
#define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t swig_types[212]
#define SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t swig_types[213]
#define SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t swig_types[214]
#define SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t swig_types[215]
#define SWIGTYPE_p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_t swig_types[216]
#define SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t swig_types[217]
#define SWIGTYPE_p_std__vectorT_faiss__gpu__GpuResources_p_t swig_types[218]
#define SWIGTYPE_p_std__vectorT_float_t swig_types[219]
#define SWIGTYPE_p_std__vectorT_int_t swig_types[220]
#define SWIGTYPE_p_std__vectorT_long_t swig_types[221]
#define SWIGTYPE_p_std__vectorT_omp_lock_t_t swig_types[222]
#define SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t swig_types[223]
#define SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t swig_types[224]
#define SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t swig_types[225]
#define SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t swig_types[226]
#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[227]
#define SWIGTYPE_p_std__vectorT_unsigned_long_t swig_types[228]
#define SWIGTYPE_p_storage_idx_t swig_types[229]
#define SWIGTYPE_p_uint32_t swig_types[230]
#define SWIGTYPE_p_unsigned_char swig_types[231]
#define SWIGTYPE_p_unsigned_long swig_types[232]
#define SWIGTYPE_p_void swig_types[233]
static swig_type_info *swig_types[235];
static swig_module_info swig_module = {swig_types, 234, 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 <stdexcept>


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 <stdint.h>
#include <omp.h>


#ifdef SWIGLUA

#include <pthread.h>

extern "C" {

#include <TH/TH.h>
#include <luaT.h>
#undef THTensor

}

#endif


#ifdef SWIGPYTHON

#undef popcount64

#define SWIG_FILE_WITH_INIT
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>

#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 "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 <float.h>


#include <math.h>


/* 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<typename T>
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 <ieeefp.h>
#  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 <limits.h>
#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 <string>



#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/IndexProxy.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;
}




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 <signal.h>
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<long, long> 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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_setTempMemoryFraction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::StandardGpuResources *arg1 = (faiss::gpu::StandardGpuResources *) 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:StandardGpuResources_setTempMemoryFraction",&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_setTempMemoryFraction" "', argument " "1"" of type '" "faiss::gpu::StandardGpuResources *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::StandardGpuResources * >(argp1);
  ecode2 = SWIG_AsVal_float(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StandardGpuResources_setTempMemoryFraction" "', argument " "2"" of type '" "float""'");
  } 
  arg2 = static_cast< float >(val2);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      (arg1)->setTempMemoryFraction(arg2);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_imbalance_factor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexIVF *arg1 = (faiss::IndexIVF *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  double result;
  
  if (!PyArg_ParseTuple(args,(char *)"O:IndexIVF_imbalance_factor",&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_imbalance_factor" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (double)((faiss::IndexIVF const *)arg1)->imbalance_factor();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_IndexIVF_print_stats(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_print_stats",&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_print_stats" "', argument " "1"" of type '" "faiss::IndexIVF const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexIVF * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::IndexIVF const *)arg1)->print_stats();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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::ScalarQuantizer::DistanceComputer *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::ScalarQuantizer::DistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer(arg2);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer__DistanceComputer, 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::ScalarQuantizer::DistanceComputer *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::ScalarQuantizer::DistanceComputer *)((faiss::ScalarQuantizer const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ScalarQuantizer__DistanceComputer, 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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_links_starting_from" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::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);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_add_with_locks" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::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);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::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);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from_candidates" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::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);
      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__HNSW__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__HNSW__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::HNSW::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int,int) const\n"
    "    faiss::HNSW::search_from_candidates(faiss::HNSW::DistanceComputer &,int,faiss::HNSW::idx_t *,float *,faiss::HNSW::MinimaxHeap &,faiss::VisitedTable &,int) const\n");
  return 0;
}


SWIGINTERN PyObject *_wrap_HNSW_search_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::HNSW *arg1 = (faiss::HNSW *) 0 ;
  faiss::HNSW::Node *arg2 = 0 ;
  faiss::HNSW::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",&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" "', 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" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from" "', argument " "2"" of type '" "faiss::HNSW::Node const &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::Node * >(argp2);
  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "HNSW_search_from" "', argument " "3"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search_from" "', argument " "3"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg3 = reinterpret_cast< faiss::HNSW::DistanceComputer * >(argp3);
  ecode4 = SWIG_AsVal_int(obj3, &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "HNSW_search_from" "', 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" "', argument " "5"" of type '" "faiss::VisitedTable *""'"); 
  }
  arg5 = reinterpret_cast< faiss::VisitedTable * >(argp5);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = ((faiss::HNSW const *)arg1)->search_from((faiss::HNSW::Node const &)*arg2,*arg3,arg4,arg5);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_search" "', argument " "2"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg2 = reinterpret_cast< faiss::HNSW::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);
      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);
      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);
      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);
      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);
      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);
      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::HNSW::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__HNSW__DistanceComputer,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HNSW_shrink_neighbor_list" "', argument " "1"" of type '" "faiss::HNSW::DistanceComputer &""'"); 
  }
  arg1 = reinterpret_cast< faiss::HNSW::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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexHNSW const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexHNSWFlat const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexHNSWPQ const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexHNSWSQ const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexHNSW2Level const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexIVFFlat *arg1 = (faiss::IndexIVFFlat *) 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:IndexIVFFlat_range_search",&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_range_search" "', 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_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 '" "IndexIVFFlat_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 '" "IndexIVFFlat_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 '" "IndexIVFFlat_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'"); 
  }
  arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::IndexIVFFlat const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_IndexBinaryIVF_train_q1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ;
  size_t arg2 ;
  uint8_t *arg3 = (uint8_t *) 0 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  PyObject * obj0 = 0 ;
  PyObject * obj1 = 0 ;
  PyObject * obj2 = 0 ;
  PyObject * obj3 = 0 ;
  
  if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexBinaryIVF_train_q1",&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_train_q1" "', 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_train_q1" "', 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 '" "IndexBinaryIVF_train_q1" "', argument " "3"" of type '" "uint8_t const *""'"); 
  }
  arg3 = reinterpret_cast< uint8_t * >(argp3);
  ecode4 = SWIG_AsVal_bool(obj3, &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexBinaryIVF_train_q1" "', argument " "4"" of type '" "bool""'");
  } 
  arg4 = static_cast< bool >(val4);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      (arg1)->train_q1(arg2,(uint8_t const *)arg3,arg4);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_imbalance_factor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexBinaryIVF *arg1 = (faiss::IndexBinaryIVF *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  double result;
  
  if (!PyArg_ParseTuple(args,(char *)"O:IndexBinaryIVF_imbalance_factor",&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_imbalance_factor" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (double)((faiss::IndexBinaryIVF const *)arg1)->imbalance_factor();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_IndexBinaryIVF_print_stats(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_print_stats",&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_print_stats" "', argument " "1"" of type '" "faiss::IndexBinaryIVF const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexBinaryIVF * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::IndexBinaryIVF const *)arg1)->print_stats();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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::HNSW::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::HNSW::DistanceComputer *)((faiss::IndexBinaryHNSW const *)arg1)->get_distance_computer();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HNSW__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);
      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);
      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);
      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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_IndexShards_shard_indexes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_set" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_shard_indexes_get" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_set" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_own_fields_get" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_set" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_threaded_get" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_set" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_successive_ids_get" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::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::IndexShards *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::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_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::IndexShards *)new faiss::IndexShards(arg1,arg2,arg3);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShards, 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::Index::idx_t arg1 ;
  bool arg2 ;
  long val1 ;
  int ecode1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  PyObject * obj0 = 0 ;
  PyObject * obj1 = 0 ;
  faiss::IndexShards *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::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_IndexShards" "', argument " "2"" of type '" "bool""'");
  } 
  arg2 = static_cast< bool >(val2);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (faiss::IndexShards *)new faiss::IndexShards(arg1,arg2);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShards, 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::Index::idx_t arg1 ;
  long val1 ;
  int ecode1 = 0 ;
  PyObject * obj0 = 0 ;
  faiss::IndexShards *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::Index::idx_t""'");
  } 
  arg1 = static_cast< faiss::Index::idx_t >(val1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (faiss::IndexShards *)new faiss::IndexShards(arg1);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexShards, 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::IndexShards::IndexShards(faiss::Index::idx_t,bool,bool)\n"
    "    faiss::IndexShards::IndexShards(faiss::Index::idx_t,bool)\n"
    "    faiss::IndexShards::IndexShards(faiss::Index::idx_t)\n");
  return 0;
}


SWIGINTERN PyObject *_wrap_IndexShards_add_shard(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_shard" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_sync_with_shard_indexes" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      (arg1)->sync_with_shard_indexes();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_at" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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:IndexShards_add",&obj0,&obj1,&obj2)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::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 '" "IndexShards_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);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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:IndexShards_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_add_with_ids" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::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 '" "IndexShards_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 '" "IndexShards_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);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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:IndexShards_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_search" "', argument " "1"" of type '" "faiss::IndexShards const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::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 '" "IndexShards_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 '" "IndexShards_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 '" "IndexShards_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 '" "IndexShards_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); 
  }
  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::IndexShards const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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:IndexShards_train",&obj0,&obj1,&obj2)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_train" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(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::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 '" "IndexShards_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);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexShards_reset" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      (arg1)->reset();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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::IndexShards *arg1 = (faiss::IndexShards *) 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__IndexShards, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexShards" "', argument " "1"" of type '" "faiss::IndexShards *""'"); 
  }
  arg1 = reinterpret_cast< faiss::IndexShards * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      delete arg1;
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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__IndexShards, 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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_allocMemorySpace(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:allocMemorySpace",&obj0,&obj1,&obj2)) SWIG_fail;
  ecode1 = SWIG_AsVal_int(obj0, &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "allocMemorySpace" "', 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 '" "allocMemorySpace" "', 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 '" "allocMemorySpace" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = static_cast< size_t >(val3);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      faiss::gpu::allocMemorySpace(arg1,arg2,arg3);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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);
      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);
      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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_setMinPagingSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::GpuIndexFlat *arg1 = (faiss::gpu::GpuIndexFlat *) 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:GpuIndexFlat_setMinPagingSize",&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_setMinPagingSize" "', argument " "1"" of type '" "faiss::gpu::GpuIndexFlat *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::GpuIndexFlat * >(argp1);
  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexFlat_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);
      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_getMinPagingSize(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_getMinPagingSize",&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_getMinPagingSize" "', 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)->getMinPagingSize();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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_search(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 ;
  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:GpuIndexFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) 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_search" "', 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_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 '" "GpuIndexFlat_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 '" "GpuIndexFlat_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 '" "GpuIndexFlat_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 '" "GpuIndexFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); 
  }
  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::gpu::GpuIndexFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::GpuIndexIVF *arg1 = (faiss::gpu::GpuIndexIVF *) 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:GpuIndexIVF_add",&obj0,&obj1,&obj2)) 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_add" "', argument " "1"" of type '" "faiss::gpu::GpuIndexIVF *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::GpuIndexIVF * >(argp1);
  ecode2 = SWIG_AsVal_long(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GpuIndexIVF_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 '" "GpuIndexIVF_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);
      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_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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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_new_IndexProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *result = 0 ;
  
  if (!PyArg_ParseTuple(args,(char *)":new_IndexProxy")) SWIG_fail;
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (faiss::gpu::IndexProxy *)new faiss::gpu::IndexProxy();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__gpu__IndexProxy, SWIG_POINTER_NEW |  0 );
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_delete_IndexProxy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  
  if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexProxy",&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexProxy" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      delete arg1;
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_addIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_addIndex",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_addIndex" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexProxy_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_removeIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_removeIndex",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_removeIndex" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexProxy_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_runOnIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_runOnIndex",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_runOnIndex" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(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 '" "IndexProxy_runOnIndex" "', argument " "2"" of type '" "std::function< void (faiss::Index *) >""'"); 
    }  
    if (!argp2) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexProxy_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  
  if (!PyArg_ParseTuple(args,(char *)"O:IndexProxy_reset",&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_reset" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      (arg1)->reset();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_train",&obj0,&obj1,&obj2)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_train" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_long(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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 '" "IndexProxy_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_add",&obj0,&obj1,&obj2)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_add" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_long(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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 '" "IndexProxy_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_search" "', argument " "1"" of type '" "faiss::gpu::IndexProxy const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_long(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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 '" "IndexProxy_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 '" "IndexProxy_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 '" "IndexProxy_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 '" "IndexProxy_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'"); 
  }
  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::gpu::IndexProxy const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_reconstruct" "', argument " "1"" of type '" "faiss::gpu::IndexProxy const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_long(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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 '" "IndexProxy_reconstruct" "', argument " "3"" of type '" "float *""'"); 
  }
  arg3 = reinterpret_cast< float * >(argp3);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      ((faiss::gpu::IndexProxy const *)arg1)->reconstruct(arg2,arg3);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_own_fields_set",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_own_fields_set" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_bool(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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_IndexProxy_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  bool result;
  
  if (!PyArg_ParseTuple(args,(char *)"O:IndexProxy_own_fields_get",&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_own_fields_get" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  result = (bool) ((arg1)->own_fields);
  resultobj = SWIG_From_bool(static_cast< bool >(result));
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_IndexProxy_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;
  int result;
  
  if (!PyArg_ParseTuple(args,(char *)"O:IndexProxy_count",&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_count" "', argument " "1"" of type '" "faiss::gpu::IndexProxy const *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (int)((faiss::gpu::IndexProxy const *)arg1)->count();
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_IndexProxy_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  faiss::gpu::IndexProxy *arg1 = (faiss::gpu::IndexProxy *) 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:IndexProxy_at",&obj0,&obj1)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__gpu__IndexProxy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexProxy_at" "', argument " "1"" of type '" "faiss::gpu::IndexProxy *""'"); 
  }
  arg1 = reinterpret_cast< faiss::gpu::IndexProxy * >(argp1);
  ecode2 = SWIG_AsVal_int(obj1, &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexProxy_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);
      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 *IndexProxy_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *obj;
  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__gpu__IndexProxy, SWIG_NewClientData(obj));
  return SWIG_Py_Void();
}

SWIGINTERN PyObject *_wrap_kmeans_clustering_gpu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  int arg1 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t arg4 ;
  float *arg5 = (float *) 0 ;
  float *arg6 = (float *) 0 ;
  bool arg7 ;
  bool arg8 ;
  int val1 ;
  int ecode1 = 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 ;
  bool val7 ;
  int ecode7 = 0 ;
  bool 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 ;
  float result;
  
  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:kmeans_clustering_gpu",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
  ecode1 = SWIG_AsVal_int(obj0, &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "kmeans_clustering_gpu" "', 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 '" "kmeans_clustering_gpu" "', 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_gpu" "', 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 '" "kmeans_clustering_gpu" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = static_cast< size_t >(val4);
  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "kmeans_clustering_gpu" "', 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 '" "kmeans_clustering_gpu" "', argument " "6"" of type '" "float *""'"); 
  }
  arg6 = reinterpret_cast< float * >(argp6);
  ecode7 = SWIG_AsVal_bool(obj6, &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "kmeans_clustering_gpu" "', argument " "7"" of type '" "bool""'");
  } 
  arg7 = static_cast< bool >(val7);
  ecode8 = SWIG_AsVal_bool(obj7, &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "kmeans_clustering_gpu" "', argument " "8"" of type '" "bool""'");
  } 
  arg8 = static_cast< bool >(val8);
  {
    Py_BEGIN_ALLOW_THREADS
    try {
      result = (float)faiss::gpu::kmeans_clustering_gpu(arg1,arg2,arg3,arg4,(float const *)arg5,arg6,arg7,arg8);
    } catch(faiss::FaissException & e) {
      PyEval_RestoreThread(_save);
      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_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);
      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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,0);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RemapDimensionsTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::OPQMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::PCAMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RandomRotationMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::LinearTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::NormalizationTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::VectorTransform *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,0);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,0);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      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);
      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);
      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);
      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);
      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);
      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 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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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);
      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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RemapDimensionsTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::OPQMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::PCAMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RandomRotationMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::LinearTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::NormalizationTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::VectorTransform *> (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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RemapDimensionsTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RemapDimensionsTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::OPQMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__OPQMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::PCAMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__PCAMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::RandomRotationMatrix *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__RandomRotationMatrix,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::LinearTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__LinearTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::NormalizationTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__NormalizationTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::VectorTransform *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,0);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,0);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,0);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryFromFloat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryFromFloat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinaryHNSW *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexBinaryHNSW,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexBinaryFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexBinaryFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexBinary *> (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_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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      PyErr_SetString(PyExc_RuntimeError, e.what());
      SWIG_fail;
    }
    Py_END_ALLOW_THREADS
  }
  {
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIDMap *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIDMap,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexShards *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexShards,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQR *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQR,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlatDedup *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlatDedup,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexIVF *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexIVF,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexScalarQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexScalarQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexLSH *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexLSH,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexPreTransform *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexPreTransform,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::MultiIndexQuantizer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__MultiIndexQuantizer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSWSQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSWSQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::IndexHNSW2Level *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__IndexHNSW2Level,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index2Layer *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__Index2Layer,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::IndexProxy *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__IndexProxy,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFPQ *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFPQ,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexIVFFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexIVFFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    /*@SWIG:swigfaiss.swig,443,DOWNCAST_GPU@*/
    if (dynamic_cast<faiss::gpu::GpuIndexFlat *> (result)) {
      resultobj = SWIG_NewPointerObj(result,SWIGTYPE_p_faiss__gpu__GpuIndexFlat,SWIG_POINTER_OWN);
    } else
    /*@SWIG@*/
    
    // default for non-recognized classes
    /*@SWIG:swigfaiss.swig,437,DOWNCAST@*/
    if (dynamic_cast<faiss::Index *> (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);
      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);
      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_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::RangeSearchPartialResult::QueryResult > *arg2 = (std::vector< faiss::RangeSearchPartialResult::QueryResult > *) 0 ;
  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__RangeSearchPartialResult__QueryResult_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::RangeSearchPartialResult::QueryResult > *""'"); 
  }
  arg2 = reinterpret_cast< std::vector< faiss::RangeSearchPartialResult::QueryResult > * >(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::RangeSearchPartialResult::QueryResult > *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::RangeSearchPartialResult::QueryResult > *)& ((arg1)->queries);
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_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::RangeSearchPartialResult::QueryResult *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::RangeSearchPartialResult::QueryResult *) &(arg1)->new_result(arg2);
  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RangeSearchPartialResult__QueryResult, 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_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_setTempMemoryFraction", _wrap_StandardGpuResources_setTempMemoryFraction, 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 *)"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_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 *)"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_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 *)"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_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_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_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_imbalance_factor", _wrap_IndexIVF_imbalance_factor, METH_VARARGS, NULL},
	 { (char *)"IndexIVF_print_stats", _wrap_IndexIVF_print_stats, 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 *)"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 *)"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 *)"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_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_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", _wrap_HNSW_search_from, 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_range_search", _wrap_IndexIVFFlat_range_search, 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 *)"IndexBinaryIVF_train_q1", _wrap_IndexBinaryIVF_train_q1, 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_imbalance_factor", _wrap_IndexBinaryIVF_imbalance_factor, METH_VARARGS, NULL},
	 { (char *)"IndexBinaryIVF_print_stats", _wrap_IndexBinaryIVF_print_stats, 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 *)"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 *)"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 *)"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 *)"allocMemorySpace", _wrap_allocMemorySpace, 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_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_setMinPagingSize", _wrap_GpuIndexFlat_setMinPagingSize, METH_VARARGS, NULL},
	 { (char *)"GpuIndexFlat_getMinPagingSize", _wrap_GpuIndexFlat_getMinPagingSize, 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_search", _wrap_GpuIndexFlat_search, 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_add", _wrap_GpuIndexIVF_add, 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 *)"new_IndexProxy", _wrap_new_IndexProxy, METH_VARARGS, NULL},
	 { (char *)"delete_IndexProxy", _wrap_delete_IndexProxy, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_addIndex", _wrap_IndexProxy_addIndex, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_removeIndex", _wrap_IndexProxy_removeIndex, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_runOnIndex", _wrap_IndexProxy_runOnIndex, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_reset", _wrap_IndexProxy_reset, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_train", _wrap_IndexProxy_train, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_add", _wrap_IndexProxy_add, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_search", _wrap_IndexProxy_search, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_reconstruct", _wrap_IndexProxy_reconstruct, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_own_fields_set", _wrap_IndexProxy_own_fields_set, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_own_fields_get", _wrap_IndexProxy_own_fields_get, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_count", _wrap_IndexProxy_count, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_at", _wrap_IndexProxy_at, METH_VARARGS, NULL},
	 { (char *)"IndexProxy_swigregister", IndexProxy_swigregister, METH_VARARGS, NULL},
	 { (char *)"kmeans_clustering_gpu", _wrap_kmeans_clustering_gpu, 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 *)"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 *)"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 *)"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__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_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__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__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__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__IndexProxyTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index **)  ((faiss::gpu::IndexProxy **) 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__MultiIndexQuantizer2To_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index **) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 **) x));
}
static void *_p_p_faiss__IndexShardsTo_p_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index **)  ((faiss::IndexShards **) 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__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__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__IndexHNSWSQTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index *) (faiss::IndexHNSW *) ((faiss::IndexHNSWSQ *) x));
}
static void *_p_faiss__gpu__IndexProxyTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index *)  ((faiss::gpu::IndexProxy *) 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__MultiIndexQuantizer2To_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index *) (faiss::MultiIndexQuantizer *) ((faiss::MultiIndexQuantizer2 *) x));
}
static void *_p_faiss__IndexShardsTo_p_faiss__Index(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((faiss::Index *)  ((faiss::IndexShards *) 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__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_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_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__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__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__DistanceComputer = {"_p_faiss__HNSW__DistanceComputer", "faiss::HNSW::DistanceComputer *", 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__IndexScalarQuantizer = {"_p_faiss__IndexScalarQuantizer", "faiss::IndexScalarQuantizer *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_faiss__IndexShards = {"_p_faiss__IndexShards", "faiss::IndexShards *", 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__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__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__RangeSearchPartialResult = {"_p_faiss__RangeSearchPartialResult", "faiss::RangeSearchPartialResult *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_faiss__RangeSearchPartialResult__QueryResult = {"_p_faiss__RangeSearchPartialResult__QueryResult", "faiss::RangeSearchPartialResult::QueryResult *", 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__ScalarQuantizer = {"_p_faiss__ScalarQuantizer", "faiss::ScalarQuantizer *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_faiss__ScalarQuantizer__DistanceComputer = {"_p_faiss__ScalarQuantizer__DistanceComputer", "faiss::ScalarQuantizer::DistanceComputer *", 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__IndexProxy = {"_p_faiss__gpu__IndexProxy", "faiss::gpu::IndexProxy *", 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", "float *|faiss::HeapArray< faiss::CMin< float,long > >::T *|faiss::HeapArray< faiss::CMax< float,long > >::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", "int *|int32_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::HeapArray< faiss::CMax< float,long > >::TI *|faiss::HeapArray< faiss::CMin< float,long > >::TI *|faiss::BufferList::idx_t *|faiss::IDSelector::idx_t *|faiss::RangeSearchResult::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::AutoTuneCriterion::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__IndexProxy = {"_p_p_faiss__gpu__IndexProxy", 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__IndexShards = {"_p_p_faiss__IndexShards", 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__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__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_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__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__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__RangeSearchPartialResult__QueryResult_t = {"_p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_t", "std::vector< faiss::RangeSearchPartialResult::QueryResult > *", 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", "unsigned char *|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_cublasHandle_t,
  &_swigt__p_cudaStream_t,
  &_swigt__p_double,
  &_swigt__p_faiss__ArrayInvertedLists,
  &_swigt__p_faiss__AutoTuneCriterion,
  &_swigt__p_faiss__BinaryInvertedListScanner,
  &_swigt__p_faiss__BufferList,
  &_swigt__p_faiss__Cloner,
  &_swigt__p_faiss__Clustering,
  &_swigt__p_faiss__ClusteringParameters,
  &_swigt__p_faiss__ConcatenatedInvertedLists,
  &_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__DistanceComputer,
  &_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__IndexScalarQuantizer,
  &_swigt__p_faiss__IndexShards,
  &_swigt__p_faiss__IndexSplitVectors,
  &_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__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__RangeSearchPartialResult,
  &_swigt__p_faiss__RangeSearchPartialResult__QueryResult,
  &_swigt__p_faiss__RangeSearchResult,
  &_swigt__p_faiss__ReconstructFromNeighbors,
  &_swigt__p_faiss__RemapDimensionsTransform,
  &_swigt__p_faiss__ReproduceDistancesObjective,
  &_swigt__p_faiss__ScalarQuantizer,
  &_swigt__p_faiss__ScalarQuantizer__DistanceComputer,
  &_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__IndexProxy,
  &_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__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__IndexScalarQuantizer,
  &_swigt__p_p_faiss__IndexShards,
  &_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__IndexProxy,
  &_swigt__p_p_faiss__gpu__StandardGpuResources,
  &_swigt__p_p_void,
  &_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_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__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__OnDiskInvertedLists__List_t,
  &_swigt__p_std__vectorT_faiss__OperatingPoint_t,
  &_swigt__p_std__vectorT_faiss__ParameterRange_t,
  &_swigt__p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_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_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_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__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__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__DistanceComputer[] = {  {&_swigt__p_faiss__HNSW__DistanceComputer, 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__IndexProxy, _p_faiss__gpu__IndexProxyTo_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__IndexShards, _p_faiss__IndexShardsTo_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__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__IndexScalarQuantizer[] = {  {&_swigt__p_faiss__IndexScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_faiss__IndexShards[] = {  {&_swigt__p_faiss__IndexShards, 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__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__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__RangeSearchPartialResult[] = {  {&_swigt__p_faiss__RangeSearchPartialResult, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_faiss__RangeSearchPartialResult__QueryResult[] = {  {&_swigt__p_faiss__RangeSearchPartialResult__QueryResult, 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__ScalarQuantizer[] = {  {&_swigt__p_faiss__ScalarQuantizer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_faiss__ScalarQuantizer__DistanceComputer[] = {  {&_swigt__p_faiss__ScalarQuantizer__DistanceComputer, 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},{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__IndexProxy[] = {  {&_swigt__p_faiss__gpu__IndexProxy, 0, 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__IndexProxy[] = {{&_swigt__p_p_faiss__gpu__IndexProxy, 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__IndexShards[] = {{&_swigt__p_p_faiss__IndexShards, 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__IndexProxy, _p_p_faiss__gpu__IndexProxyTo_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__IndexShards, _p_p_faiss__IndexShardsTo_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__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},{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__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_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__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__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__RangeSearchPartialResult__QueryResult_t[] = {  {&_swigt__p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_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_cublasHandle_t,
  _swigc__p_cudaStream_t,
  _swigc__p_double,
  _swigc__p_faiss__ArrayInvertedLists,
  _swigc__p_faiss__AutoTuneCriterion,
  _swigc__p_faiss__BinaryInvertedListScanner,
  _swigc__p_faiss__BufferList,
  _swigc__p_faiss__Cloner,
  _swigc__p_faiss__Clustering,
  _swigc__p_faiss__ClusteringParameters,
  _swigc__p_faiss__ConcatenatedInvertedLists,
  _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__DistanceComputer,
  _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__IndexScalarQuantizer,
  _swigc__p_faiss__IndexShards,
  _swigc__p_faiss__IndexSplitVectors,
  _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__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__RangeSearchPartialResult,
  _swigc__p_faiss__RangeSearchPartialResult__QueryResult,
  _swigc__p_faiss__RangeSearchResult,
  _swigc__p_faiss__ReconstructFromNeighbors,
  _swigc__p_faiss__RemapDimensionsTransform,
  _swigc__p_faiss__ReproduceDistancesObjective,
  _swigc__p_faiss__ScalarQuantizer,
  _swigc__p_faiss__ScalarQuantizer__DistanceComputer,
  _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__IndexProxy,
  _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__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__IndexScalarQuantizer,
  _swigc__p_p_faiss__IndexShards,
  _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__IndexProxy,
  _swigc__p_p_faiss__gpu__StandardGpuResources,
  _swigc__p_p_void,
  _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_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__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__OnDiskInvertedLists__List_t,
  _swigc__p_std__vectorT_faiss__OperatingPoint_t,
  _swigc__p_std__vectorT_faiss__ParameterRange_t,
  _swigc__p_std__vectorT_faiss__RangeSearchPartialResult__QueryResult_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("<Swig global variables>");
#else
    return PyString_FromString("<Swig global variables>");
#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 >(5)));
  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_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_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);
  
  /* needed, else crash at runtime */
  import_array();
  
#if PY_VERSION_HEX >= 0x03000000
  return m;
#else
  return;
#endif
}

