text:
namespace CoreML {
namespace Specification {
class KNearestNeighborsClassifierDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<KNearestNeighborsClassifier> {
  public:
  const ::CoreML::Specification::StringVector* stringclasslabels_;
  const ::CoreML::Specification::Int64Vector* int64classlabels_;
  ::google::protobuf::internal::ArenaStringPtr defaultstringlabel_;
  ::google::protobuf::int64 defaultint64label_;
  const ::CoreML::Specification::UniformWeighting* uniformweighting_;
  const ::CoreML::Specification::InverseDistanceWeighting* inversedistanceweighting_;
} _KNearestNeighborsClassifier_default_instance_;
class NearestNeighborsIndexDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<NearestNeighborsIndex> {
  public:
  const ::CoreML::Specification::LinearIndex* linearindex_;
  const ::CoreML::Specification::SingleKdTreeIndex* singlekdtreeindex_;
  const ::CoreML::Specification::SquaredEuclideanDistance* squaredeuclideandistance_;
} _NearestNeighborsIndex_default_instance_;
class UniformWeightingDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<UniformWeighting> {
} _UniformWeighting_default_instance_;
class InverseDistanceWeightingDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<InverseDistanceWeighting> {
} _InverseDistanceWeighting_default_instance_;
class LinearIndexDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<LinearIndex> {
} _LinearIndex_default_instance_;
class SingleKdTreeIndexDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SingleKdTreeIndex> {
} _SingleKdTreeIndex_default_instance_;
class SquaredEuclideanDistanceDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<SquaredEuclideanDistance> {
} _SquaredEuclideanDistance_default_instance_;

namespace protobuf_NearestNeighbors_2eproto {

PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField
    const TableStruct::entries[] = {
  {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},
};

PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField
    const TableStruct::aux[] = {
  ::google::protobuf::internal::AuxillaryParseTableField(),
};
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const
    TableStruct::schema[] = {
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
  { NULL, NULL, 0, -1, -1, false },
};

void TableStruct::Shutdown() {
  _KNearestNeighborsClassifier_default_instance_.Shutdown();
  _NearestNeighborsIndex_default_instance_.Shutdown();
  _UniformWeighting_default_instance_.Shutdown();
  _InverseDistanceWeighting_default_instance_.Shutdown();
  _LinearIndex_default_instance_.Shutdown();
  _SingleKdTreeIndex_default_instance_.Shutdown();
  _SquaredEuclideanDistance_default_instance_.Shutdown();
}

void TableStruct::InitDefaultsImpl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::google::protobuf::internal::InitProtobufDefaults();
  ::CoreML::Specification::protobuf_DataStructures_2eproto::InitDefaults();
  ::CoreML::Specification::protobuf_Parameters_2eproto::InitDefaults();
  _KNearestNeighborsClassifier_default_instance_.DefaultConstruct();
  _NearestNeighborsIndex_default_instance_.DefaultConstruct();
  _UniformWeighting_default_instance_.DefaultConstruct();
  _InverseDistanceWeighting_default_instance_.DefaultConstruct();
  _LinearIndex_default_instance_.DefaultConstruct();
  _SingleKdTreeIndex_default_instance_.DefaultConstruct();
  _SquaredEuclideanDistance_default_instance_.DefaultConstruct();
  _KNearestNeighborsClassifier_default_instance_.get_mutable()->nearestneighborsindex_ = const_cast< ::CoreML::Specification::NearestNeighborsIndex*>(
      ::CoreML::Specification::NearestNeighborsIndex::internal_default_instance());
  _KNearestNeighborsClassifier_default_instance_.get_mutable()->numberofneighbors_ = const_cast< ::CoreML::Specification::Int64Parameter*>(
      ::CoreML::Specification::Int64Parameter::internal_default_instance());
}

void InitDefaults() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
void AddDescriptorsImpl() {
  InitDefaults();
  ::CoreML::Specification::protobuf_DataStructures_2eproto::AddDescriptors();
  ::CoreML::Specification::protobuf_Parameters_2eproto::AddDescriptors();
  ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}

void AddDescriptors() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
#endif  // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER

}  // namespace protobuf_NearestNeighbors_2eproto

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int KNearestNeighborsClassifier::kNearestNeighborsIndexFieldNumber;
const int KNearestNeighborsClassifier::kNumberOfNeighborsFieldNumber;
const int KNearestNeighborsClassifier::kStringClassLabelsFieldNumber;
const int KNearestNeighborsClassifier::kInt64ClassLabelsFieldNumber;
const int KNearestNeighborsClassifier::kDefaultStringLabelFieldNumber;
const int KNearestNeighborsClassifier::kDefaultInt64LabelFieldNumber;
const int KNearestNeighborsClassifier::kUniformWeightingFieldNumber;
const int KNearestNeighborsClassifier::kInverseDistanceWeightingFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

KNearestNeighborsClassifier::KNearestNeighborsClassifier()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.KNearestNeighborsClassifier)
}
KNearestNeighborsClassifier::KNearestNeighborsClassifier(const KNearestNeighborsClassifier& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from.has_nearestneighborsindex()) {
    nearestneighborsindex_ = new ::CoreML::Specification::NearestNeighborsIndex(*from.nearestneighborsindex_);
  } else {
    nearestneighborsindex_ = NULL;
  }
  if (from.has_numberofneighbors()) {
    numberofneighbors_ = new ::CoreML::Specification::Int64Parameter(*from.numberofneighbors_);
  } else {
    numberofneighbors_ = NULL;
  }
  clear_has_ClassLabels();
  switch (from.ClassLabels_case()) {
    case kStringClassLabels: {
      mutable_stringclasslabels()->::CoreML::Specification::StringVector::MergeFrom(from.stringclasslabels());
      break;
    }
    case kInt64ClassLabels: {
      mutable_int64classlabels()->::CoreML::Specification::Int64Vector::MergeFrom(from.int64classlabels());
      break;
    }
    case CLASSLABELS_NOT_SET: {
      break;
    }
  }
  clear_has_DefaultClassLabel();
  switch (from.DefaultClassLabel_case()) {
    case kDefaultStringLabel: {
      set_defaultstringlabel(from.defaultstringlabel());
      break;
    }
    case kDefaultInt64Label: {
      set_defaultint64label(from.defaultint64label());
      break;
    }
    case DEFAULTCLASSLABEL_NOT_SET: {
      break;
    }
  }
  clear_has_WeightingScheme();
  switch (from.WeightingScheme_case()) {
    case kUniformWeighting: {
      mutable_uniformweighting()->::CoreML::Specification::UniformWeighting::MergeFrom(from.uniformweighting());
      break;
    }
    case kInverseDistanceWeighting: {
      mutable_inversedistanceweighting()->::CoreML::Specification::InverseDistanceWeighting::MergeFrom(from.inversedistanceweighting());
      break;
    }
    case WEIGHTINGSCHEME_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.KNearestNeighborsClassifier)
}

void KNearestNeighborsClassifier::SharedCtor() {
  ::memset(&nearestneighborsindex_, 0, reinterpret_cast<char*>(&numberofneighbors_) -
    reinterpret_cast<char*>(&nearestneighborsindex_) + sizeof(numberofneighbors_));
  clear_has_ClassLabels();
  clear_has_DefaultClassLabel();
  clear_has_WeightingScheme();
  _cached_size_ = 0;
}

KNearestNeighborsClassifier::~KNearestNeighborsClassifier() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.KNearestNeighborsClassifier)
  SharedDtor();
}

void KNearestNeighborsClassifier::SharedDtor() {
  if (this != internal_default_instance()) {
    delete nearestneighborsindex_;
  }
  if (this != internal_default_instance()) {
    delete numberofneighbors_;
  }
  if (has_ClassLabels()) {
    clear_ClassLabels();
  }
  if (has_DefaultClassLabel()) {
    clear_DefaultClassLabel();
  }
  if (has_WeightingScheme()) {
    clear_WeightingScheme();
  }
}

void KNearestNeighborsClassifier::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const KNearestNeighborsClassifier& KNearestNeighborsClassifier::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

KNearestNeighborsClassifier* KNearestNeighborsClassifier::New(::google::protobuf::Arena* arena) const {
  KNearestNeighborsClassifier* n = new KNearestNeighborsClassifier;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void KNearestNeighborsClassifier::clear_ClassLabels() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.KNearestNeighborsClassifier)
  switch (ClassLabels_case()) {
    case kStringClassLabels: {
      delete ClassLabels_.stringclasslabels_;
      break;
    }
    case kInt64ClassLabels: {
      delete ClassLabels_.int64classlabels_;
      break;
    }
    case CLASSLABELS_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = CLASSLABELS_NOT_SET;
}

void KNearestNeighborsClassifier::clear_DefaultClassLabel() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.KNearestNeighborsClassifier)
  switch (DefaultClassLabel_case()) {
    case kDefaultStringLabel: {
      DefaultClassLabel_.defaultstringlabel_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
      break;
    }
    case kDefaultInt64Label: {
      // No need to clear
      break;
    }
    case DEFAULTCLASSLABEL_NOT_SET: {
      break;
    }
  }
  _oneof_case_[1] = DEFAULTCLASSLABEL_NOT_SET;
}

void KNearestNeighborsClassifier::clear_WeightingScheme() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.KNearestNeighborsClassifier)
  switch (WeightingScheme_case()) {
    case kUniformWeighting: {
      delete WeightingScheme_.uniformweighting_;
      break;
    }
    case kInverseDistanceWeighting: {
      delete WeightingScheme_.inversedistanceweighting_;
      break;
    }
    case WEIGHTINGSCHEME_NOT_SET: {
      break;
    }
  }
  _oneof_case_[2] = WEIGHTINGSCHEME_NOT_SET;
}

void KNearestNeighborsClassifier::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.KNearestNeighborsClassifier)
  if (GetArenaNoVirtual() == NULL && nearestneighborsindex_ != NULL) {
    delete nearestneighborsindex_;
  }
  nearestneighborsindex_ = NULL;
  if (GetArenaNoVirtual() == NULL && numberofneighbors_ != NULL) {
    delete numberofneighbors_;
  }
  numberofneighbors_ = NULL;
  clear_ClassLabels();
  clear_DefaultClassLabel();
  clear_WeightingScheme();
}

bool KNearestNeighborsClassifier::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.KNearestNeighborsClassifier)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // .CoreML.Specification.NearestNeighborsIndex nearestNeighborsIndex = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_nearestneighborsindex()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.Int64Parameter numberOfNeighbors = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_numberofneighbors()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.StringVector stringClassLabels = 100;
      case 100: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(802u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_stringclasslabels()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.Int64Vector int64ClassLabels = 101;
      case 101: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(810u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_int64classlabels()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // string defaultStringLabel = 110;
      case 110: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(882u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_defaultstringlabel()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
            this->defaultstringlabel().data(), this->defaultstringlabel().length(),
            ::google::protobuf::internal::WireFormatLite::PARSE,
            "CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // int64 defaultInt64Label = 111;
      case 111: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(888u)) {
          clear_DefaultClassLabel();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &DefaultClassLabel_.defaultint64label_)));
          set_has_defaultint64label();
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.UniformWeighting uniformWeighting = 200;
      case 200: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(1602u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_uniformweighting()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.InverseDistanceWeighting inverseDistanceWeighting = 210;
      case 210: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(1682u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_inversedistanceweighting()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.KNearestNeighborsClassifier)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.KNearestNeighborsClassifier)
  return false;
#undef DO_
}

void KNearestNeighborsClassifier::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.KNearestNeighborsClassifier)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .CoreML.Specification.NearestNeighborsIndex nearestNeighborsIndex = 1;
  if (this->has_nearestneighborsindex()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      1, *this->nearestneighborsindex_, output);
  }

  // .CoreML.Specification.Int64Parameter numberOfNeighbors = 3;
  if (this->has_numberofneighbors()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      3, *this->numberofneighbors_, output);
  }

  // .CoreML.Specification.StringVector stringClassLabels = 100;
  if (has_stringclasslabels()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      100, *ClassLabels_.stringclasslabels_, output);
  }

  // .CoreML.Specification.Int64Vector int64ClassLabels = 101;
  if (has_int64classlabels()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      101, *ClassLabels_.int64classlabels_, output);
  }

  // string defaultStringLabel = 110;
  if (has_defaultstringlabel()) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->defaultstringlabel().data(), this->defaultstringlabel().length(),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      110, this->defaultstringlabel(), output);
  }

  // int64 defaultInt64Label = 111;
  if (has_defaultint64label()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(111, this->defaultint64label(), output);
  }

  // .CoreML.Specification.UniformWeighting uniformWeighting = 200;
  if (has_uniformweighting()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      200, *WeightingScheme_.uniformweighting_, output);
  }

  // .CoreML.Specification.InverseDistanceWeighting inverseDistanceWeighting = 210;
  if (has_inversedistanceweighting()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      210, *WeightingScheme_.inversedistanceweighting_, output);
  }

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.KNearestNeighborsClassifier)
}

size_t KNearestNeighborsClassifier::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.KNearestNeighborsClassifier)
  size_t total_size = 0;

  // .CoreML.Specification.NearestNeighborsIndex nearestNeighborsIndex = 1;
  if (this->has_nearestneighborsindex()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        *this->nearestneighborsindex_);
  }

  // .CoreML.Specification.Int64Parameter numberOfNeighbors = 3;
  if (this->has_numberofneighbors()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        *this->numberofneighbors_);
  }

  switch (ClassLabels_case()) {
    // .CoreML.Specification.StringVector stringClassLabels = 100;
    case kStringClassLabels: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *ClassLabels_.stringclasslabels_);
      break;
    }
    // .CoreML.Specification.Int64Vector int64ClassLabels = 101;
    case kInt64ClassLabels: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *ClassLabels_.int64classlabels_);
      break;
    }
    case CLASSLABELS_NOT_SET: {
      break;
    }
  }
  switch (DefaultClassLabel_case()) {
    // string defaultStringLabel = 110;
    case kDefaultStringLabel: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->defaultstringlabel());
      break;
    }
    // int64 defaultInt64Label = 111;
    case kDefaultInt64Label: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->defaultint64label());
      break;
    }
    case DEFAULTCLASSLABEL_NOT_SET: {
      break;
    }
  }
  switch (WeightingScheme_case()) {
    // .CoreML.Specification.UniformWeighting uniformWeighting = 200;
    case kUniformWeighting: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *WeightingScheme_.uniformweighting_);
      break;
    }
    // .CoreML.Specification.InverseDistanceWeighting inverseDistanceWeighting = 210;
    case kInverseDistanceWeighting: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *WeightingScheme_.inversedistanceweighting_);
      break;
    }
    case WEIGHTINGSCHEME_NOT_SET: {
      break;
    }
  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void KNearestNeighborsClassifier::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const KNearestNeighborsClassifier*>(&from));
}

void KNearestNeighborsClassifier::MergeFrom(const KNearestNeighborsClassifier& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.KNearestNeighborsClassifier)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.has_nearestneighborsindex()) {
    mutable_nearestneighborsindex()->::CoreML::Specification::NearestNeighborsIndex::MergeFrom(from.nearestneighborsindex());
  }
  if (from.has_numberofneighbors()) {
    mutable_numberofneighbors()->::CoreML::Specification::Int64Parameter::MergeFrom(from.numberofneighbors());
  }
  switch (from.ClassLabels_case()) {
    case kStringClassLabels: {
      mutable_stringclasslabels()->::CoreML::Specification::StringVector::MergeFrom(from.stringclasslabels());
      break;
    }
    case kInt64ClassLabels: {
      mutable_int64classlabels()->::CoreML::Specification::Int64Vector::MergeFrom(from.int64classlabels());
      break;
    }
    case CLASSLABELS_NOT_SET: {
      break;
    }
  }
  switch (from.DefaultClassLabel_case()) {
    case kDefaultStringLabel: {
      set_defaultstringlabel(from.defaultstringlabel());
      break;
    }
    case kDefaultInt64Label: {
      set_defaultint64label(from.defaultint64label());
      break;
    }
    case DEFAULTCLASSLABEL_NOT_SET: {
      break;
    }
  }
  switch (from.WeightingScheme_case()) {
    case kUniformWeighting: {
      mutable_uniformweighting()->::CoreML::Specification::UniformWeighting::MergeFrom(from.uniformweighting());
      break;
    }
    case kInverseDistanceWeighting: {
      mutable_inversedistanceweighting()->::CoreML::Specification::InverseDistanceWeighting::MergeFrom(from.inversedistanceweighting());
      break;
    }
    case WEIGHTINGSCHEME_NOT_SET: {
      break;
    }
  }
}

void KNearestNeighborsClassifier::CopyFrom(const KNearestNeighborsClassifier& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.KNearestNeighborsClassifier)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool KNearestNeighborsClassifier::IsInitialized() const {
  return true;
}

void KNearestNeighborsClassifier::Swap(KNearestNeighborsClassifier* other) {
  if (other == this) return;
  InternalSwap(other);
}
void KNearestNeighborsClassifier::InternalSwap(KNearestNeighborsClassifier* other) {
  std::swap(nearestneighborsindex_, other->nearestneighborsindex_);
  std::swap(numberofneighbors_, other->numberofneighbors_);
  std::swap(ClassLabels_, other->ClassLabels_);
  std::swap(_oneof_case_[0], other->_oneof_case_[0]);
  std::swap(DefaultClassLabel_, other->DefaultClassLabel_);
  std::swap(_oneof_case_[1], other->_oneof_case_[1]);
  std::swap(WeightingScheme_, other->WeightingScheme_);
  std::swap(_oneof_case_[2], other->_oneof_case_[2]);
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string KNearestNeighborsClassifier::GetTypeName() const {
  return "CoreML.Specification.KNearestNeighborsClassifier";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// KNearestNeighborsClassifier

// .CoreML.Specification.NearestNeighborsIndex nearestNeighborsIndex = 1;
bool KNearestNeighborsClassifier::has_nearestneighborsindex() const {
  return this != internal_default_instance() && nearestneighborsindex_ != NULL;
}
void KNearestNeighborsClassifier::clear_nearestneighborsindex() {
  if (GetArenaNoVirtual() == NULL && nearestneighborsindex_ != NULL) delete nearestneighborsindex_;
  nearestneighborsindex_ = NULL;
}
const ::CoreML::Specification::NearestNeighborsIndex& KNearestNeighborsClassifier::nearestneighborsindex() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.nearestNeighborsIndex)
  return nearestneighborsindex_ != NULL ? *nearestneighborsindex_
                         : *::CoreML::Specification::NearestNeighborsIndex::internal_default_instance();
}
::CoreML::Specification::NearestNeighborsIndex* KNearestNeighborsClassifier::mutable_nearestneighborsindex() {

  if (nearestneighborsindex_ == NULL) {
    nearestneighborsindex_ = new ::CoreML::Specification::NearestNeighborsIndex;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.nearestNeighborsIndex)
  return nearestneighborsindex_;
}
::CoreML::Specification::NearestNeighborsIndex* KNearestNeighborsClassifier::release_nearestneighborsindex() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.nearestNeighborsIndex)

  ::CoreML::Specification::NearestNeighborsIndex* temp = nearestneighborsindex_;
  nearestneighborsindex_ = NULL;
  return temp;
}
void KNearestNeighborsClassifier::set_allocated_nearestneighborsindex(::CoreML::Specification::NearestNeighborsIndex* nearestneighborsindex) {
  delete nearestneighborsindex_;
  nearestneighborsindex_ = nearestneighborsindex;
  if (nearestneighborsindex) {

  } else {

  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.nearestNeighborsIndex)
}

// .CoreML.Specification.Int64Parameter numberOfNeighbors = 3;
bool KNearestNeighborsClassifier::has_numberofneighbors() const {
  return this != internal_default_instance() && numberofneighbors_ != NULL;
}
void KNearestNeighborsClassifier::clear_numberofneighbors() {
  if (GetArenaNoVirtual() == NULL && numberofneighbors_ != NULL) delete numberofneighbors_;
  numberofneighbors_ = NULL;
}
const ::CoreML::Specification::Int64Parameter& KNearestNeighborsClassifier::numberofneighbors() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.numberOfNeighbors)
  return numberofneighbors_ != NULL ? *numberofneighbors_
                         : *::CoreML::Specification::Int64Parameter::internal_default_instance();
}
::CoreML::Specification::Int64Parameter* KNearestNeighborsClassifier::mutable_numberofneighbors() {

  if (numberofneighbors_ == NULL) {
    numberofneighbors_ = new ::CoreML::Specification::Int64Parameter;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.numberOfNeighbors)
  return numberofneighbors_;
}
::CoreML::Specification::Int64Parameter* KNearestNeighborsClassifier::release_numberofneighbors() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.numberOfNeighbors)

  ::CoreML::Specification::Int64Parameter* temp = numberofneighbors_;
  numberofneighbors_ = NULL;
  return temp;
}
void KNearestNeighborsClassifier::set_allocated_numberofneighbors(::CoreML::Specification::Int64Parameter* numberofneighbors) {
  delete numberofneighbors_;
  numberofneighbors_ = numberofneighbors;
  if (numberofneighbors) {

  } else {

  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.numberOfNeighbors)
}

// .CoreML.Specification.StringVector stringClassLabels = 100;
bool KNearestNeighborsClassifier::has_stringclasslabels() const {
  return ClassLabels_case() == kStringClassLabels;
}
void KNearestNeighborsClassifier::set_has_stringclasslabels() {
  _oneof_case_[0] = kStringClassLabels;
}
void KNearestNeighborsClassifier::clear_stringclasslabels() {
  if (has_stringclasslabels()) {
    delete ClassLabels_.stringclasslabels_;
    clear_has_ClassLabels();
  }
}
 const ::CoreML::Specification::StringVector& KNearestNeighborsClassifier::stringclasslabels() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.stringClassLabels)
  return has_stringclasslabels()
      ? *ClassLabels_.stringclasslabels_
      : ::CoreML::Specification::StringVector::default_instance();
}
::CoreML::Specification::StringVector* KNearestNeighborsClassifier::mutable_stringclasslabels() {
  if (!has_stringclasslabels()) {
    clear_ClassLabels();
    set_has_stringclasslabels();
    ClassLabels_.stringclasslabels_ = new ::CoreML::Specification::StringVector;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.stringClassLabels)
  return ClassLabels_.stringclasslabels_;
}
::CoreML::Specification::StringVector* KNearestNeighborsClassifier::release_stringclasslabels() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.stringClassLabels)
  if (has_stringclasslabels()) {
    clear_has_ClassLabels();
    ::CoreML::Specification::StringVector* temp = ClassLabels_.stringclasslabels_;
    ClassLabels_.stringclasslabels_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void KNearestNeighborsClassifier::set_allocated_stringclasslabels(::CoreML::Specification::StringVector* stringclasslabels) {
  clear_ClassLabels();
  if (stringclasslabels) {
    set_has_stringclasslabels();
    ClassLabels_.stringclasslabels_ = stringclasslabels;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.stringClassLabels)
}

// .CoreML.Specification.Int64Vector int64ClassLabels = 101;
bool KNearestNeighborsClassifier::has_int64classlabels() const {
  return ClassLabels_case() == kInt64ClassLabels;
}
void KNearestNeighborsClassifier::set_has_int64classlabels() {
  _oneof_case_[0] = kInt64ClassLabels;
}
void KNearestNeighborsClassifier::clear_int64classlabels() {
  if (has_int64classlabels()) {
    delete ClassLabels_.int64classlabels_;
    clear_has_ClassLabels();
  }
}
 const ::CoreML::Specification::Int64Vector& KNearestNeighborsClassifier::int64classlabels() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.int64ClassLabels)
  return has_int64classlabels()
      ? *ClassLabels_.int64classlabels_
      : ::CoreML::Specification::Int64Vector::default_instance();
}
::CoreML::Specification::Int64Vector* KNearestNeighborsClassifier::mutable_int64classlabels() {
  if (!has_int64classlabels()) {
    clear_ClassLabels();
    set_has_int64classlabels();
    ClassLabels_.int64classlabels_ = new ::CoreML::Specification::Int64Vector;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.int64ClassLabels)
  return ClassLabels_.int64classlabels_;
}
::CoreML::Specification::Int64Vector* KNearestNeighborsClassifier::release_int64classlabels() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.int64ClassLabels)
  if (has_int64classlabels()) {
    clear_has_ClassLabels();
    ::CoreML::Specification::Int64Vector* temp = ClassLabels_.int64classlabels_;
    ClassLabels_.int64classlabels_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void KNearestNeighborsClassifier::set_allocated_int64classlabels(::CoreML::Specification::Int64Vector* int64classlabels) {
  clear_ClassLabels();
  if (int64classlabels) {
    set_has_int64classlabels();
    ClassLabels_.int64classlabels_ = int64classlabels;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.int64ClassLabels)
}

// string defaultStringLabel = 110;
bool KNearestNeighborsClassifier::has_defaultstringlabel() const {
  return DefaultClassLabel_case() == kDefaultStringLabel;
}
void KNearestNeighborsClassifier::set_has_defaultstringlabel() {
  _oneof_case_[1] = kDefaultStringLabel;
}
void KNearestNeighborsClassifier::clear_defaultstringlabel() {
  if (has_defaultstringlabel()) {
    DefaultClassLabel_.defaultstringlabel_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    clear_has_DefaultClassLabel();
  }
}
const ::std::string& KNearestNeighborsClassifier::defaultstringlabel() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
  if (has_defaultstringlabel()) {
    return DefaultClassLabel_.defaultstringlabel_.GetNoArena();
  }
  return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
}
void KNearestNeighborsClassifier::set_defaultstringlabel(const ::std::string& value) {
  // @@protoc_insertion_point(field_set:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
  if (!has_defaultstringlabel()) {
    clear_DefaultClassLabel();
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  DefaultClassLabel_.defaultstringlabel_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
}
#if LANG_CXX11
void KNearestNeighborsClassifier::set_defaultstringlabel(::std::string&& value) {
  // @@protoc_insertion_point(field_set:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
  if (!has_defaultstringlabel()) {
    clear_DefaultClassLabel();
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  DefaultClassLabel_.defaultstringlabel_.SetNoArena(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
  // @@protoc_insertion_point(field_set_rvalue:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
}
#endif
void KNearestNeighborsClassifier::set_defaultstringlabel(const char* value) {
  GOOGLE_DCHECK(value != NULL);
  if (!has_defaultstringlabel()) {
    clear_DefaultClassLabel();
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  DefaultClassLabel_.defaultstringlabel_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(value));
  // @@protoc_insertion_point(field_set_char:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
}
void KNearestNeighborsClassifier::set_defaultstringlabel(const char* value, size_t size) {
  if (!has_defaultstringlabel()) {
    clear_DefaultClassLabel();
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  DefaultClassLabel_.defaultstringlabel_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
}
::std::string* KNearestNeighborsClassifier::mutable_defaultstringlabel() {
  if (!has_defaultstringlabel()) {
    clear_DefaultClassLabel();
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
  return DefaultClassLabel_.defaultstringlabel_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
::std::string* KNearestNeighborsClassifier::release_defaultstringlabel() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
  if (has_defaultstringlabel()) {
    clear_has_DefaultClassLabel();
    return DefaultClassLabel_.defaultstringlabel_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  } else {
    return NULL;
  }
}
void KNearestNeighborsClassifier::set_allocated_defaultstringlabel(::std::string* defaultstringlabel) {
  if (!has_defaultstringlabel()) {
    DefaultClassLabel_.defaultstringlabel_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  }
  clear_DefaultClassLabel();
  if (defaultstringlabel != NULL) {
    set_has_defaultstringlabel();
    DefaultClassLabel_.defaultstringlabel_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
        defaultstringlabel);
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.defaultStringLabel)
}

// int64 defaultInt64Label = 111;
bool KNearestNeighborsClassifier::has_defaultint64label() const {
  return DefaultClassLabel_case() == kDefaultInt64Label;
}
void KNearestNeighborsClassifier::set_has_defaultint64label() {
  _oneof_case_[1] = kDefaultInt64Label;
}
void KNearestNeighborsClassifier::clear_defaultint64label() {
  if (has_defaultint64label()) {
    DefaultClassLabel_.defaultint64label_ = GOOGLE_LONGLONG(0);
    clear_has_DefaultClassLabel();
  }
}
::google::protobuf::int64 KNearestNeighborsClassifier::defaultint64label() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.defaultInt64Label)
  if (has_defaultint64label()) {
    return DefaultClassLabel_.defaultint64label_;
  }
  return GOOGLE_LONGLONG(0);
}
void KNearestNeighborsClassifier::set_defaultint64label(::google::protobuf::int64 value) {
  if (!has_defaultint64label()) {
    clear_DefaultClassLabel();
    set_has_defaultint64label();
  }
  DefaultClassLabel_.defaultint64label_ = value;
  // @@protoc_insertion_point(field_set:CoreML.Specification.KNearestNeighborsClassifier.defaultInt64Label)
}

// .CoreML.Specification.UniformWeighting uniformWeighting = 200;
bool KNearestNeighborsClassifier::has_uniformweighting() const {
  return WeightingScheme_case() == kUniformWeighting;
}
void KNearestNeighborsClassifier::set_has_uniformweighting() {
  _oneof_case_[2] = kUniformWeighting;
}
void KNearestNeighborsClassifier::clear_uniformweighting() {
  if (has_uniformweighting()) {
    delete WeightingScheme_.uniformweighting_;
    clear_has_WeightingScheme();
  }
}
 const ::CoreML::Specification::UniformWeighting& KNearestNeighborsClassifier::uniformweighting() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.uniformWeighting)
  return has_uniformweighting()
      ? *WeightingScheme_.uniformweighting_
      : ::CoreML::Specification::UniformWeighting::default_instance();
}
::CoreML::Specification::UniformWeighting* KNearestNeighborsClassifier::mutable_uniformweighting() {
  if (!has_uniformweighting()) {
    clear_WeightingScheme();
    set_has_uniformweighting();
    WeightingScheme_.uniformweighting_ = new ::CoreML::Specification::UniformWeighting;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.uniformWeighting)
  return WeightingScheme_.uniformweighting_;
}
::CoreML::Specification::UniformWeighting* KNearestNeighborsClassifier::release_uniformweighting() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.uniformWeighting)
  if (has_uniformweighting()) {
    clear_has_WeightingScheme();
    ::CoreML::Specification::UniformWeighting* temp = WeightingScheme_.uniformweighting_;
    WeightingScheme_.uniformweighting_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void KNearestNeighborsClassifier::set_allocated_uniformweighting(::CoreML::Specification::UniformWeighting* uniformweighting) {
  clear_WeightingScheme();
  if (uniformweighting) {
    set_has_uniformweighting();
    WeightingScheme_.uniformweighting_ = uniformweighting;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.uniformWeighting)
}

// .CoreML.Specification.InverseDistanceWeighting inverseDistanceWeighting = 210;
bool KNearestNeighborsClassifier::has_inversedistanceweighting() const {
  return WeightingScheme_case() == kInverseDistanceWeighting;
}
void KNearestNeighborsClassifier::set_has_inversedistanceweighting() {
  _oneof_case_[2] = kInverseDistanceWeighting;
}
void KNearestNeighborsClassifier::clear_inversedistanceweighting() {
  if (has_inversedistanceweighting()) {
    delete WeightingScheme_.inversedistanceweighting_;
    clear_has_WeightingScheme();
  }
}
 const ::CoreML::Specification::InverseDistanceWeighting& KNearestNeighborsClassifier::inversedistanceweighting() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.KNearestNeighborsClassifier.inverseDistanceWeighting)
  return has_inversedistanceweighting()
      ? *WeightingScheme_.inversedistanceweighting_
      : ::CoreML::Specification::InverseDistanceWeighting::default_instance();
}
::CoreML::Specification::InverseDistanceWeighting* KNearestNeighborsClassifier::mutable_inversedistanceweighting() {
  if (!has_inversedistanceweighting()) {
    clear_WeightingScheme();
    set_has_inversedistanceweighting();
    WeightingScheme_.inversedistanceweighting_ = new ::CoreML::Specification::InverseDistanceWeighting;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.KNearestNeighborsClassifier.inverseDistanceWeighting)
  return WeightingScheme_.inversedistanceweighting_;
}
::CoreML::Specification::InverseDistanceWeighting* KNearestNeighborsClassifier::release_inversedistanceweighting() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.KNearestNeighborsClassifier.inverseDistanceWeighting)
  if (has_inversedistanceweighting()) {
    clear_has_WeightingScheme();
    ::CoreML::Specification::InverseDistanceWeighting* temp = WeightingScheme_.inversedistanceweighting_;
    WeightingScheme_.inversedistanceweighting_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void KNearestNeighborsClassifier::set_allocated_inversedistanceweighting(::CoreML::Specification::InverseDistanceWeighting* inversedistanceweighting) {
  clear_WeightingScheme();
  if (inversedistanceweighting) {
    set_has_inversedistanceweighting();
    WeightingScheme_.inversedistanceweighting_ = inversedistanceweighting;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.KNearestNeighborsClassifier.inverseDistanceWeighting)
}

bool KNearestNeighborsClassifier::has_ClassLabels() const {
  return ClassLabels_case() != CLASSLABELS_NOT_SET;
}
void KNearestNeighborsClassifier::clear_has_ClassLabels() {
  _oneof_case_[0] = CLASSLABELS_NOT_SET;
}
bool KNearestNeighborsClassifier::has_DefaultClassLabel() const {
  return DefaultClassLabel_case() != DEFAULTCLASSLABEL_NOT_SET;
}
void KNearestNeighborsClassifier::clear_has_DefaultClassLabel() {
  _oneof_case_[1] = DEFAULTCLASSLABEL_NOT_SET;
}
bool KNearestNeighborsClassifier::has_WeightingScheme() const {
  return WeightingScheme_case() != WEIGHTINGSCHEME_NOT_SET;
}
void KNearestNeighborsClassifier::clear_has_WeightingScheme() {
  _oneof_case_[2] = WEIGHTINGSCHEME_NOT_SET;
}
KNearestNeighborsClassifier::ClassLabelsCase KNearestNeighborsClassifier::ClassLabels_case() const {
  return KNearestNeighborsClassifier::ClassLabelsCase(_oneof_case_[0]);
}
KNearestNeighborsClassifier::DefaultClassLabelCase KNearestNeighborsClassifier::DefaultClassLabel_case() const {
  return KNearestNeighborsClassifier::DefaultClassLabelCase(_oneof_case_[1]);
}
KNearestNeighborsClassifier::WeightingSchemeCase KNearestNeighborsClassifier::WeightingScheme_case() const {
  return KNearestNeighborsClassifier::WeightingSchemeCase(_oneof_case_[2]);
}
#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int NearestNeighborsIndex::kNumberOfDimensionsFieldNumber;
const int NearestNeighborsIndex::kFloatSamplesFieldNumber;
const int NearestNeighborsIndex::kLinearIndexFieldNumber;
const int NearestNeighborsIndex::kSingleKdTreeIndexFieldNumber;
const int NearestNeighborsIndex::kSquaredEuclideanDistanceFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

NearestNeighborsIndex::NearestNeighborsIndex()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.NearestNeighborsIndex)
}
NearestNeighborsIndex::NearestNeighborsIndex(const NearestNeighborsIndex& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      floatsamples_(from.floatsamples_),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  numberofdimensions_ = from.numberofdimensions_;
  clear_has_IndexType();
  switch (from.IndexType_case()) {
    case kLinearIndex: {
      mutable_linearindex()->::CoreML::Specification::LinearIndex::MergeFrom(from.linearindex());
      break;
    }
    case kSingleKdTreeIndex: {
      mutable_singlekdtreeindex()->::CoreML::Specification::SingleKdTreeIndex::MergeFrom(from.singlekdtreeindex());
      break;
    }
    case INDEXTYPE_NOT_SET: {
      break;
    }
  }
  clear_has_DistanceFunction();
  switch (from.DistanceFunction_case()) {
    case kSquaredEuclideanDistance: {
      mutable_squaredeuclideandistance()->::CoreML::Specification::SquaredEuclideanDistance::MergeFrom(from.squaredeuclideandistance());
      break;
    }
    case DISTANCEFUNCTION_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.NearestNeighborsIndex)
}

void NearestNeighborsIndex::SharedCtor() {
  numberofdimensions_ = 0;
  clear_has_IndexType();
  clear_has_DistanceFunction();
  _cached_size_ = 0;
}

NearestNeighborsIndex::~NearestNeighborsIndex() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.NearestNeighborsIndex)
  SharedDtor();
}

void NearestNeighborsIndex::SharedDtor() {
  if (has_IndexType()) {
    clear_IndexType();
  }
  if (has_DistanceFunction()) {
    clear_DistanceFunction();
  }
}

void NearestNeighborsIndex::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const NearestNeighborsIndex& NearestNeighborsIndex::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

NearestNeighborsIndex* NearestNeighborsIndex::New(::google::protobuf::Arena* arena) const {
  NearestNeighborsIndex* n = new NearestNeighborsIndex;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void NearestNeighborsIndex::clear_IndexType() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.NearestNeighborsIndex)
  switch (IndexType_case()) {
    case kLinearIndex: {
      delete IndexType_.linearindex_;
      break;
    }
    case kSingleKdTreeIndex: {
      delete IndexType_.singlekdtreeindex_;
      break;
    }
    case INDEXTYPE_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = INDEXTYPE_NOT_SET;
}

void NearestNeighborsIndex::clear_DistanceFunction() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.NearestNeighborsIndex)
  switch (DistanceFunction_case()) {
    case kSquaredEuclideanDistance: {
      delete DistanceFunction_.squaredeuclideandistance_;
      break;
    }
    case DISTANCEFUNCTION_NOT_SET: {
      break;
    }
  }
  _oneof_case_[1] = DISTANCEFUNCTION_NOT_SET;
}

void NearestNeighborsIndex::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.NearestNeighborsIndex)
  floatsamples_.Clear();
  numberofdimensions_ = 0;
  clear_IndexType();
  clear_DistanceFunction();
}

bool NearestNeighborsIndex::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.NearestNeighborsIndex)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // int32 numberOfDimensions = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &numberofdimensions_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .CoreML.Specification.FloatVector floatSamples = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_floatsamples()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.LinearIndex linearIndex = 100;
      case 100: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(802u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_linearindex()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.SingleKdTreeIndex singleKdTreeIndex = 110;
      case 110: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(882u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_singlekdtreeindex()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .CoreML.Specification.SquaredEuclideanDistance squaredEuclideanDistance = 200;
      case 200: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(1602u)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_squaredeuclideandistance()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.NearestNeighborsIndex)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.NearestNeighborsIndex)
  return false;
#undef DO_
}

void NearestNeighborsIndex::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.NearestNeighborsIndex)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 numberOfDimensions = 1;
  if (this->numberofdimensions() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->numberofdimensions(), output);
  }

  // repeated .CoreML.Specification.FloatVector floatSamples = 2;
  for (unsigned int i = 0, n = this->floatsamples_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      2, this->floatsamples(i), output);
  }

  // .CoreML.Specification.LinearIndex linearIndex = 100;
  if (has_linearindex()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      100, *IndexType_.linearindex_, output);
  }

  // .CoreML.Specification.SingleKdTreeIndex singleKdTreeIndex = 110;
  if (has_singlekdtreeindex()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      110, *IndexType_.singlekdtreeindex_, output);
  }

  // .CoreML.Specification.SquaredEuclideanDistance squaredEuclideanDistance = 200;
  if (has_squaredeuclideandistance()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      200, *DistanceFunction_.squaredeuclideandistance_, output);
  }

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.NearestNeighborsIndex)
}

size_t NearestNeighborsIndex::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.NearestNeighborsIndex)
  size_t total_size = 0;

  // repeated .CoreML.Specification.FloatVector floatSamples = 2;
  {
    unsigned int count = this->floatsamples_size();
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->floatsamples(i));
    }
  }

  // int32 numberOfDimensions = 1;
  if (this->numberofdimensions() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->numberofdimensions());
  }

  switch (IndexType_case()) {
    // .CoreML.Specification.LinearIndex linearIndex = 100;
    case kLinearIndex: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *IndexType_.linearindex_);
      break;
    }
    // .CoreML.Specification.SingleKdTreeIndex singleKdTreeIndex = 110;
    case kSingleKdTreeIndex: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *IndexType_.singlekdtreeindex_);
      break;
    }
    case INDEXTYPE_NOT_SET: {
      break;
    }
  }
  switch (DistanceFunction_case()) {
    // .CoreML.Specification.SquaredEuclideanDistance squaredEuclideanDistance = 200;
    case kSquaredEuclideanDistance: {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *DistanceFunction_.squaredeuclideandistance_);
      break;
    }
    case DISTANCEFUNCTION_NOT_SET: {
      break;
    }
  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void NearestNeighborsIndex::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const NearestNeighborsIndex*>(&from));
}

void NearestNeighborsIndex::MergeFrom(const NearestNeighborsIndex& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.NearestNeighborsIndex)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  floatsamples_.MergeFrom(from.floatsamples_);
  if (from.numberofdimensions() != 0) {
    set_numberofdimensions(from.numberofdimensions());
  }
  switch (from.IndexType_case()) {
    case kLinearIndex: {
      mutable_linearindex()->::CoreML::Specification::LinearIndex::MergeFrom(from.linearindex());
      break;
    }
    case kSingleKdTreeIndex: {
      mutable_singlekdtreeindex()->::CoreML::Specification::SingleKdTreeIndex::MergeFrom(from.singlekdtreeindex());
      break;
    }
    case INDEXTYPE_NOT_SET: {
      break;
    }
  }
  switch (from.DistanceFunction_case()) {
    case kSquaredEuclideanDistance: {
      mutable_squaredeuclideandistance()->::CoreML::Specification::SquaredEuclideanDistance::MergeFrom(from.squaredeuclideandistance());
      break;
    }
    case DISTANCEFUNCTION_NOT_SET: {
      break;
    }
  }
}

void NearestNeighborsIndex::CopyFrom(const NearestNeighborsIndex& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.NearestNeighborsIndex)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool NearestNeighborsIndex::IsInitialized() const {
  return true;
}

void NearestNeighborsIndex::Swap(NearestNeighborsIndex* other) {
  if (other == this) return;
  InternalSwap(other);
}
void NearestNeighborsIndex::InternalSwap(NearestNeighborsIndex* other) {
  floatsamples_.InternalSwap(&other->floatsamples_);
  std::swap(numberofdimensions_, other->numberofdimensions_);
  std::swap(IndexType_, other->IndexType_);
  std::swap(_oneof_case_[0], other->_oneof_case_[0]);
  std::swap(DistanceFunction_, other->DistanceFunction_);
  std::swap(_oneof_case_[1], other->_oneof_case_[1]);
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string NearestNeighborsIndex::GetTypeName() const {
  return "CoreML.Specification.NearestNeighborsIndex";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// NearestNeighborsIndex

// int32 numberOfDimensions = 1;
void NearestNeighborsIndex::clear_numberofdimensions() {
  numberofdimensions_ = 0;
}
::google::protobuf::int32 NearestNeighborsIndex::numberofdimensions() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.NearestNeighborsIndex.numberOfDimensions)
  return numberofdimensions_;
}
void NearestNeighborsIndex::set_numberofdimensions(::google::protobuf::int32 value) {

  numberofdimensions_ = value;
  // @@protoc_insertion_point(field_set:CoreML.Specification.NearestNeighborsIndex.numberOfDimensions)
}

// repeated .CoreML.Specification.FloatVector floatSamples = 2;
int NearestNeighborsIndex::floatsamples_size() const {
  return floatsamples_.size();
}
void NearestNeighborsIndex::clear_floatsamples() {
  floatsamples_.Clear();
}
const ::CoreML::Specification::FloatVector& NearestNeighborsIndex::floatsamples(int index) const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.NearestNeighborsIndex.floatSamples)
  return floatsamples_.Get(index);
}
::CoreML::Specification::FloatVector* NearestNeighborsIndex::mutable_floatsamples(int index) {
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.NearestNeighborsIndex.floatSamples)
  return floatsamples_.Mutable(index);
}
::CoreML::Specification::FloatVector* NearestNeighborsIndex::add_floatsamples() {
  // @@protoc_insertion_point(field_add:CoreML.Specification.NearestNeighborsIndex.floatSamples)
  return floatsamples_.Add();
}
::google::protobuf::RepeatedPtrField< ::CoreML::Specification::FloatVector >*
NearestNeighborsIndex::mutable_floatsamples() {
  // @@protoc_insertion_point(field_mutable_list:CoreML.Specification.NearestNeighborsIndex.floatSamples)
  return &floatsamples_;
}
const ::google::protobuf::RepeatedPtrField< ::CoreML::Specification::FloatVector >&
NearestNeighborsIndex::floatsamples() const {
  // @@protoc_insertion_point(field_list:CoreML.Specification.NearestNeighborsIndex.floatSamples)
  return floatsamples_;
}

// .CoreML.Specification.LinearIndex linearIndex = 100;
bool NearestNeighborsIndex::has_linearindex() const {
  return IndexType_case() == kLinearIndex;
}
void NearestNeighborsIndex::set_has_linearindex() {
  _oneof_case_[0] = kLinearIndex;
}
void NearestNeighborsIndex::clear_linearindex() {
  if (has_linearindex()) {
    delete IndexType_.linearindex_;
    clear_has_IndexType();
  }
}
 const ::CoreML::Specification::LinearIndex& NearestNeighborsIndex::linearindex() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.NearestNeighborsIndex.linearIndex)
  return has_linearindex()
      ? *IndexType_.linearindex_
      : ::CoreML::Specification::LinearIndex::default_instance();
}
::CoreML::Specification::LinearIndex* NearestNeighborsIndex::mutable_linearindex() {
  if (!has_linearindex()) {
    clear_IndexType();
    set_has_linearindex();
    IndexType_.linearindex_ = new ::CoreML::Specification::LinearIndex;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.NearestNeighborsIndex.linearIndex)
  return IndexType_.linearindex_;
}
::CoreML::Specification::LinearIndex* NearestNeighborsIndex::release_linearindex() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.NearestNeighborsIndex.linearIndex)
  if (has_linearindex()) {
    clear_has_IndexType();
    ::CoreML::Specification::LinearIndex* temp = IndexType_.linearindex_;
    IndexType_.linearindex_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void NearestNeighborsIndex::set_allocated_linearindex(::CoreML::Specification::LinearIndex* linearindex) {
  clear_IndexType();
  if (linearindex) {
    set_has_linearindex();
    IndexType_.linearindex_ = linearindex;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.NearestNeighborsIndex.linearIndex)
}

// .CoreML.Specification.SingleKdTreeIndex singleKdTreeIndex = 110;
bool NearestNeighborsIndex::has_singlekdtreeindex() const {
  return IndexType_case() == kSingleKdTreeIndex;
}
void NearestNeighborsIndex::set_has_singlekdtreeindex() {
  _oneof_case_[0] = kSingleKdTreeIndex;
}
void NearestNeighborsIndex::clear_singlekdtreeindex() {
  if (has_singlekdtreeindex()) {
    delete IndexType_.singlekdtreeindex_;
    clear_has_IndexType();
  }
}
 const ::CoreML::Specification::SingleKdTreeIndex& NearestNeighborsIndex::singlekdtreeindex() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.NearestNeighborsIndex.singleKdTreeIndex)
  return has_singlekdtreeindex()
      ? *IndexType_.singlekdtreeindex_
      : ::CoreML::Specification::SingleKdTreeIndex::default_instance();
}
::CoreML::Specification::SingleKdTreeIndex* NearestNeighborsIndex::mutable_singlekdtreeindex() {
  if (!has_singlekdtreeindex()) {
    clear_IndexType();
    set_has_singlekdtreeindex();
    IndexType_.singlekdtreeindex_ = new ::CoreML::Specification::SingleKdTreeIndex;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.NearestNeighborsIndex.singleKdTreeIndex)
  return IndexType_.singlekdtreeindex_;
}
::CoreML::Specification::SingleKdTreeIndex* NearestNeighborsIndex::release_singlekdtreeindex() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.NearestNeighborsIndex.singleKdTreeIndex)
  if (has_singlekdtreeindex()) {
    clear_has_IndexType();
    ::CoreML::Specification::SingleKdTreeIndex* temp = IndexType_.singlekdtreeindex_;
    IndexType_.singlekdtreeindex_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void NearestNeighborsIndex::set_allocated_singlekdtreeindex(::CoreML::Specification::SingleKdTreeIndex* singlekdtreeindex) {
  clear_IndexType();
  if (singlekdtreeindex) {
    set_has_singlekdtreeindex();
    IndexType_.singlekdtreeindex_ = singlekdtreeindex;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.NearestNeighborsIndex.singleKdTreeIndex)
}

// .CoreML.Specification.SquaredEuclideanDistance squaredEuclideanDistance = 200;
bool NearestNeighborsIndex::has_squaredeuclideandistance() const {
  return DistanceFunction_case() == kSquaredEuclideanDistance;
}
void NearestNeighborsIndex::set_has_squaredeuclideandistance() {
  _oneof_case_[1] = kSquaredEuclideanDistance;
}
void NearestNeighborsIndex::clear_squaredeuclideandistance() {
  if (has_squaredeuclideandistance()) {
    delete DistanceFunction_.squaredeuclideandistance_;
    clear_has_DistanceFunction();
  }
}
 const ::CoreML::Specification::SquaredEuclideanDistance& NearestNeighborsIndex::squaredeuclideandistance() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.NearestNeighborsIndex.squaredEuclideanDistance)
  return has_squaredeuclideandistance()
      ? *DistanceFunction_.squaredeuclideandistance_
      : ::CoreML::Specification::SquaredEuclideanDistance::default_instance();
}
::CoreML::Specification::SquaredEuclideanDistance* NearestNeighborsIndex::mutable_squaredeuclideandistance() {
  if (!has_squaredeuclideandistance()) {
    clear_DistanceFunction();
    set_has_squaredeuclideandistance();
    DistanceFunction_.squaredeuclideandistance_ = new ::CoreML::Specification::SquaredEuclideanDistance;
  }
  // @@protoc_insertion_point(field_mutable:CoreML.Specification.NearestNeighborsIndex.squaredEuclideanDistance)
  return DistanceFunction_.squaredeuclideandistance_;
}
::CoreML::Specification::SquaredEuclideanDistance* NearestNeighborsIndex::release_squaredeuclideandistance() {
  // @@protoc_insertion_point(field_release:CoreML.Specification.NearestNeighborsIndex.squaredEuclideanDistance)
  if (has_squaredeuclideandistance()) {
    clear_has_DistanceFunction();
    ::CoreML::Specification::SquaredEuclideanDistance* temp = DistanceFunction_.squaredeuclideandistance_;
    DistanceFunction_.squaredeuclideandistance_ = NULL;
    return temp;
  } else {
    return NULL;
  }
}
void NearestNeighborsIndex::set_allocated_squaredeuclideandistance(::CoreML::Specification::SquaredEuclideanDistance* squaredeuclideandistance) {
  clear_DistanceFunction();
  if (squaredeuclideandistance) {
    set_has_squaredeuclideandistance();
    DistanceFunction_.squaredeuclideandistance_ = squaredeuclideandistance;
  }
  // @@protoc_insertion_point(field_set_allocated:CoreML.Specification.NearestNeighborsIndex.squaredEuclideanDistance)
}

bool NearestNeighborsIndex::has_IndexType() const {
  return IndexType_case() != INDEXTYPE_NOT_SET;
}
void NearestNeighborsIndex::clear_has_IndexType() {
  _oneof_case_[0] = INDEXTYPE_NOT_SET;
}
bool NearestNeighborsIndex::has_DistanceFunction() const {
  return DistanceFunction_case() != DISTANCEFUNCTION_NOT_SET;
}
void NearestNeighborsIndex::clear_has_DistanceFunction() {
  _oneof_case_[1] = DISTANCEFUNCTION_NOT_SET;
}
NearestNeighborsIndex::IndexTypeCase NearestNeighborsIndex::IndexType_case() const {
  return NearestNeighborsIndex::IndexTypeCase(_oneof_case_[0]);
}
NearestNeighborsIndex::DistanceFunctionCase NearestNeighborsIndex::DistanceFunction_case() const {
  return NearestNeighborsIndex::DistanceFunctionCase(_oneof_case_[1]);
}
#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

UniformWeighting::UniformWeighting()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.UniformWeighting)
}
UniformWeighting::UniformWeighting(const UniformWeighting& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.UniformWeighting)
}

void UniformWeighting::SharedCtor() {
  _cached_size_ = 0;
}

UniformWeighting::~UniformWeighting() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.UniformWeighting)
  SharedDtor();
}

void UniformWeighting::SharedDtor() {
}

void UniformWeighting::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const UniformWeighting& UniformWeighting::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

UniformWeighting* UniformWeighting::New(::google::protobuf::Arena* arena) const {
  UniformWeighting* n = new UniformWeighting;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void UniformWeighting::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.UniformWeighting)
}

bool UniformWeighting::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.UniformWeighting)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.UniformWeighting)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.UniformWeighting)
  return false;
#undef DO_
}

void UniformWeighting::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.UniformWeighting)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.UniformWeighting)
}

size_t UniformWeighting::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.UniformWeighting)
  size_t total_size = 0;

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void UniformWeighting::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const UniformWeighting*>(&from));
}

void UniformWeighting::MergeFrom(const UniformWeighting& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.UniformWeighting)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

}

void UniformWeighting::CopyFrom(const UniformWeighting& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.UniformWeighting)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool UniformWeighting::IsInitialized() const {
  return true;
}

void UniformWeighting::Swap(UniformWeighting* other) {
  if (other == this) return;
  InternalSwap(other);
}
void UniformWeighting::InternalSwap(UniformWeighting* other) {
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string UniformWeighting::GetTypeName() const {
  return "CoreML.Specification.UniformWeighting";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// UniformWeighting

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

InverseDistanceWeighting::InverseDistanceWeighting()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.InverseDistanceWeighting)
}
InverseDistanceWeighting::InverseDistanceWeighting(const InverseDistanceWeighting& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.InverseDistanceWeighting)
}

void InverseDistanceWeighting::SharedCtor() {
  _cached_size_ = 0;
}

InverseDistanceWeighting::~InverseDistanceWeighting() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.InverseDistanceWeighting)
  SharedDtor();
}

void InverseDistanceWeighting::SharedDtor() {
}

void InverseDistanceWeighting::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const InverseDistanceWeighting& InverseDistanceWeighting::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

InverseDistanceWeighting* InverseDistanceWeighting::New(::google::protobuf::Arena* arena) const {
  InverseDistanceWeighting* n = new InverseDistanceWeighting;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void InverseDistanceWeighting::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.InverseDistanceWeighting)
}

bool InverseDistanceWeighting::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.InverseDistanceWeighting)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.InverseDistanceWeighting)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.InverseDistanceWeighting)
  return false;
#undef DO_
}

void InverseDistanceWeighting::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.InverseDistanceWeighting)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.InverseDistanceWeighting)
}

size_t InverseDistanceWeighting::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.InverseDistanceWeighting)
  size_t total_size = 0;

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void InverseDistanceWeighting::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const InverseDistanceWeighting*>(&from));
}

void InverseDistanceWeighting::MergeFrom(const InverseDistanceWeighting& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.InverseDistanceWeighting)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

}

void InverseDistanceWeighting::CopyFrom(const InverseDistanceWeighting& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.InverseDistanceWeighting)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool InverseDistanceWeighting::IsInitialized() const {
  return true;
}

void InverseDistanceWeighting::Swap(InverseDistanceWeighting* other) {
  if (other == this) return;
  InternalSwap(other);
}
void InverseDistanceWeighting::InternalSwap(InverseDistanceWeighting* other) {
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string InverseDistanceWeighting::GetTypeName() const {
  return "CoreML.Specification.InverseDistanceWeighting";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// InverseDistanceWeighting

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

LinearIndex::LinearIndex()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.LinearIndex)
}
LinearIndex::LinearIndex(const LinearIndex& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.LinearIndex)
}

void LinearIndex::SharedCtor() {
  _cached_size_ = 0;
}

LinearIndex::~LinearIndex() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.LinearIndex)
  SharedDtor();
}

void LinearIndex::SharedDtor() {
}

void LinearIndex::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const LinearIndex& LinearIndex::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

LinearIndex* LinearIndex::New(::google::protobuf::Arena* arena) const {
  LinearIndex* n = new LinearIndex;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void LinearIndex::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.LinearIndex)
}

bool LinearIndex::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.LinearIndex)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.LinearIndex)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.LinearIndex)
  return false;
#undef DO_
}

void LinearIndex::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.LinearIndex)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.LinearIndex)
}

size_t LinearIndex::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.LinearIndex)
  size_t total_size = 0;

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void LinearIndex::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const LinearIndex*>(&from));
}

void LinearIndex::MergeFrom(const LinearIndex& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.LinearIndex)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

}

void LinearIndex::CopyFrom(const LinearIndex& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.LinearIndex)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LinearIndex::IsInitialized() const {
  return true;
}

void LinearIndex::Swap(LinearIndex* other) {
  if (other == this) return;
  InternalSwap(other);
}
void LinearIndex::InternalSwap(LinearIndex* other) {
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string LinearIndex::GetTypeName() const {
  return "CoreML.Specification.LinearIndex";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// LinearIndex

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int SingleKdTreeIndex::kLeafSizeFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

SingleKdTreeIndex::SingleKdTreeIndex()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.SingleKdTreeIndex)
}
SingleKdTreeIndex::SingleKdTreeIndex(const SingleKdTreeIndex& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  leafsize_ = from.leafsize_;
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.SingleKdTreeIndex)
}

void SingleKdTreeIndex::SharedCtor() {
  leafsize_ = 0;
  _cached_size_ = 0;
}

SingleKdTreeIndex::~SingleKdTreeIndex() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.SingleKdTreeIndex)
  SharedDtor();
}

void SingleKdTreeIndex::SharedDtor() {
}

void SingleKdTreeIndex::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const SingleKdTreeIndex& SingleKdTreeIndex::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

SingleKdTreeIndex* SingleKdTreeIndex::New(::google::protobuf::Arena* arena) const {
  SingleKdTreeIndex* n = new SingleKdTreeIndex;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void SingleKdTreeIndex::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.SingleKdTreeIndex)
  leafsize_ = 0;
}

bool SingleKdTreeIndex::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.SingleKdTreeIndex)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // int32 leafSize = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &leafsize_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.SingleKdTreeIndex)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.SingleKdTreeIndex)
  return false;
#undef DO_
}

void SingleKdTreeIndex::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.SingleKdTreeIndex)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 leafSize = 1;
  if (this->leafsize() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->leafsize(), output);
  }

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.SingleKdTreeIndex)
}

size_t SingleKdTreeIndex::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.SingleKdTreeIndex)
  size_t total_size = 0;

  // int32 leafSize = 1;
  if (this->leafsize() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->leafsize());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void SingleKdTreeIndex::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const SingleKdTreeIndex*>(&from));
}

void SingleKdTreeIndex::MergeFrom(const SingleKdTreeIndex& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.SingleKdTreeIndex)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.leafsize() != 0) {
    set_leafsize(from.leafsize());
  }
}

void SingleKdTreeIndex::CopyFrom(const SingleKdTreeIndex& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.SingleKdTreeIndex)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SingleKdTreeIndex::IsInitialized() const {
  return true;
}

void SingleKdTreeIndex::Swap(SingleKdTreeIndex* other) {
  if (other == this) return;
  InternalSwap(other);
}
void SingleKdTreeIndex::InternalSwap(SingleKdTreeIndex* other) {
  std::swap(leafsize_, other->leafsize_);
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string SingleKdTreeIndex::GetTypeName() const {
  return "CoreML.Specification.SingleKdTreeIndex";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// SingleKdTreeIndex

// int32 leafSize = 1;
void SingleKdTreeIndex::clear_leafsize() {
  leafsize_ = 0;
}
::google::protobuf::int32 SingleKdTreeIndex::leafsize() const {
  // @@protoc_insertion_point(field_get:CoreML.Specification.SingleKdTreeIndex.leafSize)
  return leafsize_;
}
void SingleKdTreeIndex::set_leafsize(::google::protobuf::int32 value) {

  leafsize_ = value;
  // @@protoc_insertion_point(field_set:CoreML.Specification.SingleKdTreeIndex.leafSize)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

SquaredEuclideanDistance::SquaredEuclideanDistance()
  : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    protobuf_NearestNeighbors_2eproto::InitDefaults();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:CoreML.Specification.SquaredEuclideanDistance)
}
SquaredEuclideanDistance::SquaredEuclideanDistance(const SquaredEuclideanDistance& from)
  : ::google::protobuf::MessageLite(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.SquaredEuclideanDistance)
}

void SquaredEuclideanDistance::SharedCtor() {
  _cached_size_ = 0;
}

SquaredEuclideanDistance::~SquaredEuclideanDistance() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.SquaredEuclideanDistance)
  SharedDtor();
}

void SquaredEuclideanDistance::SharedDtor() {
}

void SquaredEuclideanDistance::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const SquaredEuclideanDistance& SquaredEuclideanDistance::default_instance() {
  protobuf_NearestNeighbors_2eproto::InitDefaults();
  return *internal_default_instance();
}

SquaredEuclideanDistance* SquaredEuclideanDistance::New(::google::protobuf::Arena* arena) const {
  SquaredEuclideanDistance* n = new SquaredEuclideanDistance;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void SquaredEuclideanDistance::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.SquaredEuclideanDistance)
}

bool SquaredEuclideanDistance::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:CoreML.Specification.SquaredEuclideanDistance)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  }
success:
  // @@protoc_insertion_point(parse_success:CoreML.Specification.SquaredEuclideanDistance)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:CoreML.Specification.SquaredEuclideanDistance)
  return false;
#undef DO_
}

void SquaredEuclideanDistance::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:CoreML.Specification.SquaredEuclideanDistance)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // @@protoc_insertion_point(serialize_end:CoreML.Specification.SquaredEuclideanDistance)
}

size_t SquaredEuclideanDistance::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.SquaredEuclideanDistance)
  size_t total_size = 0;

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void SquaredEuclideanDistance::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const SquaredEuclideanDistance*>(&from));
}

void SquaredEuclideanDistance::MergeFrom(const SquaredEuclideanDistance& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.SquaredEuclideanDistance)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

}

void SquaredEuclideanDistance::CopyFrom(const SquaredEuclideanDistance& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.SquaredEuclideanDistance)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SquaredEuclideanDistance::IsInitialized() const {
  return true;
}

void SquaredEuclideanDistance::Swap(SquaredEuclideanDistance* other) {
  if (other == this) return;
  InternalSwap(other);
}
void SquaredEuclideanDistance::InternalSwap(SquaredEuclideanDistance* other) {
  std::swap(_cached_size_, other->_cached_size_);
}

::std::string SquaredEuclideanDistance::GetTypeName() const {
  return "CoreML.Specification.SquaredEuclideanDistance";
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// SquaredEuclideanDistance

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace Specification
}  // namespace CoreML

// @@protoc_insertion_point(global_scope)