/* ----------------------------------------------------------------------------
 * 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 ReproduceDistancesObjective extends PermutationObjective {
  private transient long swigCPtr;

  protected ReproduceDistancesObjective(long cPtr, boolean cMemoryOwn) {
    super(swigfaissJNI.ReproduceDistancesObjective_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(ReproduceDistancesObjective 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_ReproduceDistancesObjective(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setDis_weight_factor(double value) {
    swigfaissJNI.ReproduceDistancesObjective_dis_weight_factor_set(swigCPtr, this, value);
  }

  public double getDis_weight_factor() {
    return swigfaissJNI.ReproduceDistancesObjective_dis_weight_factor_get(swigCPtr, this);
  }

  public static double sqr(double x) {
    return swigfaissJNI.ReproduceDistancesObjective_sqr(x);
  }

  public double dis_weight(double x) {
    return swigfaissJNI.ReproduceDistancesObjective_dis_weight(swigCPtr, this, x);
  }

  public void setSource_dis(DoubleVector value) {
    swigfaissJNI.ReproduceDistancesObjective_source_dis_set(swigCPtr, this, DoubleVector.getCPtr(value), value);
  }

  public DoubleVector getSource_dis() {
    long cPtr = swigfaissJNI.ReproduceDistancesObjective_source_dis_get(swigCPtr, this);
    return (cPtr == 0) ? null : new DoubleVector(cPtr, false);
  }

  public void setTarget_dis(SWIGTYPE_p_double value) {
    swigfaissJNI.ReproduceDistancesObjective_target_dis_set(swigCPtr, this, SWIGTYPE_p_double.getCPtr(value));
  }

  public SWIGTYPE_p_double getTarget_dis() {
    long cPtr = swigfaissJNI.ReproduceDistancesObjective_target_dis_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false);
  }

  public void setWeights(DoubleVector value) {
    swigfaissJNI.ReproduceDistancesObjective_weights_set(swigCPtr, this, DoubleVector.getCPtr(value), value);
  }

  public DoubleVector getWeights() {
    long cPtr = swigfaissJNI.ReproduceDistancesObjective_weights_get(swigCPtr, this);
    return (cPtr == 0) ? null : new DoubleVector(cPtr, false);
  }

  public double get_source_dis(int i, int j) {
    return swigfaissJNI.ReproduceDistancesObjective_get_source_dis(swigCPtr, this, i, j);
  }

  public double compute_cost(SWIGTYPE_p_int perm) {
    return swigfaissJNI.ReproduceDistancesObjective_compute_cost(swigCPtr, this, SWIGTYPE_p_int.getCPtr(perm));
  }

  public double cost_update(SWIGTYPE_p_int perm, int iw, int jw) {
    return swigfaissJNI.ReproduceDistancesObjective_cost_update(swigCPtr, this, SWIGTYPE_p_int.getCPtr(perm), iw, jw);
  }

  public ReproduceDistancesObjective(int n, SWIGTYPE_p_double source_dis_in, SWIGTYPE_p_double target_dis_in, double dis_weight_factor) {
    this(swigfaissJNI.new_ReproduceDistancesObjective(n, SWIGTYPE_p_double.getCPtr(source_dis_in), SWIGTYPE_p_double.getCPtr(target_dis_in), dis_weight_factor), true);
  }

  public static void compute_mean_stdev(SWIGTYPE_p_double tab, long n2, SWIGTYPE_p_double mean_out, SWIGTYPE_p_double stddev_out) {
    swigfaissJNI.ReproduceDistancesObjective_compute_mean_stdev(SWIGTYPE_p_double.getCPtr(tab), n2, SWIGTYPE_p_double.getCPtr(mean_out), SWIGTYPE_p_double.getCPtr(stddev_out));
  }

  public void set_affine_target_dis(SWIGTYPE_p_double source_dis_in) {
    swigfaissJNI.ReproduceDistancesObjective_set_affine_target_dis(swigCPtr, this, SWIGTYPE_p_double.getCPtr(source_dis_in));
  }

}
