All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.ortools.constraintsolver.main Maven / Gradle / Ivy

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

package com.google.ortools.constraintsolver;

public class main implements mainConstants {
  public static long CpRandomSeed() {
    return mainJNI.CpRandomSeed();
  }

  public static long zero() {
    return mainJNI.zero();
  }

  public static long One() {
    return mainJNI.One();
  }

  public static void setAssignmentFromAssignment(Assignment target_assignment, IntVar[] target_vars, Assignment source_assignment, IntVar[] source_vars) {
    mainJNI.setAssignmentFromAssignment(Assignment.getCPtr(target_assignment), target_assignment, target_vars, Assignment.getCPtr(source_assignment), source_assignment, source_vars);
  }

  public static boolean areAllBound(IntVar[] vars) {
    return mainJNI.areAllBound(vars);
  }

  public static boolean areAllBooleans(IntVar[] vars) {
    return mainJNI.areAllBooleans(vars);
  }

  public static boolean areAllBoundTo(IntVar[] vars, long value) {
    return mainJNI.areAllBoundTo(vars, value);
  }

  public static long maxVarArray(IntVar[] vars) {
    return mainJNI.maxVarArray(vars);
  }

  public static long minVarArray(IntVar[] vars) {
    return mainJNI.minVarArray(vars);
  }

  public static long posIntDivUp(long e, long v) {
    return mainJNI.posIntDivUp(e, v);
  }

  public static long posIntDivDown(long e, long v) {
    return mainJNI.posIntDivDown(e, v);
  }

  public static com.google.ortools.constraintsolver.RoutingModelParameters defaultRoutingModelParameters() {
  byte[] buf = mainJNI.defaultRoutingModelParameters();
  if (buf == null || buf.length == 0) {
    return null;
  }
  try {
    return com.google.ortools.constraintsolver.RoutingModelParameters.parseFrom(buf);
  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    throw new RuntimeException(
        "Unable to parse com.google.ortools.constraintsolver.RoutingModelParameters protocol message.");
  }
}

  public static com.google.ortools.constraintsolver.RoutingSearchParameters defaultRoutingSearchParameters() {
  byte[] buf = mainJNI.defaultRoutingSearchParameters();
  if (buf == null || buf.length == 0) {
    return null;
  }
  try {
    return com.google.ortools.constraintsolver.RoutingSearchParameters.parseFrom(buf);
  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    throw new RuntimeException(
        "Unable to parse com.google.ortools.constraintsolver.RoutingSearchParameters protocol message.");
  }
}

  public static String findErrorInRoutingSearchParameters(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    return mainJNI.findErrorInRoutingSearchParameters(search_parameters.toByteArray());
  }

  public static DecisionBuilder makeSetValuesFromTargets(Solver solver, IntVar[] variables, long[] targets) {
    long cPtr = mainJNI.makeSetValuesFromTargets(Solver.getCPtr(solver), solver, variables, targets);
    return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
  }

  public static boolean SolveModelWithSat(RoutingModel model, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution) {
    return mainJNI.SolveModelWithSat(RoutingModel.getCPtr(model), model, search_parameters.toByteArray(), Assignment.getCPtr(initial_solution), initial_solution, Assignment.getCPtr(solution), solution);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy