// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: GLMRegressor.proto

#include "GLMRegressor.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace CoreML {
namespace Specification {
constexpr GLMRegressor_DoubleArray::GLMRegressor_DoubleArray(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : value_(){}
struct GLMRegressor_DoubleArrayDefaultTypeInternal {
  constexpr GLMRegressor_DoubleArrayDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~GLMRegressor_DoubleArrayDefaultTypeInternal() {}
  union {
    GLMRegressor_DoubleArray _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GLMRegressor_DoubleArrayDefaultTypeInternal _GLMRegressor_DoubleArray_default_instance_;
constexpr GLMRegressor::GLMRegressor(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : weights_()
  , offset_()
  , postevaluationtransform_(0)
{}
struct GLMRegressorDefaultTypeInternal {
  constexpr GLMRegressorDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~GLMRegressorDefaultTypeInternal() {}
  union {
    GLMRegressor _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GLMRegressorDefaultTypeInternal _GLMRegressor_default_instance_;
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {
bool GLMRegressor_PostEvaluationTransform_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> GLMRegressor_PostEvaluationTransform_strings[3] = {};

static const char GLMRegressor_PostEvaluationTransform_names[] =
  "Logit"
  "NoTransform"
  "Probit";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GLMRegressor_PostEvaluationTransform_entries[] = {
  { {GLMRegressor_PostEvaluationTransform_names + 0, 5}, 1 },
  { {GLMRegressor_PostEvaluationTransform_names + 5, 11}, 0 },
  { {GLMRegressor_PostEvaluationTransform_names + 16, 6}, 2 },
};

static const int GLMRegressor_PostEvaluationTransform_entries_by_number[] = {
  1, // 0 -> NoTransform
  0, // 1 -> Logit
  2, // 2 -> Probit
};

const std::string& GLMRegressor_PostEvaluationTransform_Name(
    GLMRegressor_PostEvaluationTransform value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          GLMRegressor_PostEvaluationTransform_entries,
          GLMRegressor_PostEvaluationTransform_entries_by_number,
          3, GLMRegressor_PostEvaluationTransform_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      GLMRegressor_PostEvaluationTransform_entries,
      GLMRegressor_PostEvaluationTransform_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     GLMRegressor_PostEvaluationTransform_strings[idx].get();
}
bool GLMRegressor_PostEvaluationTransform_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GLMRegressor_PostEvaluationTransform* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      GLMRegressor_PostEvaluationTransform_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<GLMRegressor_PostEvaluationTransform>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr GLMRegressor_PostEvaluationTransform GLMRegressor::NoTransform;
constexpr GLMRegressor_PostEvaluationTransform GLMRegressor::Logit;
constexpr GLMRegressor_PostEvaluationTransform GLMRegressor::Probit;
constexpr GLMRegressor_PostEvaluationTransform GLMRegressor::PostEvaluationTransform_MIN;
constexpr GLMRegressor_PostEvaluationTransform GLMRegressor::PostEvaluationTransform_MAX;
constexpr int GLMRegressor::PostEvaluationTransform_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class GLMRegressor_DoubleArray::_Internal {
 public:
};

GLMRegressor_DoubleArray::GLMRegressor_DoubleArray(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  value_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.GLMRegressor.DoubleArray)
}
GLMRegressor_DoubleArray::GLMRegressor_DoubleArray(const GLMRegressor_DoubleArray& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      value_(from.value_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.GLMRegressor.DoubleArray)
}

inline void GLMRegressor_DoubleArray::SharedCtor() {
}

GLMRegressor_DoubleArray::~GLMRegressor_DoubleArray() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.GLMRegressor.DoubleArray)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void GLMRegressor_DoubleArray::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void GLMRegressor_DoubleArray::ArenaDtor(void* object) {
  GLMRegressor_DoubleArray* _this = reinterpret_cast< GLMRegressor_DoubleArray* >(object);
  (void)_this;
}
void GLMRegressor_DoubleArray::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void GLMRegressor_DoubleArray::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void GLMRegressor_DoubleArray::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.GLMRegressor.DoubleArray)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  value_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* GLMRegressor_DoubleArray::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated double value = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_value(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 9) {
          _internal_add_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* GLMRegressor_DoubleArray::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.GLMRegressor.DoubleArray)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated double value = 1;
  if (this->_internal_value_size() > 0) {
    target = stream->WriteFixedPacked(1, _internal_value(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:CoreML.Specification.GLMRegressor.DoubleArray)
  return target;
}

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

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated double value = 1;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_value_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GLMRegressor_DoubleArray::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const GLMRegressor_DoubleArray*>(
      &from));
}

void GLMRegressor_DoubleArray::MergeFrom(const GLMRegressor_DoubleArray& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.GLMRegressor.DoubleArray)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  value_.MergeFrom(from.value_);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GLMRegressor_DoubleArray::InternalSwap(GLMRegressor_DoubleArray* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  value_.InternalSwap(&other->value_);
}

std::string GLMRegressor_DoubleArray::GetTypeName() const {
  return "CoreML.Specification.GLMRegressor.DoubleArray";
}


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

class GLMRegressor::_Internal {
 public:
};

GLMRegressor::GLMRegressor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  weights_(arena),
  offset_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.GLMRegressor)
}
GLMRegressor::GLMRegressor(const GLMRegressor& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      weights_(from.weights_),
      offset_(from.offset_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  postevaluationtransform_ = from.postevaluationtransform_;
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.GLMRegressor)
}

inline void GLMRegressor::SharedCtor() {
postevaluationtransform_ = 0;
}

GLMRegressor::~GLMRegressor() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.GLMRegressor)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void GLMRegressor::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void GLMRegressor::ArenaDtor(void* object) {
  GLMRegressor* _this = reinterpret_cast< GLMRegressor* >(object);
  (void)_this;
}
void GLMRegressor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void GLMRegressor::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void GLMRegressor::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.GLMRegressor)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  weights_.Clear();
  offset_.Clear();
  postevaluationtransform_ = 0;
  _internal_metadata_.Clear<std::string>();
}

const char* GLMRegressor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .CoreML.Specification.GLMRegressor.DoubleArray weights = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_weights(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated double offset = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_offset(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 17) {
          _internal_add_offset(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // .CoreML.Specification.GLMRegressor.PostEvaluationTransform postEvaluationTransform = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_postevaluationtransform(static_cast<::CoreML::Specification::GLMRegressor_PostEvaluationTransform>(val));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* GLMRegressor::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.GLMRegressor)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .CoreML.Specification.GLMRegressor.DoubleArray weights = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_weights_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, this->_internal_weights(i), target, stream);
  }

  // repeated double offset = 2;
  if (this->_internal_offset_size() > 0) {
    target = stream->WriteFixedPacked(2, _internal_offset(), target);
  }

  // .CoreML.Specification.GLMRegressor.PostEvaluationTransform postEvaluationTransform = 3;
  if (this->_internal_postevaluationtransform() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->_internal_postevaluationtransform(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:CoreML.Specification.GLMRegressor)
  return target;
}

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

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .CoreML.Specification.GLMRegressor.DoubleArray weights = 1;
  total_size += 1UL * this->_internal_weights_size();
  for (const auto& msg : this->weights_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated double offset = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_offset_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // .CoreML.Specification.GLMRegressor.PostEvaluationTransform postEvaluationTransform = 3;
  if (this->_internal_postevaluationtransform() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_postevaluationtransform());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GLMRegressor::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const GLMRegressor*>(
      &from));
}

void GLMRegressor::MergeFrom(const GLMRegressor& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.GLMRegressor)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  weights_.MergeFrom(from.weights_);
  offset_.MergeFrom(from.offset_);
  if (from._internal_postevaluationtransform() != 0) {
    _internal_set_postevaluationtransform(from._internal_postevaluationtransform());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void GLMRegressor::InternalSwap(GLMRegressor* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  weights_.InternalSwap(&other->weights_);
  offset_.InternalSwap(&other->offset_);
  swap(postevaluationtransform_, other->postevaluationtransform_);
}

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


// @@protoc_insertion_point(namespace_scope)
}  // namespace Specification
}  // namespace CoreML
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::CoreML::Specification::GLMRegressor_DoubleArray* Arena::CreateMaybeMessage< ::CoreML::Specification::GLMRegressor_DoubleArray >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::GLMRegressor_DoubleArray >(arena);
}
template<> PROTOBUF_NOINLINE ::CoreML::Specification::GLMRegressor* Arena::CreateMaybeMessage< ::CoreML::Specification::GLMRegressor >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::GLMRegressor >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
