Logo Search packages:      
Sourcecode: octave-ann version File versions  Download package

ann_wrap.cpp

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.37
 * 
 * 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. 
 * ----------------------------------------------------------------------------- */

#define SWIGOCTAVE
#define SWIG_name_d      "ann"
#define SWIG_name        ann


#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 (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  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



#include <octave/oct.h>
#include <octave/parse.h>
#include <octave/ov-fcn-handle.h>
#include <octave/Cell.h>
#include <octave/oct-map.h>

/* -----------------------------------------------------------------------------
 * 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 and 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
#  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 */
00340 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 */
00350 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.*/
00360 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 not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  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_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/*
  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) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
      /* since l+r >= 0, we can (>> 1) instead (/ 2) */
      register size_t i = (l + r) >> 1; 
      const char *iname = iter->types[i]->name;
      if (iname) {
        register 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 {
      register 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";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register 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) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (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





SWIGRUNTIME bool SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) {
  if (num_args > max_args && !varargs)
    error("function %s takes at most %i arguments", func_name, max_args);
  else if (num_args < min_args)
    error("function %s requires at least %i arguments", func_name, min_args);
  else
    return true;
  return false;
}

SWIGRUNTIME octave_value_list *SWIG_Octave_AppendOutput(octave_value_list *ovl, const octave_value &ov) {
  ovl->append(ov);
  return ovl;
}

SWIGRUNTIME octave_value SWIG_ErrorType(int code) {
  switch (code) {
  case SWIG_MemoryError:
    return "SWIG_MemoryError";
  case SWIG_IOError:
    return "SWIG_IOError";
  case SWIG_RuntimeError:
    return "SWIG_RuntimeError";
  case SWIG_IndexError:
    return "SWIG_IndexError";
  case SWIG_TypeError:
    return "SWIG_TypeError";
  case SWIG_DivisionByZero:
    return "SWIG_DivisionByZero";
  case SWIG_OverflowError:
    return "SWIG_OverflowError";
  case SWIG_SyntaxError:
    return "SWIG_SyntaxError";
  case SWIG_ValueError:
    return "SWIG_ValueError";
  case SWIG_SystemError:
    return "SWIG_SystemError";
  case SWIG_AttributeError:
    return "SWIG_AttributeError";
  }
  return "SWIG unknown error";
}

SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) {
  octave_value type(SWIG_ErrorType(code));
  std::string r = msg;
  r += " (" + type.string_value() + ")";
  error(r.c_str());
  return octave_value(r);
}

#define SWIG_fail                                       goto fail

#define SWIG_Octave_ConvertPtr(obj, pptr, type, flags)  SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Octave_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Octave_ConvertPtrAndOwn(obj, pptr, type, flags, own)
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Octave_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Octave_NewPointerObj(ptr, type, flags)
#define swig_owntype                                    int

#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Octave_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Octave_NewPackedObj(ptr, sz, type)

#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)

#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Octave_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Octave_NewPackedObj(ptr, sz, type)

#define SWIG_GetModule(clientdata) SWIG_Octave_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Octave_SetModule(clientdata,pointer);
#define SWIG_MODULE_CLIENTDATA_TYPE void*

#define Octave_Error_Occurred() 0
#define SWIG_Octave_AddErrorMsg(msg) {;}

SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata);
SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer);

// For backward compatibility only
#define SWIG_POINTER_EXCEPTION  0
#define SWIG_arg_fail(arg)      0

// Runtime API implementation

#include <map>
#include <vector>
#include <string>

typedef octave_value_list(*octave_func) (const octave_value_list &, int);
class octave_swig_type;

namespace Swig {
  class Director;

  SWIGRUNTIME void swig_register_director(octave_swig_type *self, void *ptr, Director *d);
  SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d);
  SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self);

  SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost);
  SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov);
  SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov);

  typedef std::map < void *, Director * > rtdir_map;

  SWIGINTERN rtdir_map &get_rtdir_map() {
    static swig_module_info *module = 0;
    if (!module)
      module = SWIG_GetModule(0);
    assert(module);
    if (!module->clientdata)
      module->clientdata = new rtdir_map;
    return *(rtdir_map *) module->clientdata;
  }

  SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d) {
    get_rtdir_map()[vptr] = d;
  }

  SWIGINTERNINLINE void erase_rtdir(void *vptr) {
    get_rtdir_map().erase(vptr);
  }

  SWIGINTERNINLINE Director *get_rtdir(void *vptr) {
    rtdir_map::const_iterator pos = get_rtdir_map().find(vptr);
    Director *rtdir = (pos != get_rtdir_map().end())? pos->second : 0;
    return rtdir;
  }
}

00888   struct swig_octave_member {
    const char *name;
    octave_func method;
    octave_func get_method;
    octave_func set_method;
    int flags;                // 1 static, 2 global
    const char *doc;
    bool is_static() const {
      return flags &1;
    } bool is_global() const {
      return flags &2;
    }
  };

00902   struct swig_octave_class {
    const char *name;
    swig_type_info **type;
    int director;
    octave_func constructor;
    const char *constructor_doc;
    octave_func destructor;
    const swig_octave_member *members;
    const char **base_names;
    const swig_type_info **base;
  };

  // octave_swig_type plays the role of both the shadow class and the class 
  // representation within Octave, since there is no support for classes.
  //
  // These should really be decoupled, with the class support added to Octave
  // and the shadow class given by an m-file script. That would dramatically 
  // reduce the runtime complexity, and be more in line w/ other modules.

00921   class octave_swig_type:public octave_base_value {
00922     struct cpp_ptr {
      void *ptr;
      bool destroyed;
      cpp_ptr(void *_ptr):ptr(_ptr), destroyed(false) {
      }};
    typedef std::pair < const swig_type_info *, cpp_ptr > type_ptr_pair;

    mutable swig_module_info *module;

    const swig_type_info *construct_type; // type of special type object
    std::vector < type_ptr_pair > types;  // our c++ base classes
    int own;                  // whether we call c++ destructors when we die

    typedef std::pair < const swig_octave_member *, octave_value > member_value_pair;
    typedef std::map < std::string, member_value_pair > member_map;
    member_map members;
    bool always_static;

    const swig_octave_member *find_member(const swig_type_info *type, const std::string &name) {
      if (!type->clientdata)
      return 0;
      swig_octave_class *c = (swig_octave_class *) type->clientdata;
      const swig_octave_member *m;
      for (m = c->members; m->name; ++m)
      if (m->name == name)
        return m;
      for (int j = 0; c->base_names[j]; ++j) {
      if (!c->base[j]) {
        if (!module)
          module = SWIG_GetModule(0);
        assert(module);
        c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]);
      }
      if (!c->base[j])
        return 0;
      if ((m = find_member(c->base[j], name)))
        return m;
      }
      return 0;
    }

    member_value_pair *find_member(const std::string &name, bool insert_if_not_found) {
      member_map::iterator it = members.find(name);
      if (it != members.end())
      return &it->second;
      const swig_octave_member *m;
      for (unsigned int j = 0; j < types.size(); ++j)
      if ((m = find_member(types[j].first, name)))
        return &members.insert(std::make_pair(name, std::make_pair(m, octave_value()))).first->second;
      if (!insert_if_not_found)
      return 0;
      return &members[name];
    }

    const swig_type_info *find_base(const std::string &name, const swig_type_info *base) {
      if (!base) {
      for (unsigned int j = 0; j < types.size(); ++j) {
        assert(types[j].first->clientdata);
        swig_octave_class *cj = (swig_octave_class *) types[j].first->clientdata;
        if (cj->name == name)
          return types[j].first;
      }
      return 0;
      }
      assert(base->clientdata);
      swig_octave_class *c = (swig_octave_class *) base->clientdata;
      for (int j = 0; c->base_names[j]; ++j) {
      if (!c->base[j]) {
        if (!module)
          module = SWIG_GetModule(0);
        assert(module);
        c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]);
      }
      if (!c->base[j])
        return 0;
      assert(c->base[j]->clientdata);
      swig_octave_class *cj = (swig_octave_class *) c->base[j]->clientdata;
      if (cj->name == name)
        return c->base[j];
      }
      return 0;
    }

    void load_members(const swig_octave_class* c,member_map& out) const {
      for (const swig_octave_member *m = c->members; m->name; ++m) {
      if (out.find(m->name) == out.end())
        out.insert(std::make_pair(m->name, std::make_pair(m, octave_value())));
      }
      for (int j = 0; c->base_names[j]; ++j) {
      if (!c->base[j]) {
        if (!module)
          module = SWIG_GetModule(0);
        assert(module);
        c->base[j] = SWIG_MangledTypeQueryModule(module, module, c->base_names[j]);
      }
      if (!c->base[j])
        continue;
      assert(c->base[j]->clientdata);
      const swig_octave_class *cj =
        (const swig_octave_class *) c->base[j]->clientdata;
      load_members(cj,out);
      }
    }

    void load_members(member_map& out) const {
      out=members;
      for (unsigned int j = 0; j < types.size(); ++j)
      if (types[j].first->clientdata)
        load_members((const swig_octave_class *) types[j].first->clientdata, out);
    }

    octave_value_list member_invoke(member_value_pair *m, const octave_value_list &args, int nargout) {
      if (m->second.is_defined())
      return m->second.subsref("(", std::list < octave_value_list > (1, args), nargout);
      else if (m->first && m->first->method)
      return m->first->method(args, nargout);
      error("member not defined or not invocable");
      return octave_value_list();
    }

    bool dispatch_unary_op(const std::string &symbol, octave_value &ret) {
      member_value_pair *m = find_member(symbol, false);
      if (!m || m->first->is_static() || m->first->is_global())
      return false;
      octave_value_list args;
      args.append(as_value());
      octave_value_list argout(member_invoke(m, args, 1));
      if (argout.length() < 1)
      return false;
      ret = argout(0);
      return true;
    }

    bool dispatch_binary_op(const std::string &symbol, const octave_base_value &rhs, octave_value &ret) {
      member_value_pair *m = find_member(symbol, false);
      if (!m || m->first->is_static() || m->first->is_global())
      return false;
      octave_value_list args;
      args.append(as_value());
      args.append(make_value_hack(rhs));
      octave_value_list argout(member_invoke(m, args, 1));
      if (argout.length() < 1)
      return false;
      ret = argout(0);
      return true;
    }

    bool dispatch_index_op(const std::string &symbol, const octave_value_list &rhs, octave_value_list &ret) {
      member_value_pair *m = find_member(symbol, false);
      if (!m || m->first->is_static() || m->first->is_global())
      return false;
      octave_value_list args;
      args.append(as_value());
      args.append(rhs);
      octave_value_list argout(member_invoke(m, args, 1));
      if (argout.length() >= 1)
      ret = argout(0);
      return true;
    }

    octave_value_list member_deref(member_value_pair *m, const octave_value_list &args) {
      if (m->second.is_defined())
      return m->second;
      else if (m->first) {
      if (m->first->get_method)
        return m->first->get_method(args, 1);
      else if (m->first->method)
        return octave_value(new octave_builtin(m->first->method));
      }
      error("undefined member");
      return octave_value_list();
    }

    static octave_value make_value_hack(const octave_base_value &x) {
      ((octave_swig_type &) x).count++;
      return octave_value((octave_base_value *) &x);
    }

    octave_swig_type(const octave_swig_type &x);
    octave_swig_type &operator=(const octave_swig_type &rhs);
  public:

    octave_swig_type(void *_ptr = 0, const swig_type_info *_type = 0, int _own = 0,
                 bool _always_static = false)
      :     module(0), construct_type(_ptr ? 0 : _type), own(_own), 
      always_static(_always_static) {
      if (_type || _ptr)
      types.push_back(std::make_pair(_type, _ptr));
      if (_ptr) {
      Swig::Director *d = Swig::get_rtdir(_ptr);
      if (d)
        Swig::swig_director_set_self(d, this);
      }
    }

    ~octave_swig_type() {
      if (own) {
      ++count;
      for (unsigned int j = 0; j < types.size(); ++j) {
        if (!types[j].first || !types[j].first->clientdata)
          continue;
        swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata;
        if (c->destructor && !types[j].second.destroyed && types[j].second.ptr) {
          c->destructor(as_value(), 0);
        }
      }
      }
      for (unsigned int j = 0; j < types.size(); ++j)
      Swig::erase_rtdir(types[j].second.ptr);
    }

    octave_value as_value() {
      ++count;
      return Swig::swig_value_ref(this);
    }

    void incref() {
      ++count;
    }

    void decref() {
      if (!--count)
      delete this;
    }

    long swig_this() const {
      if (!types.size())
      return (long) this;
      return (long) types[0].second.ptr;
    }
    const char* help_text() const {
      if (!types.size())
      return 0;
      if (!types[0].first->clientdata)
      return 0;
      swig_octave_class *c = (swig_octave_class *) types[0].first->clientdata;
      return c->constructor_doc;
    }

    std::string swig_type_name() const {
      // * need some way to manually name subclasses.
      // * eg optional first arg to subclass(), or named_subclass()
      std::string ret;
      for (unsigned int j = 0; j < types.size(); ++j) {
      if (j)
        ret += "_";
      if (types[j].first->clientdata) {
        swig_octave_class *c = (swig_octave_class *) types[j].first->clientdata;
        ret += c->name;
      } else
        ret += types[j].first->name;
      }
      return ret;
    }

    void merge(octave_swig_type &rhs) {
      rhs.own = 0;
      for (unsigned int j = 0; j < rhs.types.size(); ++j) {
      assert(!rhs.types[j].second.destroyed);
      Swig::Director *d = Swig::get_rtdir(rhs.types[j].second.ptr);
      if (d)
        Swig::swig_director_set_self(d, this);
      }
      types.insert(types.end(), rhs.types.begin(), rhs.types.end());
      members.insert(rhs.members.begin(), rhs.members.end());
      rhs.types.clear();
      rhs.members.clear();
    }

    void install_global() {
      for (member_map::const_iterator it = members.begin(); it != members.end(); ++it) {
      if (it->second.first && it->second.first->method)
        install_builtin_function(it->second.first->method, it->first,
                           it->second.first->doc?it->second.first->doc:std::string());
      else if (it->second.second.is_defined()) {
        link_to_global_variable(curr_sym_tab->lookup(it->first, true));
        set_global_value(it->first, it->second.second);
        
        octave_swig_type *ost = Swig::swig_value_deref(it->second.second);
        if (ost) {
          const char* h = ost->help_text();
          if (h) {
            symbol_record *sr = global_sym_tab->lookup (it->first, true);
            sr->document(h);
          }
        }
      }
      }
    }

    void *cast(swig_type_info *type, int *_own, int flags) {
      if (_own)
      *_own = own;
      if (flags &SWIG_POINTER_DISOWN)
      own = 0;
      if (!type && types.size())
      return types[0].second.ptr;
      for (unsigned int j = 0; j < types.size(); ++j)
      if (type == types[j].first)
        return types[j].second.ptr;
      for (unsigned int j = 0; j < types.size(); ++j) {
      swig_cast_info *tc = SWIG_TypeCheck(types[j].first->name, type);
      if (!tc)
        continue;
      int newmemory = 0;
      void *vptr = SWIG_TypeCast(tc, types[j].second.ptr, &newmemory);
      assert(!newmemory);     // newmemory handling not yet implemented
      return vptr;
      }
      return 0;
    }

    bool is_owned() const {
      return own;
    }

    void director_destroyed(Swig::Director *d) {
      bool found = false;
      for (unsigned int j = 0; j < types.size(); ++j) {
      Swig::Director *dj = Swig::get_rtdir(types[j].second.ptr);
      if (dj == d) {
        types[j].second.destroyed = true;
        found = true;
      }
      }
      assert(found);
    }

    void assign(const std::string &name, const octave_value &ov) {
      members[name] = std::make_pair((const swig_octave_member *) 0, ov);
    }

    void assign(const std::string &name, const swig_octave_member *m) {
      members[name] = std::make_pair(m, octave_value());
    }

    octave_base_value *clone() const {
      // pass-by-value is probably not desired, and is harder;
      // requires calling copy constructors of contained types etc.
      assert(0);
      *(int *) 0 = 0;
      return 0;
    }

    octave_base_value *empty_clone() const {
      return new octave_swig_type();
    }

    bool is_defined() const {
      return true;
    }

    virtual bool is_map() const {
      return true;
    }

    virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) {
      octave_value_list ovl = subsref(ops, idx, 1);
      return ovl.length()? ovl(0) : octave_value();
    }

    virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout) {
      assert(ops.size() > 0);
      assert(ops.size() == idx.size());

      std::list < octave_value_list >::const_iterator idx_it = idx.begin();
      int skip = 0;
      octave_value_list sub_ovl;

      // constructor invocation
      if (ops[skip] == '(' && construct_type) {
      assert(construct_type->clientdata);
      swig_octave_class *c = (swig_octave_class *) construct_type->clientdata;
      if (!c->constructor) {
        error("cannot create instance");
        return octave_value_list();
      }
      octave_value_list args;
      if (c->director)
        args.append(Swig::swig_value_ref(new octave_swig_type(this, 0, 0)));
      args.append(*idx_it++);
      ++skip;
      sub_ovl = c->constructor(args, nargout);
      }
      // member dereference or invocation
      else if (ops[skip] == '.') {
      std::string subname;
      const swig_type_info *base = 0;     // eg, a.base.base_cpp_mem
      for (;;) {
        octave_value_list subname_ovl(*idx_it++);
        ++skip;
        assert(subname_ovl.length() == 1 && subname_ovl(0).is_string());
        subname = subname_ovl(0).string_value();

        const swig_type_info *next_base = find_base(subname, base);
        if (!next_base || skip >= (int) ops.size() || ops[skip] != '.')
          break;
        base = next_base;
      }

      member_value_pair tmp, *m = &tmp;
      if (!base || !(m->first = find_member(base, subname)))
        m = find_member(subname, false);
      if (!m) {
        error("member not found");
        return octave_value_list();
      }

      octave_value_list args;
      if (!always_static &&
          (!m->first || (!m->first->is_static() && !m->first->is_global())))
        args.append(as_value());
      if (skip < (int) ops.size() && ops[skip] == '(' && 
          ((m->first && m->first->method) || m->second.is_function() || 
           m->second.is_function_handle())) {
        args.append(*idx_it++);
        ++skip;
        sub_ovl = member_invoke(m, args, nargout);
      } else {
        sub_ovl = member_deref(m, args);
      }
      }
      // index operator
      else {
      if (ops[skip] == '(' || ops[skip] == '{') {
        const char *op_name = ops[skip] == '(' ? "__paren__" : "__brace__";
        octave_value_list args;
        args.append(*idx_it++);
        ++skip;
        if (!dispatch_index_op(op_name, args, sub_ovl)) {
          error("error evaluating index operator");
          return octave_value_list();
        }
      } else {
        error("unsupported subsref");
        return octave_value_list();
      }
      }

      if (skip >= (int) ops.size())
      return sub_ovl;
      if (sub_ovl.length() < 1) {
      error("bad subs ref");
      return octave_value_list();
      }
      return sub_ovl(0).next_subsref(nargout, ops, idx, skip);
    }

    octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) {
      assert(ops.size() > 0);
      assert(ops.size() == idx.size());

      std::list < octave_value_list >::const_iterator idx_it = idx.begin();
      int skip = 0;

      if (ops.size() > 1) {
      std::list < octave_value_list >::const_iterator last = idx.end();
      --last;
      std::list < octave_value_list > next_idx(idx.begin(), last);
      octave_value next_ov = subsref(ops.substr(0, ops.size() - 1), next_idx);
      next_ov.subsasgn(ops.substr(ops.size() - 1), std::list < octave_value_list > (1, *last), rhs);
      }

      else if (ops[skip] == '(' || ops[skip] == '{') {
      const char *op_name = ops[skip] == '(' ? "__paren_asgn__" : "__brace_asgn__";
      member_value_pair *m = find_member(op_name, false);
      if (m) {
        octave_value_list args;
        args.append(as_value());
        args.append(*idx_it);
        args.append(rhs);
        member_invoke(m, args, 1);
      } else
        error("%s member not found", op_name);
      }

      else if (ops[skip] == '.') {
      octave_value_list subname_ovl(*idx_it++);
      ++skip;
      assert(subname_ovl.length() == 1 &&subname_ovl(0).is_string());
      std::string subname = subname_ovl(0).string_value();

      member_value_pair *m = find_member(subname, true);
      if (!m->first || !m->first->set_method) {
        m->first = 0;
        m->second = rhs;
      } else if (m->first->set_method) {
        octave_value_list args;
        if (!m->first->is_static() && !m->first->is_global())
          args.append(as_value());
        args.append(rhs);
        m->first->set_method(args, 1);
      } else
        error("member not assignable");
      } else
      error("unsupported subsasgn");

      return as_value();
    }

    virtual bool is_string() const {
      octave_swig_type *nc_this = const_cast < octave_swig_type *>(this);
      return !!nc_this->find_member("__str__", false);
    }

    virtual std::string string_value(bool force = false) const {
      octave_swig_type *nc_this = const_cast < octave_swig_type *>(this);
      member_value_pair *m = nc_this->find_member("__str__", false);
      if (!m) {
      error("__str__ method not defined");
      return std::string();
      }
      octave_value_list outarg = nc_this->member_invoke(m, octave_value_list(nc_this->as_value()), 1);
      if (outarg.length() < 1 || !outarg(0).is_string()) {
      error("__str__ method did not return a string");
      return std::string();
      }
      return outarg(0).string_value();
    }

    virtual Octave_map map_value() const {
      return Octave_map();
    }

    virtual string_vector map_keys() const {
      member_map tmp;
      load_members(tmp);

      string_vector keys(tmp.size());
      int k = 0;
      for (member_map::iterator it = tmp.begin(); it != tmp.end(); ++it)
      keys(k++) = it->first;

      return keys;
    }

    virtual bool save_ascii (std::ostream& os) {
      return true;
    }

    virtual bool load_ascii (std::istream& is) {
      return true;
    }

    virtual bool save_binary (std::ostream& os, bool& save_as_floats) {
      return true;
    }

    virtual bool load_binary (std::istream& is, bool swap, 
                        oct_mach_info::float_format fmt) {
      return true;
    }

#if defined (HAVE_HDF5)
    virtual bool
      save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
      return true;
    }

    virtual bool
      load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
      return true;
    }
#endif

    virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const {
      return string_value();
    }

    virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const {
      return string_value();
    }

    static bool dispatch_global_op(const std::string &symbol, const octave_value_list &args, octave_value &ret) {
      // we assume that "op_"-prefixed functions are installed in global namespace
      // (rather than any module namespace).

      octave_value fcn = get_global_value(symbol, true);
      if (!fcn.is_function() && !fcn.is_function_handle())
      return false;
      ret = fcn.subsref("(", std::list < octave_value_list > (1, args));
      return true;
    }

    static octave_value dispatch_unary_op(const octave_base_value &x, const char *op_name) {
      octave_swig_type *ost = Swig::swig_value_deref(x);
      assert(ost);

      octave_value ret;
      if (ost->dispatch_unary_op(std::string("__") + op_name + std::string("__"), ret))
      return ret;
      std::string symbol = "op_" + ost->swig_type_name() + "_" + op_name;
      octave_value_list args;
      args.append(make_value_hack(x));
      if (dispatch_global_op(symbol, args, ret))
      return ret;

      error("could not dispatch unary operator");
      return octave_value();
    }

    static octave_value dispatch_binary_op(const octave_base_value &lhs, const octave_base_value &rhs, const char *op_name) {
      octave_swig_type *lhs_ost = Swig::swig_value_deref(lhs);
      octave_swig_type *rhs_ost = Swig::swig_value_deref(rhs);

      octave_value ret;
      if (lhs_ost && lhs_ost->dispatch_binary_op(std::string("__") + op_name + std::string("__"), rhs, ret))
      return ret;

      std::string symbol;
      octave_value_list args;
      args.append(make_value_hack(lhs));
      args.append(make_value_hack(rhs));

      symbol = "op_";
      symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name();
      symbol += "_";
      symbol += op_name;
      symbol += "_";
      symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name();
      if (dispatch_global_op(symbol, args, ret))
      return ret;

      symbol = "op_";
      symbol += lhs_ost ? lhs_ost->swig_type_name() : lhs.type_name();
      symbol += "_";
      symbol += op_name;
      symbol += "_";
      symbol += "any";
      if (dispatch_global_op(symbol, args, ret))
      return ret;

      symbol = "op_";
      symbol += "any";
      symbol += "_";
      symbol += op_name;
      symbol += "_";
      symbol += rhs_ost ? rhs_ost->swig_type_name() : rhs.type_name();
      if (dispatch_global_op(symbol, args, ret))
      return ret;

      error("could not dispatch binary operator");
      return octave_value();
    }

    void print(std::ostream &os, bool pr_as_read_syntax = false) const {
      if (is_string()) {
      os << string_value();
      return;
      }

      member_map tmp;
      load_members(tmp);

      os << "{" << std::endl;
      for (unsigned int j = 0; j < types.size(); ++j) {
      if (types[j].first->clientdata) {
        const swig_octave_class *c = (const swig_octave_class *) types[j].first->clientdata;
        os << "  " << c->name << ", ptr = " << types[j].second.ptr << std::endl;
      } else {
        os << "  " << types[j].first->name << ", ptr = " << types[j].second.ptr << std::endl;
      }
      }
      for (member_map::const_iterator it = tmp.begin(); it != tmp.end(); ++it) {
      if (it->second.first) {
        const char *objtype = it->second.first->method ? "method" : "variable";
        const char *modifier = (it->second.first->flags &1) ? "static " : (it->second.first->flags &2) ? "global " : "";
        os << "  " << it->second.first->name << " (" << modifier << objtype << ")" << std::endl;
        assert(it->second.first->name == it->first);
      } else {
        os << "  " << it->first << std::endl;
      }
      }
      os << "}" << std::endl;
    }
  };

  // Octave tries hard to preserve pass-by-value semantics. Eg, assignments
  // will call clone() via make_unique() if there is more than one outstanding 
  // reference to the lhs, and forces the clone's reference count to 1 
  // (so you can't just increment your own count and return this).
  //
  // One way to fix this (without modifying Octave) is to add a level of
  // indirection such that clone copies ref-counted pointer and we keep 
  // pass-by-ref semantics (which are more natural/expected for C++ bindings).
  //
  // Supporting both pass-by-{ref,value} and toggling via %feature/option 
  // might be nice.

01611   class octave_swig_ref:public octave_base_value {
    octave_swig_type *ptr;
  public:
    octave_swig_ref(octave_swig_type *_ptr = 0)
      :ptr(_ptr) { }

    ~octave_swig_ref()
      { if (ptr) ptr->decref(); }

    octave_swig_type *get_ptr() const
      { return ptr; }

    octave_base_value *clone() const
      { if (ptr) ptr->incref(); return new octave_swig_ref(ptr); }

    octave_base_value *empty_clone() const
      { return new octave_swig_ref(0); }

    bool is_defined() const
      { return ptr->is_defined(); }

    virtual bool is_map() const 
      { return ptr->is_map(); }

    virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) 
      { return ptr->subsref(ops, idx); }

    virtual octave_value_list subsref(const std::string &ops, const std::list < octave_value_list > &idx, int nargout)
      { return ptr->subsref(ops, idx, nargout); }

    octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs)
      { return ptr->subsasgn(ops, idx, rhs); }

    virtual bool is_string() const 
      { return ptr->is_string(); }

    virtual std::string string_value(bool force = false) const 
      { return ptr->string_value(force); }

    virtual Octave_map map_value() const
      { return ptr->map_value(); }

    virtual string_vector map_keys() const
      { return ptr->map_keys(); }

    virtual bool save_ascii (std::ostream& os)
      { return ptr->save_ascii(os); }

    virtual bool load_ascii (std::istream& is)
      { return ptr->load_ascii(is); }

    virtual bool save_binary (std::ostream& os, bool& save_as_floats)
      { return ptr->save_binary(os, save_as_floats); }

    virtual bool load_binary (std::istream& is, bool swap, 
                        oct_mach_info::float_format fmt)
      { return ptr->load_binary(is, swap, fmt); }

#if defined (HAVE_HDF5)
    virtual bool
      save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats)
      { return ptr->save_hdf5(loc_id, name, save_as_floats); }

    virtual bool
      load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug)
      { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
#endif

    virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const
      { return ptr->convert_to_str(pad, force, type); }

    virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
      { return ptr->convert_to_str_internal(pad, force, type); }

    void print(std::ostream &os, bool pr_as_read_syntax = false) const
      { return ptr->print(os, pr_as_read_syntax); }

  private:
    DECLARE_OCTAVE_ALLOCATOR;
    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
  };
  DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref);
  DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref");

01695   class octave_swig_packed:public octave_base_value {
    swig_type_info *type;
    std::vector < char > buf;
  public:

    octave_swig_packed(swig_type_info *_type = 0, const void *_buf = 0, size_t _buf_len = 0)
      :     type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) {
    }

    bool copy(swig_type_info *outtype, void *ptr, size_t sz) const {
      if (outtype && outtype != type)
      return false;
      assert(sz <= buf.size());
      std::copy(buf.begin(), buf.begin()+sz, (char*)ptr);
      return true;
    }

    octave_base_value *clone() const {
      return new octave_swig_packed(*this);
    }

    octave_base_value *empty_clone() const {
      return new octave_swig_packed();
    }

    bool is_defined() const {
      return true;
    }

    void print(std::ostream &os, bool pr_as_read_syntax = false) const {
      os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size() << std::endl;
    }


    virtual bool save_ascii (std::ostream& os) {
      return true;
    }

    virtual bool load_ascii (std::istream& is) {
      return true;
    }

    virtual bool save_binary (std::ostream& os, bool& save_as_floats) {
      return true;
    }

    virtual bool load_binary (std::istream& is, bool swap, 
                        oct_mach_info::float_format fmt) {
      return true;
    }

#if defined (HAVE_HDF5)
    virtual bool
      save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
      return true;
    }

    virtual bool
      load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
      return true;
    }
#endif

  private:
    DECLARE_OCTAVE_ALLOCATOR;
    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
  };
  DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed);
  DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed");

  static octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) {
    error("attempt to set immutable member variable");
    return octave_value_list();
  }

01770   struct octave_value_ref {
    const octave_value_list &ovl;
    int j;

    octave_value_ref(const octave_value_list &_ovl, int _j)
      :ovl(_ovl), j(_j) { }

    operator  octave_value() const {
      return ovl(j);
    }

    octave_value operator*() const {
      return ovl(j);
    }
  };

  octave_value_list swig_subclass(const octave_value_list &args, int nargout) {
    octave_swig_type *top = new octave_swig_type;
    for (int j = 0; j < args.length(); ++j) {
      if (args(j).type_id() == octave_swig_ref::static_type_id()) {
      octave_swig_ref *osr = static_cast < octave_swig_ref *>(args(j).internal_rep());
      octave_swig_type *ost = osr->get_ptr();
      if (!ost->is_owned()) {
        error("cannot subclass object not constructed on octave side");
        return octave_value_list();
      }
      top->merge(*ost);
      } else if (args(j).is_function_handle()) {
      top->assign(args(j).fcn_handle_value()->fcn_name(), args(j));
      } else if (args(j).is_string()) {
      if (j + 1 >= args.length()) {
        error("member assignments must be of string,value form");
        return octave_value_list();
      }
      top->assign(args(j).string_value(), args(j + 1));
      ++j;
      } else {
      error("invalid arguments to subclass");
      return octave_value_list();
      }
    }
    return octave_value(Swig::swig_value_ref(top));
  }

  octave_value_list swig_type(const octave_value_list &args, int nargout) {
    if (args.length() != 1) {
      error("swig_typeinfo must be called with only a single object");
      return octave_value_list();
    }
    octave_swig_type *ost = Swig::swig_value_deref(args(0));
    if (!ost) {
      error("object is not a swig_ref");
      return octave_value_list();
    }
    return octave_value(ost->swig_type_name());
  }

  octave_value_list swig_typequery(const octave_value_list &args, int nargout) {
    if (args.length() != 1 || !args(0).is_string()) {
      error("swig_typeinfo must be called with single string argument");
      return octave_value_list();
    }
    swig_module_info *module = SWIG_GetModule(0);
    swig_type_info *type = SWIG_TypeQueryModule(module, module, args(0).string_value().c_str());
    if (!type)
      return octave_value("<unknown>");
    return octave_value(type->name);
  }

  octave_value_list swig_this(const octave_value_list &args, int nargout) {
    if (args.length() != 1) {
      error("swig_typeinfo must be called with only a single object");
      return octave_value_list();
    }
    if (args(0).is_matrix_type() && args(0).rows() == 0 && args(0).columns() == 0)
      return octave_value(octave_uint64(0));
    octave_swig_type *ost = Swig::swig_value_deref(args(0));
    if (!ost) {
      error("object is not a swig_ref");
      return octave_value_list();
    }
    return octave_value(octave_uint64((unsigned long long) ost->swig_this()));
  }

#define SWIG_DIRECTORS

namespace Swig {
01857   class Director {
    octave_swig_type *self;
    bool disowned;

    Director(const Director &x);
    Director &operator=(const Director &rhs);
  public:

    Director(void *vptr):self(0), disowned(false) {
      set_rtdir(vptr, this);
    }

    ~Director() {
      swig_director_destroyed(self, this);
      if (disowned)
      self->decref();
    }

    void swig_set_self(octave_swig_type *new_self) {
      assert(!disowned);
      self = new_self;
    }

    octave_swig_type *swig_get_self() const {
      return self;
    }

    void swig_disown() {
      if (disowned)
      return;
      disowned = true;
      self->incref();
    }
  };

01892   struct DirectorTypeMismatchException {
    static void raise(const char *msg) {
      // ... todo
      throw(DirectorTypeMismatchException());
    }

    static void raise(const octave_value &ov, const char *msg) {
      // ... todo
      raise(msg);
    }
  };
01903   struct DirectorPureVirtualException {
    static void raise(const char *msg) {
      // ... todo
      throw(DirectorPureVirtualException());
    }

    static void raise(const octave_value &ov, const char *msg) {
      // ... todo
      raise(msg);
    }
  };

}

  SWIGRUNTIME void swig_acquire_ownership(void *vptr) {
    //  assert(0);
    // ... todo
  }

  SWIGRUNTIME void swig_acquire_ownership_array(void *vptr) {
    //  assert(0);
    // ... todo
  }

  SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own) {
    //  assert(0);
    // ... todo
  }

  namespace Swig {
    SWIGRUNTIME void swig_director_destroyed(octave_swig_type *self, Director *d) {
      self->director_destroyed(d);
    }

    SWIGRUNTIME void swig_director_set_self(Director *d, octave_swig_type *self) {
      d->swig_set_self(self);
    }

    SWIGRUNTIME octave_base_value *swig_value_ref(octave_swig_type *ost) {
      return new octave_swig_ref(ost);
    }

    SWIGRUNTIME octave_swig_type *swig_value_deref(octave_value ov) {
      if (ov.is_cell() && ov.rows() == 1 && ov.columns() == 1)
      ov = ov.cell_value()(0);
      return swig_value_deref(*ov.internal_rep());
    }

    SWIGRUNTIME octave_swig_type *swig_value_deref(const octave_base_value &ov) {
      if (ov.type_id() != octave_swig_ref::static_type_id())
      return 0;
      const octave_swig_ref *osr = static_cast < const octave_swig_ref *>(&ov);
      return osr->get_ptr();
    }

  }

#define swig_unary_op(name) \
SWIGRUNTIME octave_value swig_unary_op_##name(const octave_base_value &x) { \
  return octave_swig_type::dispatch_unary_op(x,#name); \
}
#define swig_binary_op(name) \
SWIGRUNTIME octave_value swig_binary_op_##name(const octave_base_value&lhs,const octave_base_value &rhs) { \
  return octave_swig_type::dispatch_binary_op(lhs,rhs,#name); \
}
#define swigreg_unary_op(name) \
if (!octave_value_typeinfo::lookup_unary_op(octave_value::op_##name,tid)) \
octave_value_typeinfo::register_unary_op(octave_value::op_##name,tid,swig_unary_op_##name);
#define swigreg_binary_op(name) \
if (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2)) \
octave_value_typeinfo::register_binary_op(octave_value::op_##name,tid1,tid2,swig_binary_op_##name);

  swig_unary_op(not);
  swig_unary_op(uplus);
  swig_unary_op(uminus);
  swig_unary_op(transpose);
  swig_unary_op(hermitian);
  swig_unary_op(incr);
  swig_unary_op(decr);

  swig_binary_op(add);
  swig_binary_op(sub);
  swig_binary_op(mul);
  swig_binary_op(div);
  swig_binary_op(pow);
  swig_binary_op(ldiv);
  swig_binary_op(lshift);
  swig_binary_op(rshift);
  swig_binary_op(lt);
  swig_binary_op(le);
  swig_binary_op(eq);
  swig_binary_op(ge);
  swig_binary_op(gt);
  swig_binary_op(ne);
  swig_binary_op(el_mul);
  swig_binary_op(el_div);
  swig_binary_op(el_pow);
  swig_binary_op(el_ldiv);
  swig_binary_op(el_and);
  swig_binary_op(el_or);

  SWIGRUNTIME void SWIG_InstallUnaryOps(int tid) {
    swigreg_unary_op(not);
    swigreg_unary_op(uplus);
    swigreg_unary_op(uminus);
    swigreg_unary_op(transpose);
    swigreg_unary_op(hermitian);
    swigreg_unary_op(incr);
    swigreg_unary_op(decr);
  }
  SWIGRUNTIME void SWIG_InstallBinaryOps(int tid1, int tid2) {
    swigreg_binary_op(add);
    swigreg_binary_op(sub);
    swigreg_binary_op(mul);
    swigreg_binary_op(div);
    swigreg_binary_op(pow);
    swigreg_binary_op(ldiv);
    swigreg_binary_op(lshift);
    swigreg_binary_op(rshift);
    swigreg_binary_op(lt);
    swigreg_binary_op(le);
    swigreg_binary_op(eq);
    swigreg_binary_op(ge);
    swigreg_binary_op(gt);
    swigreg_binary_op(ne);
    swigreg_binary_op(el_mul);
    swigreg_binary_op(el_div);
    swigreg_binary_op(el_pow);
    swigreg_binary_op(el_ldiv);
    swigreg_binary_op(el_and);
    swigreg_binary_op(el_or);
  }
  SWIGRUNTIME void SWIG_InstallOps(int tid) {
    // here we assume that tid are conseq integers increasing from zero, and 
    // that our tid is the last one. might be better to have explicit string 
    // list of types we should bind to, and use lookup_type to resolve their tid.

    SWIG_InstallUnaryOps(tid);
    SWIG_InstallBinaryOps(tid, tid);
    for (int j = 0; j < tid; ++j) {
      SWIG_InstallBinaryOps(j, tid);
      SWIG_InstallBinaryOps(tid, j);
    }
  }

SWIGRUNTIME octave_value SWIG_Octave_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
  int own = (flags &SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;

  Swig::Director *d = Swig::get_rtdir(ptr);
  if (d && d->swig_get_self())
    return d->swig_get_self()->as_value();
  return Swig::swig_value_ref(new octave_swig_type(ptr, type, own));
}

SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) {
  if (ov.is_cell() && ov.rows() == 1 && ov.columns() == 1)
    ov = ov.cell_value()(0);
  if (!ov.is_defined() ||
      (ov.is_matrix_type() && ov.rows() == 0 && ov.columns() == 0) ) {
    if (ptr)
      *ptr = 0;
    return SWIG_OK;
  }
  if (ov.type_id() != octave_swig_ref::static_type_id())
    return SWIG_ERROR;
  octave_swig_ref *osr = static_cast < octave_swig_ref *>(ov.internal_rep());
  octave_swig_type *ost = osr->get_ptr();
  void *vptr = ost->cast(type, own, flags);
  if (!vptr)
    return SWIG_ERROR;
  if (ptr)
    *ptr = vptr;
  return SWIG_OK;
}

SWIGRUNTIME octave_value SWIG_Octave_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
  return new octave_swig_packed(type, (char *) ptr, sz);
}

SWIGRUNTIME int SWIG_Octave_ConvertPacked(const octave_value &ov, void *ptr, size_t sz, swig_type_info *type) {
  if (!ov.is_defined())
    return SWIG_ERROR;
  if (ov.type_id() != octave_swig_packed::static_type_id())
    return SWIG_ERROR;
  octave_swig_packed *ost = static_cast < octave_swig_packed *>(ov.internal_rep());
  return ost->copy(type, (char *) ptr, sz) ? SWIG_OK : SWIG_ERROR;
}

void SWIG_Octave_SetConstant(octave_swig_type *module_ns, const std::string &name, const octave_value &ov) {
  module_ns->assign(name, ov);
}

SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata) {
  octave_value ov = get_global_value("__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION, true);
  if (!ov.is_defined() ||
      ov.type_id() != octave_swig_packed::static_type_id())
    return 0;
  const octave_swig_packed* osp = 
    static_cast < const octave_swig_packed *> (ov.internal_rep());
  swig_module_info *pointer = 0;
  osp->copy(0, &pointer, sizeof(swig_module_info *));
  return pointer;
}

SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer) {
  octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info *));
  const char *module_var = "__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION;
  link_to_global_variable(curr_sym_tab->lookup(module_var, true));
  set_global_value(module_var, ov);
}



#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_ANN_exception swig_types[0]
#define SWIGTYPE_p_ANNbd_tree swig_types[1]
#define SWIGTYPE_p_ANNbruteForce swig_types[2]
#define SWIGTYPE_p_ANNkdStats swig_types[3]
#define SWIGTYPE_p_ANNkd_tree swig_types[4]
#define SWIGTYPE_p_ANNorthHalfSpace swig_types[5]
#define SWIGTYPE_p_ANNorthRect swig_types[6]
#define SWIGTYPE_p_ANNpointSet swig_types[7]
#define SWIGTYPE_p_ANNsampStat swig_types[8]
#define SWIGTYPE_p_char swig_types[9]
#define SWIGTYPE_p_double swig_types[10]
#define SWIGTYPE_p_int swig_types[11]
#define SWIGTYPE_p_p_double swig_types[12]
#define SWIGTYPE_p_p_p_double swig_types[13]
#define SWIGTYPE_p_std__istream swig_types[14]
#define SWIGTYPE_p_std__ostream swig_types[15]
#define SWIGTYPE_p_std__string swig_types[16]
static swig_type_info *swig_types[18];
static swig_module_info swig_module = {swig_types, 17, 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) -------- */


#define SWIGVERSION 0x010337 
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 


#include <stdexcept>


#include <ANN/ANN.h>
#include <ANN/ANNperf.h>
#include <ANN/ANNx.h>


  SWIGINTERNINLINE octave_value SWIG_From_double    (double value)
    {    
      return octave_value(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;
}


SWIGINTERNINLINE octave_value
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
  return std::string(carray,carray+size);
}


SWIGINTERNINLINE octave_value 
SWIG_FromCharPtr(const char *cptr)
{ 
  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}


  SWIGINTERNINLINE octave_value SWIG_From_long    (long value)
    {    
      return octave_value(value);
    }


SWIGINTERNINLINE octave_value
SWIG_From_int  (int value)
{    
  return SWIG_From_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


  SWIGINTERN int SWIG_AsVal_long (const octave_value& ov, long* val)
    {
      if (!ov.is_scalar_type())
      return SWIG_TypeError;
      if (ov.is_complex_scalar())
      return SWIG_TypeError;
      if (ov.is_double_type()||ov.is_single_type()) {
      double v=ov.double_value();
      if (v!=floor(v))
        return SWIG_TypeError;
      }
      if (val)
      *val = ov.long_value();
      return SWIG_OK;
    }


SWIGINTERN int
SWIG_AsVal_int (octave_value 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 = (int)(v);
    }
  }  
  return res;
}


  SWIGINTERN int SWIG_AsVal_double (const octave_value& ov, double* val)
    {
      if (!ov.is_scalar_type())
      return SWIG_TypeError;
      if (ov.is_complex_scalar())
      return SWIG_TypeError;
      if (val)
      *val = ov.double_value();
      return SWIG_OK;
    }


#include <float.h>


SWIGINTERN int
SWIG_AsVal_float (octave_value obj, float *val)
{
  double v;
  int res = SWIG_AsVal_double (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v < -FLT_MAX || v > FLT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = (float)(v);
    }
  }  
  return res;
}


SWIGINTERNINLINE octave_value
SWIG_From_float  (float value)
{    
  return SWIG_From_double  (value);
}


SWIGINTERN int
SWIG_AsCharPtrAndSize(octave_value ov, char** cptr, size_t* psize, int *alloc)
{
  if (ov.is_cell() && ov.rows() == 1 && ov.columns() == 1)
    ov = ov.cell_value()(0);
  if (!ov.is_string())
    return SWIG_TypeError;
  
  std::string str=ov.string_value();
  size_t len=str.size();
  char* cstr=(char*)str.c_str();
  if (alloc) {
    *cptr = (char*)(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
    *alloc = SWIG_NEWOBJ;
  } else if (cptr)
    *cptr = cstr;
  if (psize)
    *psize = len + 1;
  return SWIG_OK;
}





static octave_value_list _wrap_ANN_DBL_MAX_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_DBL_MAX_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_DBL_MAX_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_double((double)(ANN_DBL_MAX));
  return obj;
}


static octave_value_list _wrap_ANN_NULL_IDX_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_NULL_IDX_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_NULL_IDX_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANN_NULL_IDX));
  return obj;
}


static octave_value_list _wrap_ANN_DIST_INF_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_DIST_INF_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_DIST_INF_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_double((double)(ANN_DIST_INF));
  return obj;
}


static octave_value_list _wrap_ANNcoordPrec_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANNcoordPrec_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANNcoordPrec_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANNcoordPrec));
  return obj;
}


static octave_value_list _wrap_ANN_ALLOW_SELF_MATCH_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_ALLOW_SELF_MATCH_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_ALLOW_SELF_MATCH_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANN_ALLOW_SELF_MATCH));
  return obj;
}


static octave_value_list _wrap_annDist (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNpoint arg3 = (ANNpoint) 0 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNdist result;
  
  if (!SWIG_check_num_args("annDist",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annDist" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    if (!args(2).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(2).vector_value();
    arg3=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg3[j]=p(j);
  }
  {
    try {
      result = (ANNdist)annDist(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
  annDeallocPt(arg3);
fail:
  return _out;
}


static octave_value_list _wrap_annAllocPt__SWIG_0 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNcoord arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpoint result;
  
  if (!SWIG_check_num_args("annAllocPt",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annAllocPt" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_double(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "annAllocPt" "', argument " "2"" of type '" "ANNcoord""'");
  } 
  arg2 = (ANNcoord)(val2);
  {
    try {
      result = (ANNpoint)annAllocPt(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annAllocPt__SWIG_1 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpoint result;
  
  if (!SWIG_check_num_args("annAllocPt",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annAllocPt" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    try {
      result = (ANNpoint)annAllocPt(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annAllocPt (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[2]={
    octave_value_ref(args,0),octave_value_ref(args,1)
  };
  
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_annAllocPt__SWIG_1(args, nargout);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_annAllocPt__SWIG_0(args, nargout);
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_annAllocPts (const octave_value_list& args, int nargout) {
  int arg1 ;
  int arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpointArray result;
  
  if (!SWIG_check_num_args("annAllocPts",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annAllocPts" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "annAllocPts" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    try {
      result = (ANNpointArray)annAllocPts(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annDeallocPt (const octave_value_list& args, int nargout) {
  ANNpoint *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annDeallocPt",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1, SWIGTYPE_p_p_double,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "annDeallocPt" "', argument " "1"" of type '" "ANNpoint &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "annDeallocPt" "', argument " "1"" of type '" "ANNpoint &""'"); 
  }
  arg1 = (ANNpoint *)(argp1);
  {
    try {
      annDeallocPt(*arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annDeallocPts (const octave_value_list& args, int nargout) {
  ANNpointArray *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annDeallocPts",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1, SWIGTYPE_p_p_p_double,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "annDeallocPts" "', argument " "1"" of type '" "ANNpointArray &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "annDeallocPts" "', argument " "1"" of type '" "ANNpointArray &""'"); 
  }
  arg1 = (ANNpointArray *)(argp1);
  {
    try {
      annDeallocPts(*arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annCopyPt (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpoint result;
  
  if (!SWIG_check_num_args("annCopyPt",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annCopyPt" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    try {
      result = (ANNpoint)annCopyPt(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_delete_ANNpointSet (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNpointSet",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNpointSet" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_annkSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  double arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNpointSet_annkSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_annkSearch" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  ecode6 = SWIG_AsVal_double(args(3), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ANNpointSet_annkSearch" "', argument " "6"" of type '" "double""'");
  } 
  arg6 = (double)(val6);
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_annkSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNpointSet_annkSearch",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_annkSearch" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_annkSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNpointSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          if (argc <= 3) {
            return _wrap_ANNpointSet_annkSearch__SWIG_1(args, nargout);
          }
          if (argc <= 4) {
            return _wrap_ANNpointSet_annkSearch__SWIG_1(args, nargout);
          }
          return _wrap_ANNpointSet_annkSearch__SWIG_1(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNpointSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_ANNpointSet_annkSearch__SWIG_0(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNpointSet_annkFRSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  double arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val7 ;
  int ecode7 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNpointSet_annkFRSearch",args.length(),5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_annkFRSearch" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNpointSet_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  ecode7 = SWIG_AsVal_double(args(4), &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ANNpointSet_annkFRSearch" "', argument " "7"" of type '" "double""'");
  } 
  arg7 = (double)(val7);
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6,arg7);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_annkFRSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNpointSet_annkFRSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_annkFRSearch" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNpointSet_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_annkFRSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[5]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3),octave_value_ref(args,4)
  };
  
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNpointSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            if (argc <= 4) {
              return _wrap_ANNpointSet_annkFRSearch__SWIG_1(args, nargout);
            }
            if (argc <= 5) {
              return _wrap_ANNpointSet_annkFRSearch__SWIG_1(args, nargout);
            }
            return _wrap_ANNpointSet_annkFRSearch__SWIG_1(args, nargout);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNpointSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_ANNpointSet_annkFRSearch__SWIG_0(args, nargout);
            }
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNpointSet_theDim (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNpointSet_theDim",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_theDim" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    try {
      result = (int)(arg1)->theDim();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_nPoints (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNpointSet_nPoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_nPoints" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    try {
      result = (int)(arg1)->nPoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNpointSet_thePoints (const octave_value_list& args, int nargout) {
  ANNpointSet *arg1 = (ANNpointSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpointArray result;
  
  if (!SWIG_check_num_args("ANNpointSet_thePoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNpointSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNpointSet_thePoints" "', argument " "1"" of type '" "ANNpointSet *""'"); 
  }
  arg1 = (ANNpointSet *)(argp1);
  {
    try {
      result = (ANNpointArray)(arg1)->thePoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNpointSet_members[] = {
{"annkSearch",_wrap_ANNpointSet_annkSearch,0,0,0,0},
{"annkFRSearch",_wrap_ANNpointSet_annkFRSearch,0,0,0,0},
{"theDim",_wrap_ANNpointSet_theDim,0,0,0,0},
{"nPoints",_wrap_ANNpointSet_nPoints,0,0,0,0},
{"thePoints",_wrap_ANNpointSet_thePoints,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNpointSet_base_names[] = {0};
static const swig_type_info *swig_ANNpointSet_base[] = {0};
static swig_octave_class _wrap_class_ANNpointSet = {"ANNpointSet", &SWIGTYPE_p_ANNpointSet,0,0,0,_wrap_delete_ANNpointSet,swig_ANNpointSet_members,swig_ANNpointSet_base_names,swig_ANNpointSet_base };

static octave_value_list _wrap_new_ANNbruteForce__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbruteForce *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbruteForce",args.length(),1,1,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  {
    try {
      result = (ANNbruteForce *)new ANNbruteForce(arg1,arg2,arg3,arg4);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbruteForce, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbruteForce__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbruteForce *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbruteForce",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_p_double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANNbruteForce" "', argument " "1"" of type '" "ANNpointArray""'"); 
  }
  arg1 = (ANNpointArray)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNbruteForce" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNbruteForce" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNbruteForce *)new ANNbruteForce(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbruteForce, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbruteForce (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[3]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2)
  };
  
  if (argc == 1) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    if (_v) {
      if (argc <= 1) {
        return _wrap_new_ANNbruteForce__SWIG_0(args, nargout);
      }
      if (argc <= 2) {
        return _wrap_new_ANNbruteForce__SWIG_0(args, nargout);
      }
      if (argc <= 3) {
        return _wrap_new_ANNbruteForce__SWIG_0(args, nargout);
      }
      return _wrap_new_ANNbruteForce__SWIG_0(args, nargout);
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_p_double, 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_ANNbruteForce__SWIG_1(args, nargout);
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_delete_ANNbruteForce (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNbruteForce",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNbruteForce" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_annkSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  double arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNbruteForce_annkSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_annkSearch" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  ecode6 = SWIG_AsVal_double(args(3), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ANNbruteForce_annkSearch" "', argument " "6"" of type '" "double""'");
  } 
  arg6 = (double)(val6);
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_annkSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNbruteForce_annkSearch",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_annkSearch" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_annkSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNbruteForce, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          if (argc <= 3) {
            return _wrap_ANNbruteForce_annkSearch__SWIG_1(args, nargout);
          }
          if (argc <= 4) {
            return _wrap_ANNbruteForce_annkSearch__SWIG_1(args, nargout);
          }
          return _wrap_ANNbruteForce_annkSearch__SWIG_1(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNbruteForce, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_ANNbruteForce_annkSearch__SWIG_0(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNbruteForce_annkFRSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  double arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val7 ;
  int ecode7 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNbruteForce_annkFRSearch",args.length(),5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_annkFRSearch" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNbruteForce_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  ecode7 = SWIG_AsVal_double(args(4), &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ANNbruteForce_annkFRSearch" "', argument " "7"" of type '" "double""'");
  } 
  arg7 = (double)(val7);
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6,arg7);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_annkFRSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNbruteForce_annkFRSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_annkFRSearch" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNbruteForce_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_annkFRSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[5]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3),octave_value_ref(args,4)
  };
  
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNbruteForce, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            if (argc <= 4) {
              return _wrap_ANNbruteForce_annkFRSearch__SWIG_1(args, nargout);
            }
            if (argc <= 5) {
              return _wrap_ANNbruteForce_annkFRSearch__SWIG_1(args, nargout);
            }
            return _wrap_ANNbruteForce_annkFRSearch__SWIG_1(args, nargout);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNbruteForce, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_ANNbruteForce_annkFRSearch__SWIG_0(args, nargout);
            }
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNbruteForce_theDim (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNbruteForce_theDim",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_theDim" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    try {
      result = (int)(arg1)->theDim();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_nPoints (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNbruteForce_nPoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_nPoints" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    try {
      result = (int)(arg1)->nPoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNbruteForce_thePoints (const octave_value_list& args, int nargout) {
  ANNbruteForce *arg1 = (ANNbruteForce *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpointArray result;
  
  if (!SWIG_check_num_args("ANNbruteForce_thePoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbruteForce, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNbruteForce_thePoints" "', argument " "1"" of type '" "ANNbruteForce *""'"); 
  }
  arg1 = (ANNbruteForce *)(argp1);
  {
    try {
      result = (ANNpointArray)(arg1)->thePoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNbruteForce_members[] = {
{"annkSearch",_wrap_ANNbruteForce_annkSearch,0,0,0,0},
{"annkFRSearch",_wrap_ANNbruteForce_annkFRSearch,0,0,0,0},
{"theDim",_wrap_ANNbruteForce_theDim,0,0,0,0},
{"nPoints",_wrap_ANNbruteForce_nPoints,0,0,0,0},
{"thePoints",_wrap_ANNbruteForce_thePoints,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNbruteForce_base_names[] = {"_p_ANNpointSet",0};
static const swig_type_info *swig_ANNbruteForce_base[] = {0,0};
static swig_octave_class _wrap_class_ANNbruteForce = {"ANNbruteForce", &SWIGTYPE_p_ANNbruteForce,0,_wrap_new_ANNbruteForce,0,_wrap_delete_ANNbruteForce,swig_ANNbruteForce_members,swig_ANNbruteForce_base_names,swig_ANNbruteForce_base };

static octave_value_list _wrap_ANN_N_SPLIT_RULES_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_N_SPLIT_RULES_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_N_SPLIT_RULES_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANN_N_SPLIT_RULES));
  return obj;
}


static octave_value_list _wrap_ANN_N_SHRINK_RULES_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANN_N_SHRINK_RULES_set",args.length(),1,1,0)) return octave_value_list();
  
  return octave_set_immutable(args,nargout);
}


static octave_value_list _wrap_ANN_N_SHRINK_RULES_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANN_N_SHRINK_RULES));
  return obj;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_0 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int arg2 ;
  int arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNkd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNkd_tree" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_1 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNkd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_2 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_3 (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_4 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  int arg5 ;
  ANNsplitRule arg6 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  ecode5 = SWIG_AsVal_int(args(1), &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ANNkd_tree" "', argument " "5"" of type '" "int""'");
  } 
  arg5 = (int)(val5);
  ecode6 = SWIG_AsVal_int(args(2), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ANNkd_tree" "', argument " "6"" of type '" "ANNsplitRule""'");
  } 
  arg6 = (ANNsplitRule)(val6);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_5 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  int arg5 ;
  int val5 ;
  int ecode5 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),2,2,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  ecode5 = SWIG_AsVal_int(args(1), &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ANNkd_tree" "', argument " "5"" of type '" "int""'");
  } 
  arg5 = (int)(val5);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_6 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2,arg3,arg4);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_7 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_p_double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "ANNpointArray""'"); 
  }
  arg1 = (ANNpointArray)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNkd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNkd_tree" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree__SWIG_8 (const octave_value_list& args, int nargout) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ANNkd_tree" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = (std::istream *)(argp1);
  {
    try {
      result = (ANNkd_tree *)new ANNkd_tree(*arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNkd_tree (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[3]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2)
  };
  
  if (argc == 0) {
    return _wrap_new_ANNkd_tree__SWIG_3(args, nargout);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_ANNkd_tree__SWIG_8(args, nargout);
    }
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_ANNkd_tree__SWIG_2(args, nargout);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    if (_v) {
      if (argc <= 1) {
        return _wrap_new_ANNkd_tree__SWIG_6(args, nargout);
      }
      if (argc <= 2) {
        return _wrap_new_ANNkd_tree__SWIG_6(args, nargout);
      }
      if (argc <= 3) {
        return _wrap_new_ANNkd_tree__SWIG_6(args, nargout);
      }
      return _wrap_new_ANNkd_tree__SWIG_6(args, nargout);
    }
  }
  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_ANNkd_tree__SWIG_1(args, nargout);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_ANNkd_tree__SWIG_5(args, nargout);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_p_double, 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_ANNkd_tree__SWIG_7(args, nargout);
        }
      }
    }
  }
  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_ANNkd_tree__SWIG_0(args, nargout);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    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_ANNkd_tree__SWIG_4(args, nargout);
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_delete_ANNkd_tree (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNkd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNkd_tree" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  double arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  ecode6 = SWIG_AsVal_double(args(3), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ANNkd_tree_annkSearch" "', argument " "6"" of type '" "double""'");
  } 
  arg6 = (double)(val6);
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkSearch",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  {
    try {
      (arg1)->annkSearch(arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          if (argc <= 3) {
            return _wrap_ANNkd_tree_annkSearch__SWIG_1(args, nargout);
          }
          if (argc <= 4) {
            return _wrap_ANNkd_tree_annkSearch__SWIG_1(args, nargout);
          }
          return _wrap_ANNkd_tree_annkSearch__SWIG_1(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_ANNkd_tree_annkSearch__SWIG_0(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNkd_tree_annkPriSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  double arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkPriSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkPriSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  ecode6 = SWIG_AsVal_double(args(3), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ANNkd_tree_annkPriSearch" "', argument " "6"" of type '" "double""'");
  } 
  arg6 = (double)(val6);
  {
    try {
      (arg1)->annkPriSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkPriSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  int arg3 ;
  ANNidxArray arg4 = (ANNidxArray) 0 ;
  ANNdistArray arg5 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkPriSearch",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkPriSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (!SWIG_IsOK(SWIG_AsVal_int(args(2),&arg3))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg4=new ANNidx[arg3];
  arg5=new ANNdist[arg3];
  {
    try {
      (arg1)->annkPriSearch(arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg3);
    RowVector dd(arg3);
    for (int j=0;j<arg3;++j) {
      nn_idx(j)=arg4[j];
      dd(j)=arg5[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg4;
    delete [] arg5;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkPriSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          if (argc <= 3) {
            return _wrap_ANNkd_tree_annkPriSearch__SWIG_1(args, nargout);
          }
          if (argc <= 4) {
            return _wrap_ANNkd_tree_annkPriSearch__SWIG_1(args, nargout);
          }
          return _wrap_ANNkd_tree_annkPriSearch__SWIG_1(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_scalar_type() ? 1 : 0;
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_ANNkd_tree_annkPriSearch__SWIG_0(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNkd_tree_annkFRSearch__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  double arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val7 ;
  int ecode7 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkFRSearch",args.length(),5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkFRSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNkd_tree_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  ecode7 = SWIG_AsVal_double(args(4), &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ANNkd_tree_annkFRSearch" "', argument " "7"" of type '" "double""'");
  } 
  arg7 = (double)(val7);
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6,arg7);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkFRSearch__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNdist arg3 ;
  int arg4 ;
  ANNidxArray arg5 = (ANNidxArray) 0 ;
  ANNdistArray arg6 = (ANNdistArray) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkd_tree_annkFRSearch",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_annkFRSearch" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNkd_tree_annkFRSearch" "', argument " "3"" of type '" "ANNdist""'");
  } 
  arg3 = (ANNdist)(val3);
  if (!SWIG_IsOK(SWIG_AsVal_int(args(3),&arg4))) {
    error("k must be given by integer"); SWIG_fail;
  }
  arg5=new ANNidx[arg4];
  arg6=new ANNdist[arg4];
  {
    try {
      result = (int)(arg1)->annkFRSearch(arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    RowVector nn_idx(arg4);
    RowVector dd(arg4);
    for (int j=0;j<arg4;++j) {
      nn_idx(j)=arg5[j];
      dd(j)=arg6[j];
    }
    _outp = SWIG_Octave_AppendOutput(_outp, nn_idx);
    _outp = SWIG_Octave_AppendOutput(_outp, dd);
    delete [] arg5;
    delete [] arg6;
  }
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_annkFRSearch (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[5]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3),octave_value_ref(args,4)
  };
  
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            if (argc <= 4) {
              return _wrap_ANNkd_tree_annkFRSearch__SWIG_1(args, nargout);
            }
            if (argc <= 5) {
              return _wrap_ANNkd_tree_annkFRSearch__SWIG_1(args, nargout);
            }
            return _wrap_ANNkd_tree_annkFRSearch__SWIG_1(args, nargout);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkd_tree, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = (*argv[3]).is_scalar_type() ? 1 : 0;
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_ANNkd_tree_annkFRSearch__SWIG_0(args, nargout);
            }
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNkd_tree_theDim (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkd_tree_theDim",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_theDim" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    try {
      result = (int)(arg1)->theDim();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_nPoints (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkd_tree_nPoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_nPoints" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    try {
      result = (int)(arg1)->nPoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_thePoints (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpointArray result;
  
  if (!SWIG_check_num_args("ANNkd_tree_thePoints",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_thePoints" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    try {
      result = (ANNpointArray)(arg1)->thePoints();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_Print (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNbool arg2 ;
  std::ostream *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  {
    arg3=&std::cout;
  }
  if (!SWIG_check_num_args("ANNkd_tree_Print",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_Print" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkd_tree_Print" "', argument " "2"" of type '" "ANNbool""'");
  } 
  arg2 = (ANNbool)(val2);
  {
    try {
      (arg1)->Print(arg2,*arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_Dump (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNbool arg2 ;
  std::ostream *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  {
    arg3=&std::cout;
  }
  if (!SWIG_check_num_args("ANNkd_tree_Dump",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_Dump" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkd_tree_Dump" "', argument " "2"" of type '" "ANNbool""'");
  } 
  arg2 = (ANNbool)(val2);
  {
    try {
      (arg1)->Dump(arg2,*arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkd_tree_getStats (const octave_value_list& args, int nargout) {
  ANNkd_tree *arg1 = (ANNkd_tree *) 0 ;
  ANNkdStats *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ANNkdStats tmp2 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  arg2=&tmp2;
  if (!SWIG_check_num_args("ANNkd_tree_getStats",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkd_tree, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkd_tree_getStats" "', argument " "1"" of type '" "ANNkd_tree *""'"); 
  }
  arg1 = (ANNkd_tree *)(argp1);
  {
    try {
      (arg1)->getStats(*arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    _outp = SWIG_Octave_AppendOutput(_outp, SWIG_NewPointerObj(new ANNkdStats(*arg2),SWIGTYPE_p_ANNkdStats,1));
  }
fail:
  return _out;
}


static swig_octave_member swig_ANNkd_tree_members[] = {
{"annkSearch",_wrap_ANNkd_tree_annkSearch,0,0,0,0},
{"annkPriSearch",_wrap_ANNkd_tree_annkPriSearch,0,0,0,0},
{"annkFRSearch",_wrap_ANNkd_tree_annkFRSearch,0,0,0,0},
{"theDim",_wrap_ANNkd_tree_theDim,0,0,0,0},
{"nPoints",_wrap_ANNkd_tree_nPoints,0,0,0,0},
{"thePoints",_wrap_ANNkd_tree_thePoints,0,0,0,0},
{"Print",_wrap_ANNkd_tree_Print,0,0,0,0},
{"Dump",_wrap_ANNkd_tree_Dump,0,0,0,0},
{"getStats",_wrap_ANNkd_tree_getStats,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNkd_tree_base_names[] = {"_p_ANNpointSet",0};
static const swig_type_info *swig_ANNkd_tree_base[] = {0,0};
static swig_octave_class _wrap_class_ANNkd_tree = {"ANNkd_tree", &SWIGTYPE_p_ANNkd_tree,0,_wrap_new_ANNkd_tree,0,_wrap_delete_ANNkd_tree,swig_ANNkd_tree_members,swig_ANNkd_tree_base_names,swig_ANNkd_tree_base };

static octave_value_list _wrap_new_ANNbd_tree__SWIG_0 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int arg2 ;
  int arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNbd_tree" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNbd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNbd_tree" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_1 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNbd_tree" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNbd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_2 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  int arg5 ;
  ANNsplitRule arg6 ;
  ANNshrinkRule arg7 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  int val7 ;
  int ecode7 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),4,4,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  ecode5 = SWIG_AsVal_int(args(1), &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ANNbd_tree" "', argument " "5"" of type '" "int""'");
  } 
  arg5 = (int)(val5);
  ecode6 = SWIG_AsVal_int(args(2), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ANNbd_tree" "', argument " "6"" of type '" "ANNsplitRule""'");
  } 
  arg6 = (ANNsplitRule)(val6);
  ecode7 = SWIG_AsVal_int(args(3), &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ANNbd_tree" "', argument " "7"" of type '" "ANNshrinkRule""'");
  } 
  arg7 = (ANNshrinkRule)(val7);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3,arg4,arg5,arg6,arg7);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_3 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  int arg5 ;
  ANNsplitRule arg6 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  ecode5 = SWIG_AsVal_int(args(1), &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ANNbd_tree" "', argument " "5"" of type '" "int""'");
  } 
  arg5 = (int)(val5);
  ecode6 = SWIG_AsVal_int(args(2), &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ANNbd_tree" "', argument " "6"" of type '" "ANNsplitRule""'");
  } 
  arg6 = (ANNsplitRule)(val6);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3,arg4,arg5,arg6);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_4 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  int arg5 ;
  int val5 ;
  int ecode5 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),2,2,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  ecode5 = SWIG_AsVal_int(args(1), &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ANNbd_tree" "', argument " "5"" of type '" "int""'");
  } 
  arg5 = (int)(val5);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3,arg4,arg5);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_5 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  bool arg4 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("points must be given by matrix (n x dd)"); SWIG_fail;
    }
    Matrix m=args(0).matrix_value();
    arg2=m.rows();
    arg3=m.cols();
    arg1=annAllocPts(arg2,arg3);
    for (int j=0;j<m.rows();++j)
    for (int k=0;k<m.cols();++k)
    arg1[j][k]=m(j,k);
    arg4=true;
  }
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3,arg4);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_6 (const octave_value_list& args, int nargout) {
  ANNpointArray arg1 = (ANNpointArray) 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_p_double, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANNbd_tree" "', argument " "1"" of type '" "ANNpointArray""'"); 
  }
  arg1 = (ANNpointArray)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNbd_tree" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNbd_tree" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree__SWIG_7 (const octave_value_list& args, int nargout) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbd_tree *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNbd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANNbd_tree" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ANNbd_tree" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = (std::istream *)(argp1);
  {
    try {
      result = (ANNbd_tree *)new ANNbd_tree(*arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNbd_tree, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNbd_tree (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_ANNbd_tree__SWIG_7(args, nargout);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    if (_v) {
      if (argc <= 1) {
        return _wrap_new_ANNbd_tree__SWIG_5(args, nargout);
      }
      if (argc <= 2) {
        return _wrap_new_ANNbd_tree__SWIG_5(args, nargout);
      }
      if (argc <= 3) {
        return _wrap_new_ANNbd_tree__SWIG_5(args, nargout);
      }
      return _wrap_new_ANNbd_tree__SWIG_5(args, nargout);
    }
  }
  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_ANNbd_tree__SWIG_1(args, nargout);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_ANNbd_tree__SWIG_4(args, nargout);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_p_double, 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_ANNbd_tree__SWIG_6(args, nargout);
        }
      }
    }
  }
  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_ANNbd_tree__SWIG_0(args, nargout);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    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_ANNbd_tree__SWIG_3(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = (*argv[0]).is_matrix_type() ? 1 : 0;
    }
    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_ANNbd_tree__SWIG_2(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_delete_ANNbd_tree (const octave_value_list& args, int nargout) {
  ANNbd_tree *arg1 = (ANNbd_tree *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNbd_tree",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNbd_tree, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNbd_tree" "', argument " "1"" of type '" "ANNbd_tree *""'"); 
  }
  arg1 = (ANNbd_tree *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNbd_tree_members[] = {
{0,0,0,0}
};
static const char *swig_ANNbd_tree_base_names[] = {"_p_ANNkd_tree",0};
static const swig_type_info *swig_ANNbd_tree_base[] = {0,0};
static swig_octave_class _wrap_class_ANNbd_tree = {"ANNbd_tree", &SWIGTYPE_p_ANNbd_tree,0,_wrap_new_ANNbd_tree,0,_wrap_delete_ANNbd_tree,swig_ANNbd_tree_members,swig_ANNbd_tree_base_names,swig_ANNbd_tree_base };

static octave_value_list _wrap_annMaxPtsVisit (const octave_value_list& args, int nargout) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annMaxPtsVisit",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annMaxPtsVisit" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    try {
      annMaxPtsVisit(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annClose (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annClose",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      annClose();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANN_exception_msg_set (const octave_value_list& args, int nargout) {
  ANN_exception *arg1 = (ANN_exception *) 0 ;
  std::string arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANN_exception_msg_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANN_exception, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANN_exception_msg_set" "', argument " "1"" of type '" "ANN_exception *""'"); 
  }
  arg1 = (ANN_exception *)(argp1);
  {
    res2 = SWIG_ConvertPtr(args(1), &argp2, SWIGTYPE_p_std__string,  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ANN_exception_msg_set" "', argument " "2"" of type '" "std::string""'"); 
    }  
    if (!argp2) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ANN_exception_msg_set" "', argument " "2"" of type '" "std::string""'");
    } else {
      arg2 = *((std::string *)(argp2));
    }
  }
  if (arg1) (arg1)->msg = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANN_exception_msg_get (const octave_value_list& args, int nargout) {
  ANN_exception *arg1 = (ANN_exception *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  std::string result;
  
  if (!SWIG_check_num_args("ANN_exception_msg_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANN_exception, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANN_exception_msg_get" "', argument " "1"" of type '" "ANN_exception *""'"); 
  }
  arg1 = (ANN_exception *)(argp1);
  result =  ((arg1)->msg);
  _outv = SWIG_NewPointerObj((new std::string((const std::string&)(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANN_exception (const octave_value_list& args, int nargout) {
  std::string *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANN_exception *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANN_exception",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ANN_exception" "', argument " "1"" of type '" "std::string const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ANN_exception" "', argument " "1"" of type '" "std::string const &""'"); 
  }
  arg1 = (std::string *)(argp1);
  {
    try {
      result = (ANN_exception *)new ANN_exception((std::string const &)*arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANN_exception, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_delete_ANN_exception (const octave_value_list& args, int nargout) {
  ANN_exception *arg1 = (ANN_exception *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANN_exception",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANN_exception, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANN_exception" "', argument " "1"" of type '" "ANN_exception *""'"); 
  }
  arg1 = (ANN_exception *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANN_exception_members[] = {
{"msg",0,_wrap_ANN_exception_msg_get,_wrap_ANN_exception_msg_set,0,0},
{0,0,0,0}
};
static const char *swig_ANN_exception_base_names[] = {0};
static const swig_type_info *swig_ANN_exception_base[] = {0};
static swig_octave_class _wrap_class_ANN_exception = {"ANN_exception", &SWIGTYPE_p_ANN_exception,0,_wrap_new_ANN_exception,0,_wrap_delete_ANN_exception,swig_ANN_exception_members,swig_ANN_exception_base_names,swig_ANN_exception_base };

static octave_value_list _wrap_ANNkdStats_dim_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_dim_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_dim_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_dim_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->dim = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_dim_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_dim_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_dim_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->dim);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_pts_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_n_pts_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_pts_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_n_pts_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->n_pts = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_pts_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_n_pts_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_pts_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->n_pts);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_bkt_size_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_bkt_size_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_bkt_size_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_bkt_size_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->bkt_size = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_bkt_size_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_bkt_size_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_bkt_size_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->bkt_size);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_lf_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_n_lf_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_lf_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_n_lf_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->n_lf = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_lf_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_n_lf_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_lf_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->n_lf);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_tl_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_n_tl_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_tl_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_n_tl_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->n_tl = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_tl_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_n_tl_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_tl_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->n_tl);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_spl_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_n_spl_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_spl_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_n_spl_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->n_spl = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_spl_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_n_spl_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_spl_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->n_spl);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_shr_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_n_shr_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_shr_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_n_shr_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->n_shr = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_n_shr_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_n_shr_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_n_shr_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->n_shr);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_depth_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_depth_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_depth_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_depth_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->depth = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_depth_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNkdStats_depth_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_depth_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (int) ((arg1)->depth);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_sum_ar_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  float arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  float val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_sum_ar_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_sum_ar_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_float(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_sum_ar_set" "', argument " "2"" of type '" "float""'");
  } 
  arg2 = (float)(val2);
  if (arg1) (arg1)->sum_ar = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_sum_ar_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  float result;
  
  if (!SWIG_check_num_args("ANNkdStats_sum_ar_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_sum_ar_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (float) ((arg1)->sum_ar);
  _outv = SWIG_From_float((float)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_avg_ar_set (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  float arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  float val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_avg_ar_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_avg_ar_set" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_float(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_avg_ar_set" "', argument " "2"" of type '" "float""'");
  } 
  arg2 = (float)(val2);
  if (arg1) (arg1)->avg_ar = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_avg_ar_get (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  float result;
  
  if (!SWIG_check_num_args("ANNkdStats_avg_ar_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_avg_ar_get" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  result = (float) ((arg1)->avg_ar);
  _outv = SWIG_From_float((float)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_reset__SWIG_0 (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_reset",args.length(),4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_reset" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_reset" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNkdStats_reset" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(args(3), &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ANNkdStats_reset" "', argument " "4"" of type '" "int""'");
  } 
  arg4 = (int)(val4);
  {
    try {
      (arg1)->reset(arg2,arg3,arg4);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_reset__SWIG_1 (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_reset",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_reset" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_reset" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ANNkdStats_reset" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      (arg1)->reset(arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_reset__SWIG_2 (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_reset",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_reset" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNkdStats_reset" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    try {
      (arg1)->reset(arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_reset__SWIG_3 (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNkdStats_reset",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_reset" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  {
    try {
      (arg1)->reset();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_reset (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[4]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2),octave_value_ref(args,3)
  };
  
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkdStats, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_ANNkdStats_reset__SWIG_3(args, nargout);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkdStats, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_ANNkdStats_reset__SWIG_2(args, nargout);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkdStats, 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_ANNkdStats_reset__SWIG_1(args, nargout);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ANNkdStats, 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_ANNkdStats_reset__SWIG_0(args, nargout);
          }
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_new_ANNkdStats (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNkdStats *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNkdStats",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      result = (ANNkdStats *)new ANNkdStats();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNkdStats, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNkdStats_merge (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  ANNkdStats *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ANNkdStats tmp2 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  arg2=&tmp2;
  if (!SWIG_check_num_args("ANNkdStats_merge",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNkdStats_merge" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  {
    try {
      (arg1)->merge((ANNkdStats const &)*arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  {
    _outp = SWIG_Octave_AppendOutput(_outp, SWIG_NewPointerObj(new ANNkdStats(*arg2),SWIGTYPE_p_ANNkdStats,1));
  }
fail:
  return _out;
}


static octave_value_list _wrap_delete_ANNkdStats (const octave_value_list& args, int nargout) {
  ANNkdStats *arg1 = (ANNkdStats *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNkdStats",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNkdStats, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNkdStats" "', argument " "1"" of type '" "ANNkdStats *""'"); 
  }
  arg1 = (ANNkdStats *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNkdStats_members[] = {
{"dim",0,_wrap_ANNkdStats_dim_get,_wrap_ANNkdStats_dim_set,0,0},
{"n_pts",0,_wrap_ANNkdStats_n_pts_get,_wrap_ANNkdStats_n_pts_set,0,0},
{"bkt_size",0,_wrap_ANNkdStats_bkt_size_get,_wrap_ANNkdStats_bkt_size_set,0,0},
{"n_lf",0,_wrap_ANNkdStats_n_lf_get,_wrap_ANNkdStats_n_lf_set,0,0},
{"n_tl",0,_wrap_ANNkdStats_n_tl_get,_wrap_ANNkdStats_n_tl_set,0,0},
{"n_spl",0,_wrap_ANNkdStats_n_spl_get,_wrap_ANNkdStats_n_spl_set,0,0},
{"n_shr",0,_wrap_ANNkdStats_n_shr_get,_wrap_ANNkdStats_n_shr_set,0,0},
{"depth",0,_wrap_ANNkdStats_depth_get,_wrap_ANNkdStats_depth_set,0,0},
{"sum_ar",0,_wrap_ANNkdStats_sum_ar_get,_wrap_ANNkdStats_sum_ar_set,0,0},
{"avg_ar",0,_wrap_ANNkdStats_avg_ar_get,_wrap_ANNkdStats_avg_ar_set,0,0},
{"reset",_wrap_ANNkdStats_reset,0,0,0,0},
{"merge",_wrap_ANNkdStats_merge,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNkdStats_base_names[] = {0};
static const swig_type_info *swig_ANNkdStats_base[] = {0};
static swig_octave_class _wrap_class_ANNkdStats = {"ANNkdStats", &SWIGTYPE_p_ANNkdStats,0,_wrap_new_ANNkdStats,0,_wrap_delete_ANNkdStats,swig_ANNkdStats_members,swig_ANNkdStats_base_names,swig_ANNkdStats_base };

static octave_value_list _wrap_ANNsampStat_reset (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNsampStat_reset",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_reset" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      (arg1)->reset();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNsampStat (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNsampStat *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNsampStat",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      result = (ANNsampStat *)new ANNsampStat();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNsampStat, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNsampStat_samples (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNsampStat_samples",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_samples" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      result = (int)(arg1)->samples();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNsampStat_mean (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  double result;
  
  if (!SWIG_check_num_args("ANNsampStat_mean",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_mean" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      result = (double)(arg1)->mean();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNsampStat_stdDev (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  double result;
  
  if (!SWIG_check_num_args("ANNsampStat_stdDev",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_stdDev" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      result = (double)(arg1)->stdDev();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNsampStat_min (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  double result;
  
  if (!SWIG_check_num_args("ANNsampStat_min",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_min" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      result = (double)(arg1)->min();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNsampStat_max (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  double result;
  
  if (!SWIG_check_num_args("ANNsampStat_max",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNsampStat_max" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      result = (double)(arg1)->max();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_delete_ANNsampStat (const octave_value_list& args, int nargout) {
  ANNsampStat *arg1 = (ANNsampStat *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNsampStat",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNsampStat, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNsampStat" "', argument " "1"" of type '" "ANNsampStat *""'"); 
  }
  arg1 = (ANNsampStat *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNsampStat_members[] = {
{"reset",_wrap_ANNsampStat_reset,0,0,0,0},
{"samples",_wrap_ANNsampStat_samples,0,0,0,0},
{"mean",_wrap_ANNsampStat_mean,0,0,0,0},
{"stdDev",_wrap_ANNsampStat_stdDev,0,0,0,0},
{"min",_wrap_ANNsampStat_min,0,0,0,0},
{"max",_wrap_ANNsampStat_max,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNsampStat_base_names[] = {0};
static const swig_type_info *swig_ANNsampStat_base[] = {0};
static swig_octave_class _wrap_class_ANNsampStat = {"ANNsampStat", &SWIGTYPE_p_ANNsampStat,0,_wrap_new_ANNsampStat,0,_wrap_delete_ANNsampStat,swig_ANNsampStat_members,swig_ANNsampStat_base_names,swig_ANNsampStat_base };

static octave_value_list _wrap_ann_Ndata_pts_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Ndata_pts_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Ndata_pts""' of type '""int""'");
    }
    ann_Ndata_pts = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Ndata_pts_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Ndata_pts));
  return obj;
}


static octave_value_list _wrap_ann_Nvisit_lfs_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Nvisit_lfs_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Nvisit_lfs""' of type '""int""'");
    }
    ann_Nvisit_lfs = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Nvisit_lfs_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Nvisit_lfs));
  return obj;
}


static octave_value_list _wrap_ann_Nvisit_spl_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Nvisit_spl_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Nvisit_spl""' of type '""int""'");
    }
    ann_Nvisit_spl = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Nvisit_spl_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Nvisit_spl));
  return obj;
}


static octave_value_list _wrap_ann_Nvisit_shr_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Nvisit_shr_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Nvisit_shr""' of type '""int""'");
    }
    ann_Nvisit_shr = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Nvisit_shr_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Nvisit_shr));
  return obj;
}


static octave_value_list _wrap_ann_Nvisit_pts_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Nvisit_pts_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Nvisit_pts""' of type '""int""'");
    }
    ann_Nvisit_pts = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Nvisit_pts_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Nvisit_pts));
  return obj;
}


static octave_value_list _wrap_ann_Ncoord_hts_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Ncoord_hts_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Ncoord_hts""' of type '""int""'");
    }
    ann_Ncoord_hts = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Ncoord_hts_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Ncoord_hts));
  return obj;
}


static octave_value_list _wrap_ann_Nfloat_ops_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_Nfloat_ops_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_Nfloat_ops""' of type '""int""'");
    }
    ann_Nfloat_ops = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_Nfloat_ops_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ann_Nfloat_ops));
  return obj;
}


static octave_value_list _wrap_ann_visit_lfs_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_visit_lfs_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_visit_lfs""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_visit_lfs""' of type '""ANNsampStat""'");
    } else {
      ann_visit_lfs = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_visit_lfs_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_visit_lfs), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_visit_spl_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_visit_spl_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_visit_spl""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_visit_spl""' of type '""ANNsampStat""'");
    } else {
      ann_visit_spl = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_visit_spl_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_visit_spl), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_visit_shr_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_visit_shr_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_visit_shr""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_visit_shr""' of type '""ANNsampStat""'");
    } else {
      ann_visit_shr = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_visit_shr_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_visit_shr), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_visit_nds_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_visit_nds_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_visit_nds""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_visit_nds""' of type '""ANNsampStat""'");
    } else {
      ann_visit_nds = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_visit_nds_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_visit_nds), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_visit_pts_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_visit_pts_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_visit_pts""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_visit_pts""' of type '""ANNsampStat""'");
    } else {
      ann_visit_pts = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_visit_pts_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_visit_pts), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_coord_hts_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_coord_hts_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_coord_hts""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_coord_hts""' of type '""ANNsampStat""'");
    } else {
      ann_coord_hts = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_coord_hts_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_coord_hts), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_float_ops_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_float_ops_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_float_ops""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_float_ops""' of type '""ANNsampStat""'");
    } else {
      ann_float_ops = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_float_ops_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_float_ops), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_average_err_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_average_err_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_average_err""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_average_err""' of type '""ANNsampStat""'");
    } else {
      ann_average_err = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_average_err_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_average_err), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_ann_rank_err_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ann_rank_err_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    void *argp = 0;
    int res = SWIG_ConvertPtr(args(0), &argp, SWIGTYPE_p_ANNsampStat,  0 );
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ann_rank_err""' of type '""ANNsampStat""'");
    }
    if (!argp) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ann_rank_err""' of type '""ANNsampStat""'");
    } else {
      ann_rank_err = *((ANNsampStat *)(argp));
    }
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ann_rank_err_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_NewPointerObj(SWIG_as_voidptr(&ann_rank_err), SWIGTYPE_p_ANNsampStat,  0 );
  return obj;
}


static octave_value_list _wrap_annResetStats (const octave_value_list& args, int nargout) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annResetStats",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annResetStats" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    try {
      annResetStats(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annResetCounts (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annResetCounts",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      annResetCounts();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annUpdateStats (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annUpdateStats",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      annUpdateStats();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_annPrintStats (const octave_value_list& args, int nargout) {
  ANNbool arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annPrintStats",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annPrintStats" "', argument " "1"" of type '" "ANNbool""'");
  } 
  arg1 = (ANNbool)(val1);
  {
    try {
      annPrintStats(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNmaxPtsVisited_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANNmaxPtsVisited_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ANNmaxPtsVisited""' of type '""int""'");
    }
    ANNmaxPtsVisited = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ANNmaxPtsVisited_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANNmaxPtsVisited));
  return obj;
}


static octave_value_list _wrap_ANNptsVisited_set(const octave_value_list& args,int nargout) {
  if (!SWIG_check_num_args("ANNptsVisited_set",args.length(),1,1,0)) return octave_value_list();
  
  {
    int val;
    int res = SWIG_AsVal_int(args(0), &val);
    if (!SWIG_IsOK(res)) {
      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""ANNptsVisited""' of type '""int""'");
    }
    ANNptsVisited = (int)(val);
  }
fail:
  return octave_value_list();
}


static octave_value_list _wrap_ANNptsVisited_get(const octave_value_list& args,int nargout) {
  octave_value obj;
  
  obj = SWIG_From_int((int)(ANNptsVisited));
  return obj;
}


static octave_value_list _wrap_annError (const octave_value_list& args, int nargout) {
  char *arg1 = (char *) 0 ;
  ANNerr arg2 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annError",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(args(0), &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "annError" "', argument " "1"" of type '" "char *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "annError" "', argument " "2"" of type '" "ANNerr""'");
  } 
  arg2 = (ANNerr)(val2);
  {
    try {
      annError(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
fail:
  return _out;
}


static octave_value_list _wrap_annPrintPt (const octave_value_list& args, int nargout) {
  ANNpoint arg1 = (ANNpoint) 0 ;
  int arg2 ;
  std::ostream *arg3 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  {
    arg3=&std::cout;
  }
  if (!SWIG_check_num_args("annPrintPt",args.length(),2,2,0)) {
    SWIG_fail;
  }
  {
    if (!args(0).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(0).vector_value();
    arg1=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg1[j]=p(j);
  }
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "annPrintPt" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    try {
      annPrintPt(arg1,arg2,*arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg1);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthRect_lo_set (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthRect_lo_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthRect_lo_set" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (arg1) (arg1)->lo = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthRect_lo_get (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpoint result;
  
  if (!SWIG_check_num_args("ANNorthRect_lo_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthRect_lo_get" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  result = (ANNpoint) ((arg1)->lo);
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthRect_hi_set (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthRect_hi_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthRect_hi_set" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  if (arg1) (arg1)->hi = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthRect_hi_get (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNpoint result;
  
  if (!SWIG_check_num_args("ANNorthRect_hi_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthRect_hi_get" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  result = (ANNpoint) ((arg1)->hi);
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect__SWIG_0 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNcoord arg2 ;
  ANNcoord arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthRect *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthRect",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_double(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNorthRect" "', argument " "2"" of type '" "ANNcoord""'");
  } 
  arg2 = (ANNcoord)(val2);
  ecode3 = SWIG_AsVal_double(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNorthRect" "', argument " "3"" of type '" "ANNcoord""'");
  } 
  arg3 = (ANNcoord)(val3);
  {
    try {
      result = (ANNorthRect *)new ANNorthRect(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthRect, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect__SWIG_1 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNcoord arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthRect *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthRect",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_double(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNorthRect" "', argument " "2"" of type '" "ANNcoord""'");
  } 
  arg2 = (ANNcoord)(val2);
  {
    try {
      result = (ANNorthRect *)new ANNorthRect(arg1,arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthRect, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect__SWIG_2 (const octave_value_list& args, int nargout) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthRect *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthRect",args.length(),1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    try {
      result = (ANNorthRect *)new ANNorthRect(arg1);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthRect, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect__SWIG_3 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNorthRect *arg2 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthRect *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthRect",args.length(),2,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  res2 = SWIG_ConvertPtr(args(1), &argp2, SWIGTYPE_p_ANNorthRect,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ANNorthRect" "', argument " "2"" of type '" "ANNorthRect const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ANNorthRect" "', argument " "2"" of type '" "ANNorthRect const &""'"); 
  }
  arg2 = (ANNorthRect *)(argp2);
  {
    try {
      result = (ANNorthRect *)new ANNorthRect(arg1,(ANNorthRect const &)*arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthRect, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect__SWIG_4 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  ANNpoint arg3 = (ANNpoint) 0 ;
  int val1 ;
  int ecode1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthRect *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthRect",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    if (!args(2).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(2).vector_value();
    arg3=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg3[j]=p(j);
  }
  {
    try {
      result = (ANNorthRect *)new ANNorthRect(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthRect, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
  annDeallocPt(arg3);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthRect (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[3]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2)
  };
  
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_ANNorthRect__SWIG_2(args, nargout);
    }
  }
  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_ANNorthRect, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_ANNorthRect__SWIG_3(args, nargout);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_ANNorthRect__SWIG_1(args, nargout);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = (*argv[1]).is_matrix_type() ? 1 : 0;
      }
      if (_v) {
        {
          _v = (*argv[2]).is_matrix_type() ? 1 : 0;
        }
        if (_v) {
          return _wrap_new_ANNorthRect__SWIG_4(args, nargout);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _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) {
          return _wrap_new_ANNorthRect__SWIG_0(args, nargout);
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_delete_ANNorthRect (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNorthRect",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNorthRect" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthRect_inside (const octave_value_list& args, int nargout) {
  ANNorthRect *arg1 = (ANNorthRect *) 0 ;
  int arg2 ;
  ANNpoint arg3 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbool result;
  
  if (!SWIG_check_num_args("ANNorthRect_inside",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthRect, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthRect_inside" "', argument " "1"" of type '" "ANNorthRect *""'"); 
  }
  arg1 = (ANNorthRect *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthRect_inside" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    if (!args(2).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(2).vector_value();
    arg3=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg3[j]=p(j);
  }
  {
    try {
      result = (ANNbool)(arg1)->inside(arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg3);
fail:
  return _out;
}


static swig_octave_member swig_ANNorthRect_members[] = {
{"lo",0,_wrap_ANNorthRect_lo_get,_wrap_ANNorthRect_lo_set,0,0},
{"hi",0,_wrap_ANNorthRect_hi_get,_wrap_ANNorthRect_hi_set,0,0},
{"inside",_wrap_ANNorthRect_inside,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNorthRect_base_names[] = {0};
static const swig_type_info *swig_ANNorthRect_base[] = {0};
static swig_octave_class _wrap_class_ANNorthRect = {"ANNorthRect", &SWIGTYPE_p_ANNorthRect,0,_wrap_new_ANNorthRect,0,_wrap_delete_ANNorthRect,swig_ANNorthRect_members,swig_ANNorthRect_base_names,swig_ANNorthRect_base };

static octave_value_list _wrap_annAssignRect (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNorthRect *arg2 = 0 ;
  ANNorthRect *arg3 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("annAssignRect",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "annAssignRect" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  res2 = SWIG_ConvertPtr(args(1), &argp2, SWIGTYPE_p_ANNorthRect,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "annAssignRect" "', argument " "2"" of type '" "ANNorthRect &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "annAssignRect" "', argument " "2"" of type '" "ANNorthRect &""'"); 
  }
  arg2 = (ANNorthRect *)(argp2);
  res3 = SWIG_ConvertPtr(args(2), &argp3, SWIGTYPE_p_ANNorthRect,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "annAssignRect" "', argument " "3"" of type '" "ANNorthRect const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "annAssignRect" "', argument " "3"" of type '" "ANNorthRect const &""'"); 
  }
  arg3 = (ANNorthRect *)(argp3);
  {
    try {
      annAssignRect(arg1,*arg2,(ANNorthRect const &)*arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_cd_set (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_cd_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_cd_set" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthHalfSpace_cd_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->cd = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_cd_get (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_cd_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_cd_get" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  result = (int) ((arg1)->cd);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_cv_set (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  ANNcoord arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_cv_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_cv_set" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  ecode2 = SWIG_AsVal_double(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthHalfSpace_cv_set" "', argument " "2"" of type '" "ANNcoord""'");
  } 
  arg2 = (ANNcoord)(val2);
  if (arg1) (arg1)->cv = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_cv_get (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNcoord result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_cv_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_cv_get" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  result = (ANNcoord) ((arg1)->cv);
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_sd_set (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_sd_set",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_sd_set" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthHalfSpace_sd_set" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->sd = arg2;
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_sd_get (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  int result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_sd_get",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_sd_get" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  result = (int) ((arg1)->sd);
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthHalfSpace__SWIG_0 (const octave_value_list& args, int nargout) {
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthHalfSpace *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthHalfSpace",args.length(),0,0,0)) {
    SWIG_fail;
  }
  {
    try {
      result = (ANNorthHalfSpace *)new ANNorthHalfSpace();;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthHalfSpace, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthHalfSpace__SWIG_1 (const octave_value_list& args, int nargout) {
  int arg1 ;
  ANNcoord arg2 ;
  int arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNorthHalfSpace *result = 0 ;
  
  if (!SWIG_check_num_args("new_ANNorthHalfSpace",args.length(),3,3,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(args(0), &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ANNorthHalfSpace" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = (int)(val1);
  ecode2 = SWIG_AsVal_double(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ANNorthHalfSpace" "', argument " "2"" of type '" "ANNcoord""'");
  } 
  arg2 = (ANNcoord)(val2);
  ecode3 = SWIG_AsVal_int(args(2), &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ANNorthHalfSpace" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = (int)(val3);
  {
    try {
      result = (ANNorthHalfSpace *)new ANNorthHalfSpace(arg1,arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ANNorthHalfSpace, 1 |  0 );
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_new_ANNorthHalfSpace (const octave_value_list& args, int nargout) {
  int argc = args.length();
  octave_value_ref argv[3]={
    octave_value_ref(args,0),octave_value_ref(args,1),octave_value_ref(args,2)
  };
  
  if (argc == 0) {
    return _wrap_new_ANNorthHalfSpace__SWIG_0(args, nargout);
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(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_ANNorthHalfSpace__SWIG_1(args, nargout);
        }
      }
    }
  }
  
  error("No matching function for overload");
  return octave_value_list();
}


static octave_value_list _wrap_ANNorthHalfSpace_in (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbool result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_in",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_in" "', argument " "1"" of type '" "ANNorthHalfSpace const *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    try {
      result = (ANNbool)((ANNorthHalfSpace const *)arg1)->in(arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_out (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNbool result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_out",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_out" "', argument " "1"" of type '" "ANNorthHalfSpace const *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    try {
      result = (ANNbool)((ANNorthHalfSpace const *)arg1)->out(arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_int((int)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_dist (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  ANNpoint arg2 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  ANNdist result;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_dist",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_dist" "', argument " "1"" of type '" "ANNorthHalfSpace const *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  {
    if (!args(1).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(1).vector_value();
    arg2=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg2[j]=p(j);
  }
  {
    try {
      result = (ANNdist)((ANNorthHalfSpace const *)arg1)->dist(arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = SWIG_From_double((double)(result));
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg2);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_setLowerBound (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  int arg2 ;
  ANNpoint arg3 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_setLowerBound",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_setLowerBound" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthHalfSpace_setLowerBound" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    if (!args(2).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(2).vector_value();
    arg3=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg3[j]=p(j);
  }
  {
    try {
      (arg1)->setLowerBound(arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg3);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_setUpperBound (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  int arg2 ;
  ANNpoint arg3 = (ANNpoint) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_setUpperBound",args.length(),3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_setUpperBound" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  ecode2 = SWIG_AsVal_int(args(1), &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ANNorthHalfSpace_setUpperBound" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    if (!args(2).is_matrix_type()) {
      error("point must be given by matrix (1 x dim or dim x 1)"); SWIG_fail;
    }
    Array<double> p=args(2).vector_value();
    arg3=annAllocPt(p.numel());
    for (int j=0;j<p.numel();++j)
    arg3[j]=p(j);
  }
  {
    try {
      (arg1)->setUpperBound(arg2,arg3);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
  annDeallocPt(arg3);
fail:
  return _out;
}


static octave_value_list _wrap_ANNorthHalfSpace_project (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  ANNpoint *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("ANNorthHalfSpace_project",args.length(),2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ANNorthHalfSpace_project" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  res2 = SWIG_ConvertPtr(args(1), &argp2, SWIGTYPE_p_p_double,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ANNorthHalfSpace_project" "', argument " "2"" of type '" "ANNpoint &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ANNorthHalfSpace_project" "', argument " "2"" of type '" "ANNpoint &""'"); 
  }
  arg2 = (ANNpoint *)(argp2);
  {
    try {
      (arg1)->project(*arg2);;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static octave_value_list _wrap_delete_ANNorthHalfSpace (const octave_value_list& args, int nargout) {
  ANNorthHalfSpace *arg1 = (ANNorthHalfSpace *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  octave_value_list _out;
  octave_value_list *_outp=&_out;
  octave_value _outv;
  
  if (!SWIG_check_num_args("delete_ANNorthHalfSpace",args.length(),1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(args(0), &argp1,SWIGTYPE_p_ANNorthHalfSpace, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ANNorthHalfSpace" "', argument " "1"" of type '" "ANNorthHalfSpace *""'"); 
  }
  arg1 = (ANNorthHalfSpace *)(argp1);
  {
    try {
      delete arg1;;
    } catch (ANN_exception& e) {
      error("ANN fatal error: %s",e.msg.c_str());
    }
  }
  _outv = octave_value();
  if (_outv.is_defined()) _outp = SWIG_Octave_AppendOutput(_outp, _outv);
fail:
  return _out;
}


static swig_octave_member swig_ANNorthHalfSpace_members[] = {
{"cd",0,_wrap_ANNorthHalfSpace_cd_get,_wrap_ANNorthHalfSpace_cd_set,0,0},
{"cv",0,_wrap_ANNorthHalfSpace_cv_get,_wrap_ANNorthHalfSpace_cv_set,0,0},
{"sd",0,_wrap_ANNorthHalfSpace_sd_get,_wrap_ANNorthHalfSpace_sd_set,0,0},
{"in",_wrap_ANNorthHalfSpace_in,0,0,0,0},
{"out",_wrap_ANNorthHalfSpace_out,0,0,0,0},
{"dist",_wrap_ANNorthHalfSpace_dist,0,0,0,0},
{"setLowerBound",_wrap_ANNorthHalfSpace_setLowerBound,0,0,0,0},
{"setUpperBound",_wrap_ANNorthHalfSpace_setUpperBound,0,0,0,0},
{"project",_wrap_ANNorthHalfSpace_project,0,0,0,0},
{0,0,0,0}
};
static const char *swig_ANNorthHalfSpace_base_names[] = {0};
static const swig_type_info *swig_ANNorthHalfSpace_base[] = {0};
static swig_octave_class _wrap_class_ANNorthHalfSpace = {"ANNorthHalfSpace", &SWIGTYPE_p_ANNorthHalfSpace,0,_wrap_new_ANNorthHalfSpace,0,_wrap_delete_ANNorthHalfSpace,swig_ANNorthHalfSpace_members,swig_ANNorthHalfSpace_base_names,swig_ANNorthHalfSpace_base };


static const struct swig_octave_member swig_globals[] = {
{"ANN_DBL_MAX",0,_wrap_ANN_DBL_MAX_get,_wrap_ANN_DBL_MAX_set,2,0},
{"ANN_NULL_IDX",0,_wrap_ANN_NULL_IDX_get,_wrap_ANN_NULL_IDX_set,2,0},
{"ANN_DIST_INF",0,_wrap_ANN_DIST_INF_get,_wrap_ANN_DIST_INF_set,2,0},
{"ANNcoordPrec",0,_wrap_ANNcoordPrec_get,_wrap_ANNcoordPrec_set,2,0},
{"ANN_ALLOW_SELF_MATCH",0,_wrap_ANN_ALLOW_SELF_MATCH_get,_wrap_ANN_ALLOW_SELF_MATCH_set,2,0},
{"annDist",_wrap_annDist,0,0,2,0},
{"annAllocPt",_wrap_annAllocPt,0,0,2,0},
{"annAllocPts",_wrap_annAllocPts,0,0,2,0},
{"annDeallocPt",_wrap_annDeallocPt,0,0,2,0},
{"annDeallocPts",_wrap_annDeallocPts,0,0,2,0},
{"annCopyPt",_wrap_annCopyPt,0,0,2,0},
{"delete_ANNpointSet",_wrap_delete_ANNpointSet,0,0,2,0},
{"ANNpointSet_annkSearch",_wrap_ANNpointSet_annkSearch,0,0,2,0},
{"ANNpointSet_annkFRSearch",_wrap_ANNpointSet_annkFRSearch,0,0,2,0},
{"ANNpointSet_theDim",_wrap_ANNpointSet_theDim,0,0,2,0},
{"ANNpointSet_nPoints",_wrap_ANNpointSet_nPoints,0,0,2,0},
{"ANNpointSet_thePoints",_wrap_ANNpointSet_thePoints,0,0,2,0},
{"new_ANNbruteForce",_wrap_new_ANNbruteForce,0,0,2,0},
{"delete_ANNbruteForce",_wrap_delete_ANNbruteForce,0,0,2,0},
{"ANNbruteForce_annkSearch",_wrap_ANNbruteForce_annkSearch,0,0,2,0},
{"ANNbruteForce_annkFRSearch",_wrap_ANNbruteForce_annkFRSearch,0,0,2,0},
{"ANNbruteForce_theDim",_wrap_ANNbruteForce_theDim,0,0,2,0},
{"ANNbruteForce_nPoints",_wrap_ANNbruteForce_nPoints,0,0,2,0},
{"ANNbruteForce_thePoints",_wrap_ANNbruteForce_thePoints,0,0,2,0},
{"ANN_N_SPLIT_RULES",0,_wrap_ANN_N_SPLIT_RULES_get,_wrap_ANN_N_SPLIT_RULES_set,2,0},
{"ANN_N_SHRINK_RULES",0,_wrap_ANN_N_SHRINK_RULES_get,_wrap_ANN_N_SHRINK_RULES_set,2,0},
{"new_ANNkd_tree",_wrap_new_ANNkd_tree,0,0,2,0},
{"delete_ANNkd_tree",_wrap_delete_ANNkd_tree,0,0,2,0},
{"ANNkd_tree_annkSearch",_wrap_ANNkd_tree_annkSearch,0,0,2,0},
{"ANNkd_tree_annkPriSearch",_wrap_ANNkd_tree_annkPriSearch,0,0,2,0},
{"ANNkd_tree_annkFRSearch",_wrap_ANNkd_tree_annkFRSearch,0,0,2,0},
{"ANNkd_tree_theDim",_wrap_ANNkd_tree_theDim,0,0,2,0},
{"ANNkd_tree_nPoints",_wrap_ANNkd_tree_nPoints,0,0,2,0},
{"ANNkd_tree_thePoints",_wrap_ANNkd_tree_thePoints,0,0,2,0},
{"ANNkd_tree_Print",_wrap_ANNkd_tree_Print,0,0,2,0},
{"ANNkd_tree_Dump",_wrap_ANNkd_tree_Dump,0,0,2,0},
{"ANNkd_tree_getStats",_wrap_ANNkd_tree_getStats,0,0,2,0},
{"new_ANNbd_tree",_wrap_new_ANNbd_tree,0,0,2,0},
{"delete_ANNbd_tree",_wrap_delete_ANNbd_tree,0,0,2,0},
{"annMaxPtsVisit",_wrap_annMaxPtsVisit,0,0,2,0},
{"annClose",_wrap_annClose,0,0,2,0},
{"ANN_exception_msg_set",_wrap_ANN_exception_msg_set,0,0,2,0},
{"ANN_exception_msg_get",_wrap_ANN_exception_msg_get,0,0,2,0},
{"new_ANN_exception",_wrap_new_ANN_exception,0,0,2,0},
{"delete_ANN_exception",_wrap_delete_ANN_exception,0,0,2,0},
{"ANNkdStats_dim_set",_wrap_ANNkdStats_dim_set,0,0,2,0},
{"ANNkdStats_dim_get",_wrap_ANNkdStats_dim_get,0,0,2,0},
{"ANNkdStats_n_pts_set",_wrap_ANNkdStats_n_pts_set,0,0,2,0},
{"ANNkdStats_n_pts_get",_wrap_ANNkdStats_n_pts_get,0,0,2,0},
{"ANNkdStats_bkt_size_set",_wrap_ANNkdStats_bkt_size_set,0,0,2,0},
{"ANNkdStats_bkt_size_get",_wrap_ANNkdStats_bkt_size_get,0,0,2,0},
{"ANNkdStats_n_lf_set",_wrap_ANNkdStats_n_lf_set,0,0,2,0},
{"ANNkdStats_n_lf_get",_wrap_ANNkdStats_n_lf_get,0,0,2,0},
{"ANNkdStats_n_tl_set",_wrap_ANNkdStats_n_tl_set,0,0,2,0},
{"ANNkdStats_n_tl_get",_wrap_ANNkdStats_n_tl_get,0,0,2,0},
{"ANNkdStats_n_spl_set",_wrap_ANNkdStats_n_spl_set,0,0,2,0},
{"ANNkdStats_n_spl_get",_wrap_ANNkdStats_n_spl_get,0,0,2,0},
{"ANNkdStats_n_shr_set",_wrap_ANNkdStats_n_shr_set,0,0,2,0},
{"ANNkdStats_n_shr_get",_wrap_ANNkdStats_n_shr_get,0,0,2,0},
{"ANNkdStats_depth_set",_wrap_ANNkdStats_depth_set,0,0,2,0},
{"ANNkdStats_depth_get",_wrap_ANNkdStats_depth_get,0,0,2,0},
{"ANNkdStats_sum_ar_set",_wrap_ANNkdStats_sum_ar_set,0,0,2,0},
{"ANNkdStats_sum_ar_get",_wrap_ANNkdStats_sum_ar_get,0,0,2,0},
{"ANNkdStats_avg_ar_set",_wrap_ANNkdStats_avg_ar_set,0,0,2,0},
{"ANNkdStats_avg_ar_get",_wrap_ANNkdStats_avg_ar_get,0,0,2,0},
{"ANNkdStats_reset",_wrap_ANNkdStats_reset,0,0,2,0},
{"new_ANNkdStats",_wrap_new_ANNkdStats,0,0,2,0},
{"ANNkdStats_merge",_wrap_ANNkdStats_merge,0,0,2,0},
{"delete_ANNkdStats",_wrap_delete_ANNkdStats,0,0,2,0},
{"ANNsampStat_reset",_wrap_ANNsampStat_reset,0,0,2,0},
{"new_ANNsampStat",_wrap_new_ANNsampStat,0,0,2,0},
{"ANNsampStat_samples",_wrap_ANNsampStat_samples,0,0,2,0},
{"ANNsampStat_mean",_wrap_ANNsampStat_mean,0,0,2,0},
{"ANNsampStat_stdDev",_wrap_ANNsampStat_stdDev,0,0,2,0},
{"ANNsampStat_min",_wrap_ANNsampStat_min,0,0,2,0},
{"ANNsampStat_max",_wrap_ANNsampStat_max,0,0,2,0},
{"delete_ANNsampStat",_wrap_delete_ANNsampStat,0,0,2,0},
{"ann_Ndata_pts",0,_wrap_ann_Ndata_pts_get,_wrap_ann_Ndata_pts_set,2,0},
{"ann_Nvisit_lfs",0,_wrap_ann_Nvisit_lfs_get,_wrap_ann_Nvisit_lfs_set,2,0},
{"ann_Nvisit_spl",0,_wrap_ann_Nvisit_spl_get,_wrap_ann_Nvisit_spl_set,2,0},
{"ann_Nvisit_shr",0,_wrap_ann_Nvisit_shr_get,_wrap_ann_Nvisit_shr_set,2,0},
{"ann_Nvisit_pts",0,_wrap_ann_Nvisit_pts_get,_wrap_ann_Nvisit_pts_set,2,0},
{"ann_Ncoord_hts",0,_wrap_ann_Ncoord_hts_get,_wrap_ann_Ncoord_hts_set,2,0},
{"ann_Nfloat_ops",0,_wrap_ann_Nfloat_ops_get,_wrap_ann_Nfloat_ops_set,2,0},
{"ann_visit_lfs",0,_wrap_ann_visit_lfs_get,_wrap_ann_visit_lfs_set,2,0},
{"ann_visit_spl",0,_wrap_ann_visit_spl_get,_wrap_ann_visit_spl_set,2,0},
{"ann_visit_shr",0,_wrap_ann_visit_shr_get,_wrap_ann_visit_shr_set,2,0},
{"ann_visit_nds",0,_wrap_ann_visit_nds_get,_wrap_ann_visit_nds_set,2,0},
{"ann_visit_pts",0,_wrap_ann_visit_pts_get,_wrap_ann_visit_pts_set,2,0},
{"ann_coord_hts",0,_wrap_ann_coord_hts_get,_wrap_ann_coord_hts_set,2,0},
{"ann_float_ops",0,_wrap_ann_float_ops_get,_wrap_ann_float_ops_set,2,0},
{"ann_average_err",0,_wrap_ann_average_err_get,_wrap_ann_average_err_set,2,0},
{"ann_rank_err",0,_wrap_ann_rank_err_get,_wrap_ann_rank_err_set,2,0},
{"annResetStats",_wrap_annResetStats,0,0,2,0},
{"annResetCounts",_wrap_annResetCounts,0,0,2,0},
{"annUpdateStats",_wrap_annUpdateStats,0,0,2,0},
{"annPrintStats",_wrap_annPrintStats,0,0,2,0},
{"ANNmaxPtsVisited",0,_wrap_ANNmaxPtsVisited_get,_wrap_ANNmaxPtsVisited_set,2,0},
{"ANNptsVisited",0,_wrap_ANNptsVisited_get,_wrap_ANNptsVisited_set,2,0},
{"annError",_wrap_annError,0,0,2,0},
{"annPrintPt",_wrap_annPrintPt,0,0,2,0},
{"ANNorthRect_lo_set",_wrap_ANNorthRect_lo_set,0,0,2,0},
{"ANNorthRect_lo_get",_wrap_ANNorthRect_lo_get,0,0,2,0},
{"ANNorthRect_hi_set",_wrap_ANNorthRect_hi_set,0,0,2,0},
{"ANNorthRect_hi_get",_wrap_ANNorthRect_hi_get,0,0,2,0},
{"new_ANNorthRect",_wrap_new_ANNorthRect,0,0,2,0},
{"delete_ANNorthRect",_wrap_delete_ANNorthRect,0,0,2,0},
{"ANNorthRect_inside",_wrap_ANNorthRect_inside,0,0,2,0},
{"annAssignRect",_wrap_annAssignRect,0,0,2,0},
{"ANNorthHalfSpace_cd_set",_wrap_ANNorthHalfSpace_cd_set,0,0,2,0},
{"ANNorthHalfSpace_cd_get",_wrap_ANNorthHalfSpace_cd_get,0,0,2,0},
{"ANNorthHalfSpace_cv_set",_wrap_ANNorthHalfSpace_cv_set,0,0,2,0},
{"ANNorthHalfSpace_cv_get",_wrap_ANNorthHalfSpace_cv_get,0,0,2,0},
{"ANNorthHalfSpace_sd_set",_wrap_ANNorthHalfSpace_sd_set,0,0,2,0},
{"ANNorthHalfSpace_sd_get",_wrap_ANNorthHalfSpace_sd_get,0,0,2,0},
{"new_ANNorthHalfSpace",_wrap_new_ANNorthHalfSpace,0,0,2,0},
{"ANNorthHalfSpace_in",_wrap_ANNorthHalfSpace_in,0,0,2,0},
{"ANNorthHalfSpace_out",_wrap_ANNorthHalfSpace_out,0,0,2,0},
{"ANNorthHalfSpace_dist",_wrap_ANNorthHalfSpace_dist,0,0,2,0},
{"ANNorthHalfSpace_setLowerBound",_wrap_ANNorthHalfSpace_setLowerBound,0,0,2,0},
{"ANNorthHalfSpace_setUpperBound",_wrap_ANNorthHalfSpace_setUpperBound,0,0,2,0},
{"ANNorthHalfSpace_project",_wrap_ANNorthHalfSpace_project,0,0,2,0},
{"delete_ANNorthHalfSpace",_wrap_delete_ANNorthHalfSpace,0,0,2,0},
{0,0,0,0,0}
};

/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static void *_p_ANNbd_treeTo_p_ANNkd_tree(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((ANNkd_tree *)  ((ANNbd_tree *) x));
}
static void *_p_ANNbruteForceTo_p_ANNpointSet(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((ANNpointSet *)  ((ANNbruteForce *) x));
}
static void *_p_ANNkd_treeTo_p_ANNpointSet(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((ANNpointSet *)  ((ANNkd_tree *) x));
}
static void *_p_ANNbd_treeTo_p_ANNpointSet(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((ANNpointSet *) (ANNkd_tree *) ((ANNbd_tree *) x));
}
static swig_type_info _swigt__p_ANN_exception = {"_p_ANN_exception", "ANN_exception *", 0, 0, (void*)&_wrap_class_ANN_exception, 0};
static swig_type_info _swigt__p_ANNbd_tree = {"_p_ANNbd_tree", "ANNbd_tree *", 0, 0, (void*)&_wrap_class_ANNbd_tree, 0};
static swig_type_info _swigt__p_ANNbruteForce = {"_p_ANNbruteForce", "ANNbruteForce *", 0, 0, (void*)&_wrap_class_ANNbruteForce, 0};
static swig_type_info _swigt__p_ANNkdStats = {"_p_ANNkdStats", "ANNkdStats *", 0, 0, (void*)&_wrap_class_ANNkdStats, 0};
static swig_type_info _swigt__p_ANNkd_tree = {"_p_ANNkd_tree", "ANNkd_tree *", 0, 0, (void*)&_wrap_class_ANNkd_tree, 0};
static swig_type_info _swigt__p_ANNorthHalfSpace = {"_p_ANNorthHalfSpace", "ANNorthHalfSpace *", 0, 0, (void*)&_wrap_class_ANNorthHalfSpace, 0};
static swig_type_info _swigt__p_ANNorthRect = {"_p_ANNorthRect", "ANNorthRect *", 0, 0, (void*)&_wrap_class_ANNorthRect, 0};
static swig_type_info _swigt__p_ANNpointSet = {"_p_ANNpointSet", "ANNpointSet *", 0, 0, (void*)&_wrap_class_ANNpointSet, 0};
static swig_type_info _swigt__p_ANNsampStat = {"_p_ANNsampStat", "ANNsampStat *", 0, 0, (void*)&_wrap_class_ANNsampStat, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "ANNdist *|ANNpoint|double *|ANNcoord *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *|ANNidx *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_double = {"_p_p_double", "ANNpoint *|ANNpointArray|double **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_p_double = {"_p_p_p_double", "ANNpointArray *|double ***", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__istream = {"_p_std__istream", "std::istream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_ANN_exception,
  &_swigt__p_ANNbd_tree,
  &_swigt__p_ANNbruteForce,
  &_swigt__p_ANNkdStats,
  &_swigt__p_ANNkd_tree,
  &_swigt__p_ANNorthHalfSpace,
  &_swigt__p_ANNorthRect,
  &_swigt__p_ANNpointSet,
  &_swigt__p_ANNsampStat,
  &_swigt__p_char,
  &_swigt__p_double,
  &_swigt__p_int,
  &_swigt__p_p_double,
  &_swigt__p_p_p_double,
  &_swigt__p_std__istream,
  &_swigt__p_std__ostream,
  &_swigt__p_std__string,
};

static swig_cast_info _swigc__p_ANN_exception[] = {  {&_swigt__p_ANN_exception, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNbd_tree[] = {  {&_swigt__p_ANNbd_tree, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNbruteForce[] = {  {&_swigt__p_ANNbruteForce, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNkdStats[] = {  {&_swigt__p_ANNkdStats, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNkd_tree[] = {  {&_swigt__p_ANNkd_tree, 0, 0, 0},  {&_swigt__p_ANNbd_tree, _p_ANNbd_treeTo_p_ANNkd_tree, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNorthHalfSpace[] = {  {&_swigt__p_ANNorthHalfSpace, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNorthRect[] = {  {&_swigt__p_ANNorthRect, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNpointSet[] = {  {&_swigt__p_ANNpointSet, 0, 0, 0},  {&_swigt__p_ANNbruteForce, _p_ANNbruteForceTo_p_ANNpointSet, 0, 0},  {&_swigt__p_ANNkd_tree, _p_ANNkd_treeTo_p_ANNpointSet, 0, 0},  {&_swigt__p_ANNbd_tree, _p_ANNbd_treeTo_p_ANNpointSet, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ANNsampStat[] = {  {&_swigt__p_ANNsampStat, 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_double[] = {  {&_swigt__p_double, 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_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_p_double[] = {  {&_swigt__p_p_p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__istream[] = {  {&_swigt__p_std__istream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__ostream[] = {  {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__string[] = {  {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_ANN_exception,
  _swigc__p_ANNbd_tree,
  _swigc__p_ANNbruteForce,
  _swigc__p_ANNkdStats,
  _swigc__p_ANNkd_tree,
  _swigc__p_ANNorthHalfSpace,
  _swigc__p_ANNorthRect,
  _swigc__p_ANNpointSet,
  _swigc__p_ANNsampStat,
  _swigc__p_char,
  _swigc__p_double,
  _swigc__p_int,
  _swigc__p_p_double,
  _swigc__p_p_p_double,
  _swigc__p_std__istream,
  _swigc__p_std__ostream,
  _swigc__p_std__string,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* -----------------------------------------------------------------------------
 * 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 staticly 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 found, init;

  clientdata = clientdata;

  /* 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);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpeters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#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



static void SWIG_init_user(octave_swig_type* module_ns);

DEFUN_DLD (SWIG_name,args,nargout,SWIG_name_d) {
  static bool already_init=false;
  if (already_init)
    return octave_value_list();
  already_init=true;

  octave_swig_ref::register_type();
  octave_swig_packed::register_type();
  SWIG_InitializeModule(0);
  SWIG_PropagateClientData();
  
  install_builtin_function(swig_type,"swig_type",std::string());
  install_builtin_function(swig_typequery,"swig_typequery",std::string());
  install_builtin_function(swig_this,"swig_this",std::string());
  install_builtin_function(swig_subclass,"subclass",std::string());

  bool global_option=true; // * swig cli option should control this default
  for (int j=0;j<args.length();++j)
    if (args(j).is_string()&&args(j).string_value()=="noglobal")
      global_option=true;
    else if (args(j).is_string()&&args(j).string_value()=="noglobal")
      global_option=false;

  octave_swig_type* cvar_ns=new octave_swig_type;
  for (int j=0;swig_globals[j].name;++j)
    if (swig_globals[j].get_method)
      cvar_ns->assign(swig_globals[j].name,&swig_globals[j]);

  octave_swig_type* module_ns=new octave_swig_type(0, 0, 0, true);
  module_ns->assign("cvar",Swig::swig_value_ref(cvar_ns));
  for (int j=0;swig_globals[j].name;++j)
    if (swig_globals[j].method)
      module_ns->assign(swig_globals[j].name,&swig_globals[j]);

  // * need better solution here; swig_type -> octave_class mapping is 
  // * really n-to-1, in some cases such as template partial spec, etc. 
  // * see failing tests.
  for (int j=0;swig_types[j];++j)
    if (swig_types[j]->clientdata) {
      swig_octave_class* c=(swig_octave_class*)swig_types[j]->clientdata;
      module_ns->assign(c->name,
                  Swig::swig_value_ref
                  (new octave_swig_type(0,swig_types[j])));
    }

  SWIG_init_user(module_ns);

  SWIG_InstallOps(octave_swig_ref::static_type_id());

  // the incref is necessary so install_global doesn't destroy module_ns,
  // as it would if it installed something with the same name as the module.
  module_ns->incref();
  if (global_option)
    module_ns->install_global();
  module_ns->decref();

  link_to_global_variable(curr_sym_tab->lookup(SWIG_name_d,true));
  set_global_value(SWIG_name_d,Swig::swig_value_ref(module_ns));

  return octave_value_list();
}


static void SWIG_init_user(octave_swig_type* module_ns)
{
  SWIG_Octave_SetConstant(module_ns,"ANNversion",SWIG_FromCharPtr("1.1.1"));
  SWIG_Octave_SetConstant(module_ns,"ANNversionCmt",SWIG_FromCharPtr(""));
  SWIG_Octave_SetConstant(module_ns,"ANNcopyright",SWIG_FromCharPtr("David M. Mount and Sunil Arya"));
  SWIG_Octave_SetConstant(module_ns,"ANNlatestRev",SWIG_FromCharPtr("Aug 4, 2006"));
  SWIG_Octave_SetConstant(module_ns,"ANNfalse",SWIG_From_int((int)(ANNfalse)));
  SWIG_Octave_SetConstant(module_ns,"ANNtrue",SWIG_From_int((int)(ANNtrue)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_STD",SWIG_From_int((int)(ANN_KD_STD)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_MIDPT",SWIG_From_int((int)(ANN_KD_MIDPT)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_FAIR",SWIG_From_int((int)(ANN_KD_FAIR)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_SL_MIDPT",SWIG_From_int((int)(ANN_KD_SL_MIDPT)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_SL_FAIR",SWIG_From_int((int)(ANN_KD_SL_FAIR)));
  SWIG_Octave_SetConstant(module_ns,"ANN_KD_SUGGEST",SWIG_From_int((int)(ANN_KD_SUGGEST)));
  SWIG_Octave_SetConstant(module_ns,"ANN_BD_NONE",SWIG_From_int((int)(ANN_BD_NONE)));
  SWIG_Octave_SetConstant(module_ns,"ANN_BD_SIMPLE",SWIG_From_int((int)(ANN_BD_SIMPLE)));
  SWIG_Octave_SetConstant(module_ns,"ANN_BD_CENTROID",SWIG_From_int((int)(ANN_BD_CENTROID)));
  SWIG_Octave_SetConstant(module_ns,"ANN_BD_SUGGEST",SWIG_From_int((int)(ANN_BD_SUGGEST)));
  SWIG_Octave_SetConstant(module_ns,"ANN_LO",SWIG_From_int((int)(ANN_LO)));
  SWIG_Octave_SetConstant(module_ns,"ANN_HI",SWIG_From_int((int)(ANN_HI)));
  SWIG_Octave_SetConstant(module_ns,"ANN_IN",SWIG_From_int((int)(ANN_IN)));
  SWIG_Octave_SetConstant(module_ns,"ANN_OUT",SWIG_From_int((int)(ANN_OUT)));
  SWIG_Octave_SetConstant(module_ns,"ANNwarn",SWIG_From_int((int)(ANNwarn)));
  SWIG_Octave_SetConstant(module_ns,"ANNabort",SWIG_From_int((int)(ANNabort)));
}


Generated by  Doxygen 1.6.0   Back to index