// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tribuo-libsvm.proto

package org.tribuo.common.libsvm.protos;

/**
 * <pre>
 *svm_parameter proto
 * </pre>
 *
 * Protobuf type {@code tribuo.common.libsvm.SVMParameterProto}
 */
public final class SVMParameterProto extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tribuo.common.libsvm.SVMParameterProto)
    SVMParameterProtoOrBuilder {
private static final long serialVersionUID = 0L;
  // Use SVMParameterProto.newBuilder() to construct.
  private SVMParameterProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private SVMParameterProto() {
    weightLabel_ = emptyIntList();
    weight_ = emptyDoubleList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new SVMParameterProto();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private SVMParameterProto(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8: {

            svmType_ = input.readInt32();
            break;
          }
          case 16: {

            kernelType_ = input.readInt32();
            break;
          }
          case 24: {

            degree_ = input.readInt32();
            break;
          }
          case 33: {

            gamma_ = input.readDouble();
            break;
          }
          case 41: {

            coef0_ = input.readDouble();
            break;
          }
          case 49: {

            cacheSize_ = input.readDouble();
            break;
          }
          case 57: {

            eps_ = input.readDouble();
            break;
          }
          case 65: {

            c_ = input.readDouble();
            break;
          }
          case 72: {

            nrWeight_ = input.readInt32();
            break;
          }
          case 80: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              weightLabel_ = newIntList();
              mutable_bitField0_ |= 0x00000001;
            }
            weightLabel_.addInt(input.readInt32());
            break;
          }
          case 82: {
            int length = input.readRawVarint32();
            int limit = input.pushLimit(length);
            if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
              weightLabel_ = newIntList();
              mutable_bitField0_ |= 0x00000001;
            }
            while (input.getBytesUntilLimit() > 0) {
              weightLabel_.addInt(input.readInt32());
            }
            input.popLimit(limit);
            break;
          }
          case 89: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              weight_ = newDoubleList();
              mutable_bitField0_ |= 0x00000002;
            }
            weight_.addDouble(input.readDouble());
            break;
          }
          case 90: {
            int length = input.readRawVarint32();
            int limit = input.pushLimit(length);
            if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
              weight_ = newDoubleList();
              mutable_bitField0_ |= 0x00000002;
            }
            while (input.getBytesUntilLimit() > 0) {
              weight_.addDouble(input.readDouble());
            }
            input.popLimit(limit);
            break;
          }
          case 97: {

            nu_ = input.readDouble();
            break;
          }
          case 105: {

            p_ = input.readDouble();
            break;
          }
          case 112: {

            shrinking_ = input.readInt32();
            break;
          }
          case 120: {

            probability_ = input.readInt32();
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        weightLabel_.makeImmutable(); // C
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        weight_.makeImmutable(); // C
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tribuo.common.libsvm.protos.TribuoLibsvm.internal_static_tribuo_common_libsvm_SVMParameterProto_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tribuo.common.libsvm.protos.TribuoLibsvm.internal_static_tribuo_common_libsvm_SVMParameterProto_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tribuo.common.libsvm.protos.SVMParameterProto.class, org.tribuo.common.libsvm.protos.SVMParameterProto.Builder.class);
  }

  public static final int SVM_TYPE_FIELD_NUMBER = 1;
  private int svmType_;
  /**
   * <code>int32 svm_type = 1;</code>
   * @return The svmType.
   */
  @java.lang.Override
  public int getSvmType() {
    return svmType_;
  }

  public static final int KERNEL_TYPE_FIELD_NUMBER = 2;
  private int kernelType_;
  /**
   * <code>int32 kernel_type = 2;</code>
   * @return The kernelType.
   */
  @java.lang.Override
  public int getKernelType() {
    return kernelType_;
  }

  public static final int DEGREE_FIELD_NUMBER = 3;
  private int degree_;
  /**
   * <code>int32 degree = 3;</code>
   * @return The degree.
   */
  @java.lang.Override
  public int getDegree() {
    return degree_;
  }

  public static final int GAMMA_FIELD_NUMBER = 4;
  private double gamma_;
  /**
   * <code>double gamma = 4;</code>
   * @return The gamma.
   */
  @java.lang.Override
  public double getGamma() {
    return gamma_;
  }

  public static final int COEF0_FIELD_NUMBER = 5;
  private double coef0_;
  /**
   * <code>double coef0 = 5;</code>
   * @return The coef0.
   */
  @java.lang.Override
  public double getCoef0() {
    return coef0_;
  }

  public static final int CACHE_SIZE_FIELD_NUMBER = 6;
  private double cacheSize_;
  /**
   * <code>double cache_size = 6;</code>
   * @return The cacheSize.
   */
  @java.lang.Override
  public double getCacheSize() {
    return cacheSize_;
  }

  public static final int EPS_FIELD_NUMBER = 7;
  private double eps_;
  /**
   * <code>double eps = 7;</code>
   * @return The eps.
   */
  @java.lang.Override
  public double getEps() {
    return eps_;
  }

  public static final int C_FIELD_NUMBER = 8;
  private double c_;
  /**
   * <code>double C = 8;</code>
   * @return The c.
   */
  @java.lang.Override
  public double getC() {
    return c_;
  }

  public static final int NR_WEIGHT_FIELD_NUMBER = 9;
  private int nrWeight_;
  /**
   * <code>int32 nr_weight = 9;</code>
   * @return The nrWeight.
   */
  @java.lang.Override
  public int getNrWeight() {
    return nrWeight_;
  }

  public static final int WEIGHT_LABEL_FIELD_NUMBER = 10;
  private com.google.protobuf.Internal.IntList weightLabel_;
  /**
   * <code>repeated int32 weight_label = 10;</code>
   * @return A list containing the weightLabel.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer>
      getWeightLabelList() {
    return weightLabel_;
  }
  /**
   * <code>repeated int32 weight_label = 10;</code>
   * @return The count of weightLabel.
   */
  public int getWeightLabelCount() {
    return weightLabel_.size();
  }
  /**
   * <code>repeated int32 weight_label = 10;</code>
   * @param index The index of the element to return.
   * @return The weightLabel at the given index.
   */
  public int getWeightLabel(int index) {
    return weightLabel_.getInt(index);
  }
  private int weightLabelMemoizedSerializedSize = -1;

  public static final int WEIGHT_FIELD_NUMBER = 11;
  private com.google.protobuf.Internal.DoubleList weight_;
  /**
   * <code>repeated double weight = 11;</code>
   * @return A list containing the weight.
   */
  @java.lang.Override
  public java.util.List<java.lang.Double>
      getWeightList() {
    return weight_;
  }
  /**
   * <code>repeated double weight = 11;</code>
   * @return The count of weight.
   */
  public int getWeightCount() {
    return weight_.size();
  }
  /**
   * <code>repeated double weight = 11;</code>
   * @param index The index of the element to return.
   * @return The weight at the given index.
   */
  public double getWeight(int index) {
    return weight_.getDouble(index);
  }
  private int weightMemoizedSerializedSize = -1;

  public static final int NU_FIELD_NUMBER = 12;
  private double nu_;
  /**
   * <code>double nu = 12;</code>
   * @return The nu.
   */
  @java.lang.Override
  public double getNu() {
    return nu_;
  }

  public static final int P_FIELD_NUMBER = 13;
  private double p_;
  /**
   * <code>double p = 13;</code>
   * @return The p.
   */
  @java.lang.Override
  public double getP() {
    return p_;
  }

  public static final int SHRINKING_FIELD_NUMBER = 14;
  private int shrinking_;
  /**
   * <code>int32 shrinking = 14;</code>
   * @return The shrinking.
   */
  @java.lang.Override
  public int getShrinking() {
    return shrinking_;
  }

  public static final int PROBABILITY_FIELD_NUMBER = 15;
  private int probability_;
  /**
   * <code>int32 probability = 15;</code>
   * @return The probability.
   */
  @java.lang.Override
  public int getProbability() {
    return probability_;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (svmType_ != 0) {
      output.writeInt32(1, svmType_);
    }
    if (kernelType_ != 0) {
      output.writeInt32(2, kernelType_);
    }
    if (degree_ != 0) {
      output.writeInt32(3, degree_);
    }
    if (java.lang.Double.doubleToRawLongBits(gamma_) != 0) {
      output.writeDouble(4, gamma_);
    }
    if (java.lang.Double.doubleToRawLongBits(coef0_) != 0) {
      output.writeDouble(5, coef0_);
    }
    if (java.lang.Double.doubleToRawLongBits(cacheSize_) != 0) {
      output.writeDouble(6, cacheSize_);
    }
    if (java.lang.Double.doubleToRawLongBits(eps_) != 0) {
      output.writeDouble(7, eps_);
    }
    if (java.lang.Double.doubleToRawLongBits(c_) != 0) {
      output.writeDouble(8, c_);
    }
    if (nrWeight_ != 0) {
      output.writeInt32(9, nrWeight_);
    }
    if (getWeightLabelList().size() > 0) {
      output.writeUInt32NoTag(82);
      output.writeUInt32NoTag(weightLabelMemoizedSerializedSize);
    }
    for (int i = 0; i < weightLabel_.size(); i++) {
      output.writeInt32NoTag(weightLabel_.getInt(i));
    }
    if (getWeightList().size() > 0) {
      output.writeUInt32NoTag(90);
      output.writeUInt32NoTag(weightMemoizedSerializedSize);
    }
    for (int i = 0; i < weight_.size(); i++) {
      output.writeDoubleNoTag(weight_.getDouble(i));
    }
    if (java.lang.Double.doubleToRawLongBits(nu_) != 0) {
      output.writeDouble(12, nu_);
    }
    if (java.lang.Double.doubleToRawLongBits(p_) != 0) {
      output.writeDouble(13, p_);
    }
    if (shrinking_ != 0) {
      output.writeInt32(14, shrinking_);
    }
    if (probability_ != 0) {
      output.writeInt32(15, probability_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (svmType_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, svmType_);
    }
    if (kernelType_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, kernelType_);
    }
    if (degree_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(3, degree_);
    }
    if (java.lang.Double.doubleToRawLongBits(gamma_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(4, gamma_);
    }
    if (java.lang.Double.doubleToRawLongBits(coef0_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(5, coef0_);
    }
    if (java.lang.Double.doubleToRawLongBits(cacheSize_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(6, cacheSize_);
    }
    if (java.lang.Double.doubleToRawLongBits(eps_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(7, eps_);
    }
    if (java.lang.Double.doubleToRawLongBits(c_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(8, c_);
    }
    if (nrWeight_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(9, nrWeight_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < weightLabel_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream
          .computeInt32SizeNoTag(weightLabel_.getInt(i));
      }
      size += dataSize;
      if (!getWeightLabelList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(dataSize);
      }
      weightLabelMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      dataSize = 8 * getWeightList().size();
      size += dataSize;
      if (!getWeightList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(dataSize);
      }
      weightMemoizedSerializedSize = dataSize;
    }
    if (java.lang.Double.doubleToRawLongBits(nu_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(12, nu_);
    }
    if (java.lang.Double.doubleToRawLongBits(p_) != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(13, p_);
    }
    if (shrinking_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(14, shrinking_);
    }
    if (probability_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(15, probability_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tribuo.common.libsvm.protos.SVMParameterProto)) {
      return super.equals(obj);
    }
    org.tribuo.common.libsvm.protos.SVMParameterProto other = (org.tribuo.common.libsvm.protos.SVMParameterProto) obj;

    if (getSvmType()
        != other.getSvmType()) return false;
    if (getKernelType()
        != other.getKernelType()) return false;
    if (getDegree()
        != other.getDegree()) return false;
    if (java.lang.Double.doubleToLongBits(getGamma())
        != java.lang.Double.doubleToLongBits(
            other.getGamma())) return false;
    if (java.lang.Double.doubleToLongBits(getCoef0())
        != java.lang.Double.doubleToLongBits(
            other.getCoef0())) return false;
    if (java.lang.Double.doubleToLongBits(getCacheSize())
        != java.lang.Double.doubleToLongBits(
            other.getCacheSize())) return false;
    if (java.lang.Double.doubleToLongBits(getEps())
        != java.lang.Double.doubleToLongBits(
            other.getEps())) return false;
    if (java.lang.Double.doubleToLongBits(getC())
        != java.lang.Double.doubleToLongBits(
            other.getC())) return false;
    if (getNrWeight()
        != other.getNrWeight()) return false;
    if (!getWeightLabelList()
        .equals(other.getWeightLabelList())) return false;
    if (!getWeightList()
        .equals(other.getWeightList())) return false;
    if (java.lang.Double.doubleToLongBits(getNu())
        != java.lang.Double.doubleToLongBits(
            other.getNu())) return false;
    if (java.lang.Double.doubleToLongBits(getP())
        != java.lang.Double.doubleToLongBits(
            other.getP())) return false;
    if (getShrinking()
        != other.getShrinking()) return false;
    if (getProbability()
        != other.getProbability()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + SVM_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getSvmType();
    hash = (37 * hash) + KERNEL_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getKernelType();
    hash = (37 * hash) + DEGREE_FIELD_NUMBER;
    hash = (53 * hash) + getDegree();
    hash = (37 * hash) + GAMMA_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getGamma()));
    hash = (37 * hash) + COEF0_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getCoef0()));
    hash = (37 * hash) + CACHE_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getCacheSize()));
    hash = (37 * hash) + EPS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getEps()));
    hash = (37 * hash) + C_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getC()));
    hash = (37 * hash) + NR_WEIGHT_FIELD_NUMBER;
    hash = (53 * hash) + getNrWeight();
    if (getWeightLabelCount() > 0) {
      hash = (37 * hash) + WEIGHT_LABEL_FIELD_NUMBER;
      hash = (53 * hash) + getWeightLabelList().hashCode();
    }
    if (getWeightCount() > 0) {
      hash = (37 * hash) + WEIGHT_FIELD_NUMBER;
      hash = (53 * hash) + getWeightList().hashCode();
    }
    hash = (37 * hash) + NU_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getNu()));
    hash = (37 * hash) + P_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getP()));
    hash = (37 * hash) + SHRINKING_FIELD_NUMBER;
    hash = (53 * hash) + getShrinking();
    hash = (37 * hash) + PROBABILITY_FIELD_NUMBER;
    hash = (53 * hash) + getProbability();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.common.libsvm.protos.SVMParameterProto parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tribuo.common.libsvm.protos.SVMParameterProto prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   *svm_parameter proto
   * </pre>
   *
   * Protobuf type {@code tribuo.common.libsvm.SVMParameterProto}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tribuo.common.libsvm.SVMParameterProto)
      org.tribuo.common.libsvm.protos.SVMParameterProtoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tribuo.common.libsvm.protos.TribuoLibsvm.internal_static_tribuo_common_libsvm_SVMParameterProto_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tribuo.common.libsvm.protos.TribuoLibsvm.internal_static_tribuo_common_libsvm_SVMParameterProto_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tribuo.common.libsvm.protos.SVMParameterProto.class, org.tribuo.common.libsvm.protos.SVMParameterProto.Builder.class);
    }

    // Construct using org.tribuo.common.libsvm.protos.SVMParameterProto.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      svmType_ = 0;

      kernelType_ = 0;

      degree_ = 0;

      gamma_ = 0D;

      coef0_ = 0D;

      cacheSize_ = 0D;

      eps_ = 0D;

      c_ = 0D;

      nrWeight_ = 0;

      weightLabel_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000001);
      weight_ = emptyDoubleList();
      bitField0_ = (bitField0_ & ~0x00000002);
      nu_ = 0D;

      p_ = 0D;

      shrinking_ = 0;

      probability_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tribuo.common.libsvm.protos.TribuoLibsvm.internal_static_tribuo_common_libsvm_SVMParameterProto_descriptor;
    }

    @java.lang.Override
    public org.tribuo.common.libsvm.protos.SVMParameterProto getDefaultInstanceForType() {
      return org.tribuo.common.libsvm.protos.SVMParameterProto.getDefaultInstance();
    }

    @java.lang.Override
    public org.tribuo.common.libsvm.protos.SVMParameterProto build() {
      org.tribuo.common.libsvm.protos.SVMParameterProto result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tribuo.common.libsvm.protos.SVMParameterProto buildPartial() {
      org.tribuo.common.libsvm.protos.SVMParameterProto result = new org.tribuo.common.libsvm.protos.SVMParameterProto(this);
      int from_bitField0_ = bitField0_;
      result.svmType_ = svmType_;
      result.kernelType_ = kernelType_;
      result.degree_ = degree_;
      result.gamma_ = gamma_;
      result.coef0_ = coef0_;
      result.cacheSize_ = cacheSize_;
      result.eps_ = eps_;
      result.c_ = c_;
      result.nrWeight_ = nrWeight_;
      if (((bitField0_ & 0x00000001) != 0)) {
        weightLabel_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.weightLabel_ = weightLabel_;
      if (((bitField0_ & 0x00000002) != 0)) {
        weight_.makeImmutable();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.weight_ = weight_;
      result.nu_ = nu_;
      result.p_ = p_;
      result.shrinking_ = shrinking_;
      result.probability_ = probability_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tribuo.common.libsvm.protos.SVMParameterProto) {
        return mergeFrom((org.tribuo.common.libsvm.protos.SVMParameterProto)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tribuo.common.libsvm.protos.SVMParameterProto other) {
      if (other == org.tribuo.common.libsvm.protos.SVMParameterProto.getDefaultInstance()) return this;
      if (other.getSvmType() != 0) {
        setSvmType(other.getSvmType());
      }
      if (other.getKernelType() != 0) {
        setKernelType(other.getKernelType());
      }
      if (other.getDegree() != 0) {
        setDegree(other.getDegree());
      }
      if (other.getGamma() != 0D) {
        setGamma(other.getGamma());
      }
      if (other.getCoef0() != 0D) {
        setCoef0(other.getCoef0());
      }
      if (other.getCacheSize() != 0D) {
        setCacheSize(other.getCacheSize());
      }
      if (other.getEps() != 0D) {
        setEps(other.getEps());
      }
      if (other.getC() != 0D) {
        setC(other.getC());
      }
      if (other.getNrWeight() != 0) {
        setNrWeight(other.getNrWeight());
      }
      if (!other.weightLabel_.isEmpty()) {
        if (weightLabel_.isEmpty()) {
          weightLabel_ = other.weightLabel_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureWeightLabelIsMutable();
          weightLabel_.addAll(other.weightLabel_);
        }
        onChanged();
      }
      if (!other.weight_.isEmpty()) {
        if (weight_.isEmpty()) {
          weight_ = other.weight_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureWeightIsMutable();
          weight_.addAll(other.weight_);
        }
        onChanged();
      }
      if (other.getNu() != 0D) {
        setNu(other.getNu());
      }
      if (other.getP() != 0D) {
        setP(other.getP());
      }
      if (other.getShrinking() != 0) {
        setShrinking(other.getShrinking());
      }
      if (other.getProbability() != 0) {
        setProbability(other.getProbability());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tribuo.common.libsvm.protos.SVMParameterProto parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tribuo.common.libsvm.protos.SVMParameterProto) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int svmType_ ;
    /**
     * <code>int32 svm_type = 1;</code>
     * @return The svmType.
     */
    @java.lang.Override
    public int getSvmType() {
      return svmType_;
    }
    /**
     * <code>int32 svm_type = 1;</code>
     * @param value The svmType to set.
     * @return This builder for chaining.
     */
    public Builder setSvmType(int value) {
      
      svmType_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 svm_type = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearSvmType() {
      
      svmType_ = 0;
      onChanged();
      return this;
    }

    private int kernelType_ ;
    /**
     * <code>int32 kernel_type = 2;</code>
     * @return The kernelType.
     */
    @java.lang.Override
    public int getKernelType() {
      return kernelType_;
    }
    /**
     * <code>int32 kernel_type = 2;</code>
     * @param value The kernelType to set.
     * @return This builder for chaining.
     */
    public Builder setKernelType(int value) {
      
      kernelType_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 kernel_type = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearKernelType() {
      
      kernelType_ = 0;
      onChanged();
      return this;
    }

    private int degree_ ;
    /**
     * <code>int32 degree = 3;</code>
     * @return The degree.
     */
    @java.lang.Override
    public int getDegree() {
      return degree_;
    }
    /**
     * <code>int32 degree = 3;</code>
     * @param value The degree to set.
     * @return This builder for chaining.
     */
    public Builder setDegree(int value) {
      
      degree_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 degree = 3;</code>
     * @return This builder for chaining.
     */
    public Builder clearDegree() {
      
      degree_ = 0;
      onChanged();
      return this;
    }

    private double gamma_ ;
    /**
     * <code>double gamma = 4;</code>
     * @return The gamma.
     */
    @java.lang.Override
    public double getGamma() {
      return gamma_;
    }
    /**
     * <code>double gamma = 4;</code>
     * @param value The gamma to set.
     * @return This builder for chaining.
     */
    public Builder setGamma(double value) {
      
      gamma_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double gamma = 4;</code>
     * @return This builder for chaining.
     */
    public Builder clearGamma() {
      
      gamma_ = 0D;
      onChanged();
      return this;
    }

    private double coef0_ ;
    /**
     * <code>double coef0 = 5;</code>
     * @return The coef0.
     */
    @java.lang.Override
    public double getCoef0() {
      return coef0_;
    }
    /**
     * <code>double coef0 = 5;</code>
     * @param value The coef0 to set.
     * @return This builder for chaining.
     */
    public Builder setCoef0(double value) {
      
      coef0_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double coef0 = 5;</code>
     * @return This builder for chaining.
     */
    public Builder clearCoef0() {
      
      coef0_ = 0D;
      onChanged();
      return this;
    }

    private double cacheSize_ ;
    /**
     * <code>double cache_size = 6;</code>
     * @return The cacheSize.
     */
    @java.lang.Override
    public double getCacheSize() {
      return cacheSize_;
    }
    /**
     * <code>double cache_size = 6;</code>
     * @param value The cacheSize to set.
     * @return This builder for chaining.
     */
    public Builder setCacheSize(double value) {
      
      cacheSize_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double cache_size = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearCacheSize() {
      
      cacheSize_ = 0D;
      onChanged();
      return this;
    }

    private double eps_ ;
    /**
     * <code>double eps = 7;</code>
     * @return The eps.
     */
    @java.lang.Override
    public double getEps() {
      return eps_;
    }
    /**
     * <code>double eps = 7;</code>
     * @param value The eps to set.
     * @return This builder for chaining.
     */
    public Builder setEps(double value) {
      
      eps_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double eps = 7;</code>
     * @return This builder for chaining.
     */
    public Builder clearEps() {
      
      eps_ = 0D;
      onChanged();
      return this;
    }

    private double c_ ;
    /**
     * <code>double C = 8;</code>
     * @return The c.
     */
    @java.lang.Override
    public double getC() {
      return c_;
    }
    /**
     * <code>double C = 8;</code>
     * @param value The c to set.
     * @return This builder for chaining.
     */
    public Builder setC(double value) {
      
      c_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double C = 8;</code>
     * @return This builder for chaining.
     */
    public Builder clearC() {
      
      c_ = 0D;
      onChanged();
      return this;
    }

    private int nrWeight_ ;
    /**
     * <code>int32 nr_weight = 9;</code>
     * @return The nrWeight.
     */
    @java.lang.Override
    public int getNrWeight() {
      return nrWeight_;
    }
    /**
     * <code>int32 nr_weight = 9;</code>
     * @param value The nrWeight to set.
     * @return This builder for chaining.
     */
    public Builder setNrWeight(int value) {
      
      nrWeight_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 nr_weight = 9;</code>
     * @return This builder for chaining.
     */
    public Builder clearNrWeight() {
      
      nrWeight_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.Internal.IntList weightLabel_ = emptyIntList();
    private void ensureWeightLabelIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        weightLabel_ = mutableCopy(weightLabel_);
        bitField0_ |= 0x00000001;
       }
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @return A list containing the weightLabel.
     */
    public java.util.List<java.lang.Integer>
        getWeightLabelList() {
      return ((bitField0_ & 0x00000001) != 0) ?
               java.util.Collections.unmodifiableList(weightLabel_) : weightLabel_;
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @return The count of weightLabel.
     */
    public int getWeightLabelCount() {
      return weightLabel_.size();
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @param index The index of the element to return.
     * @return The weightLabel at the given index.
     */
    public int getWeightLabel(int index) {
      return weightLabel_.getInt(index);
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @param index The index to set the value at.
     * @param value The weightLabel to set.
     * @return This builder for chaining.
     */
    public Builder setWeightLabel(
        int index, int value) {
      ensureWeightLabelIsMutable();
      weightLabel_.setInt(index, value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @param value The weightLabel to add.
     * @return This builder for chaining.
     */
    public Builder addWeightLabel(int value) {
      ensureWeightLabelIsMutable();
      weightLabel_.addInt(value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @param values The weightLabel to add.
     * @return This builder for chaining.
     */
    public Builder addAllWeightLabel(
        java.lang.Iterable<? extends java.lang.Integer> values) {
      ensureWeightLabelIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, weightLabel_);
      onChanged();
      return this;
    }
    /**
     * <code>repeated int32 weight_label = 10;</code>
     * @return This builder for chaining.
     */
    public Builder clearWeightLabel() {
      weightLabel_ = emptyIntList();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    private com.google.protobuf.Internal.DoubleList weight_ = emptyDoubleList();
    private void ensureWeightIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        weight_ = mutableCopy(weight_);
        bitField0_ |= 0x00000002;
       }
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @return A list containing the weight.
     */
    public java.util.List<java.lang.Double>
        getWeightList() {
      return ((bitField0_ & 0x00000002) != 0) ?
               java.util.Collections.unmodifiableList(weight_) : weight_;
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @return The count of weight.
     */
    public int getWeightCount() {
      return weight_.size();
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @param index The index of the element to return.
     * @return The weight at the given index.
     */
    public double getWeight(int index) {
      return weight_.getDouble(index);
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @param index The index to set the value at.
     * @param value The weight to set.
     * @return This builder for chaining.
     */
    public Builder setWeight(
        int index, double value) {
      ensureWeightIsMutable();
      weight_.setDouble(index, value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @param value The weight to add.
     * @return This builder for chaining.
     */
    public Builder addWeight(double value) {
      ensureWeightIsMutable();
      weight_.addDouble(value);
      onChanged();
      return this;
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @param values The weight to add.
     * @return This builder for chaining.
     */
    public Builder addAllWeight(
        java.lang.Iterable<? extends java.lang.Double> values) {
      ensureWeightIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, weight_);
      onChanged();
      return this;
    }
    /**
     * <code>repeated double weight = 11;</code>
     * @return This builder for chaining.
     */
    public Builder clearWeight() {
      weight_ = emptyDoubleList();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    private double nu_ ;
    /**
     * <code>double nu = 12;</code>
     * @return The nu.
     */
    @java.lang.Override
    public double getNu() {
      return nu_;
    }
    /**
     * <code>double nu = 12;</code>
     * @param value The nu to set.
     * @return This builder for chaining.
     */
    public Builder setNu(double value) {
      
      nu_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double nu = 12;</code>
     * @return This builder for chaining.
     */
    public Builder clearNu() {
      
      nu_ = 0D;
      onChanged();
      return this;
    }

    private double p_ ;
    /**
     * <code>double p = 13;</code>
     * @return The p.
     */
    @java.lang.Override
    public double getP() {
      return p_;
    }
    /**
     * <code>double p = 13;</code>
     * @param value The p to set.
     * @return This builder for chaining.
     */
    public Builder setP(double value) {
      
      p_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>double p = 13;</code>
     * @return This builder for chaining.
     */
    public Builder clearP() {
      
      p_ = 0D;
      onChanged();
      return this;
    }

    private int shrinking_ ;
    /**
     * <code>int32 shrinking = 14;</code>
     * @return The shrinking.
     */
    @java.lang.Override
    public int getShrinking() {
      return shrinking_;
    }
    /**
     * <code>int32 shrinking = 14;</code>
     * @param value The shrinking to set.
     * @return This builder for chaining.
     */
    public Builder setShrinking(int value) {
      
      shrinking_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 shrinking = 14;</code>
     * @return This builder for chaining.
     */
    public Builder clearShrinking() {
      
      shrinking_ = 0;
      onChanged();
      return this;
    }

    private int probability_ ;
    /**
     * <code>int32 probability = 15;</code>
     * @return The probability.
     */
    @java.lang.Override
    public int getProbability() {
      return probability_;
    }
    /**
     * <code>int32 probability = 15;</code>
     * @param value The probability to set.
     * @return This builder for chaining.
     */
    public Builder setProbability(int value) {
      
      probability_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 probability = 15;</code>
     * @return This builder for chaining.
     */
    public Builder clearProbability() {
      
      probability_ = 0;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:tribuo.common.libsvm.SVMParameterProto)
  }

  // @@protoc_insertion_point(class_scope:tribuo.common.libsvm.SVMParameterProto)
  private static final org.tribuo.common.libsvm.protos.SVMParameterProto DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tribuo.common.libsvm.protos.SVMParameterProto();
  }

  public static org.tribuo.common.libsvm.protos.SVMParameterProto getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SVMParameterProto>
      PARSER = new com.google.protobuf.AbstractParser<SVMParameterProto>() {
    @java.lang.Override
    public SVMParameterProto parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new SVMParameterProto(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<SVMParameterProto> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SVMParameterProto> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public org.tribuo.common.libsvm.protos.SVMParameterProto getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

