/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.twitter.ann.faiss;

public class IndexBinary {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected IndexBinary(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(IndexBinary obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        swigfaissJNI.delete_IndexBinary(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setD(int value) {
    swigfaissJNI.IndexBinary_d_set(swigCPtr, this, value);
  }

  public int getD() {
    return swigfaissJNI.IndexBinary_d_get(swigCPtr, this);
  }

  public void setCode_size(int value) {
    swigfaissJNI.IndexBinary_code_size_set(swigCPtr, this, value);
  }

  public int getCode_size() {
    return swigfaissJNI.IndexBinary_code_size_get(swigCPtr, this);
  }

  public void setNtotal(long value) {
    swigfaissJNI.IndexBinary_ntotal_set(swigCPtr, this, value);
  }

  public long getNtotal() {
    return swigfaissJNI.IndexBinary_ntotal_get(swigCPtr, this);
}

  public void setVerbose(boolean value) {
    swigfaissJNI.IndexBinary_verbose_set(swigCPtr, this, value);
  }

  public boolean getVerbose() {
    return swigfaissJNI.IndexBinary_verbose_get(swigCPtr, this);
  }

  public void setIs_trained(boolean value) {
    swigfaissJNI.IndexBinary_is_trained_set(swigCPtr, this, value);
  }

  public boolean getIs_trained() {
    return swigfaissJNI.IndexBinary_is_trained_get(swigCPtr, this);
  }

  public void setMetric_type(MetricType value) {
    swigfaissJNI.IndexBinary_metric_type_set(swigCPtr, this, value.swigValue());
  }

  public MetricType getMetric_type() {
    return MetricType.swigToEnum(swigfaissJNI.IndexBinary_metric_type_get(swigCPtr, this));
  }

  public void train(long n, SWIGTYPE_p_unsigned_char x) {
    swigfaissJNI.IndexBinary_train(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x));
  }

  public void add(long n, SWIGTYPE_p_unsigned_char x) {
    swigfaissJNI.IndexBinary_add(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x));
  }

  public void add_with_ids(long n, SWIGTYPE_p_unsigned_char x, LongVector xids) {
    swigfaissJNI.IndexBinary_add_with_ids(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), SWIGTYPE_p_long_long.getCPtr(xids.data()), xids);
  }

  public void search(long n, SWIGTYPE_p_unsigned_char x, long k, SWIGTYPE_p_int distances, LongVector labels) {
    swigfaissJNI.IndexBinary_search(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), k, SWIGTYPE_p_int.getCPtr(distances), SWIGTYPE_p_long_long.getCPtr(labels.data()), labels);
  }

  public void range_search(long n, SWIGTYPE_p_unsigned_char x, int radius, RangeSearchResult result) {
    swigfaissJNI.IndexBinary_range_search(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), radius, RangeSearchResult.getCPtr(result), result);
  }

  public void assign(long n, SWIGTYPE_p_unsigned_char x, LongVector labels, long k) {
    swigfaissJNI.IndexBinary_assign__SWIG_0(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), SWIGTYPE_p_long_long.getCPtr(labels.data()), labels, k);
  }

  public void assign(long n, SWIGTYPE_p_unsigned_char x, LongVector labels) {
    swigfaissJNI.IndexBinary_assign__SWIG_1(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), SWIGTYPE_p_long_long.getCPtr(labels.data()), labels);
  }

  public void reset() {
    swigfaissJNI.IndexBinary_reset(swigCPtr, this);
  }

  public long remove_ids(IDSelector sel) {
    return swigfaissJNI.IndexBinary_remove_ids(swigCPtr, this, IDSelector.getCPtr(sel), sel);
  }

  public void reconstruct(long key, SWIGTYPE_p_unsigned_char recons) {
    swigfaissJNI.IndexBinary_reconstruct(swigCPtr, this, key, SWIGTYPE_p_unsigned_char.getCPtr(recons));
  }

  public void reconstruct_n(long i0, long ni, SWIGTYPE_p_unsigned_char recons) {
    swigfaissJNI.IndexBinary_reconstruct_n(swigCPtr, this, i0, ni, SWIGTYPE_p_unsigned_char.getCPtr(recons));
  }

  public void search_and_reconstruct(long n, SWIGTYPE_p_unsigned_char x, long k, SWIGTYPE_p_int distances, LongVector labels, SWIGTYPE_p_unsigned_char recons) {
    swigfaissJNI.IndexBinary_search_and_reconstruct(swigCPtr, this, n, SWIGTYPE_p_unsigned_char.getCPtr(x), k, SWIGTYPE_p_int.getCPtr(distances), SWIGTYPE_p_long_long.getCPtr(labels.data()), labels, SWIGTYPE_p_unsigned_char.getCPtr(recons));
  }

  public void display() {
    swigfaissJNI.IndexBinary_display(swigCPtr, this);
  }

}
