::google::protobuf::uint8* DMatches::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // optional uint32 queryIdx = 1;
  if (has_queryidx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->queryidx(), target);
  }
  
  // optional uint32 trainIdx = 2;
  if (has_trainidx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->trainidx(), target);
  }
  
  // optional uint32 imgIdx = 3;
  if (has_imgidx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->imgidx(), target);
  }
  
  // optional float distance = 4;
  if (has_distance()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->distance(), target);
  }
  
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}
 // ----------------------------------------------------------------------
 bool
 LocalizationNeighborInfo::
 is_confident( void )
    const throw()
 {
    return confidence() != 0 && !is_twin() && has_pos() && has_distance();
 }
void DMatches::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional uint32 queryIdx = 1;
  if (has_queryidx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->queryidx(), output);
  }
  
  // optional uint32 trainIdx = 2;
  if (has_trainidx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->trainidx(), output);
  }
  
  // optional uint32 imgIdx = 3;
  if (has_imgidx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->imgidx(), output);
  }
  
  // optional float distance = 4;
  if (has_distance()) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->distance(), output);
  }
  
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}
 // ----------------------------------------------------------------------
 bool
 LocalizationNeighborInfo::
 is_valid( void )
    const throw()
 {
    return ( has_pos() && has_distance() );
 }
int DMatches::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional uint32 queryIdx = 1;
    if (has_queryidx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->queryidx());
    }
    
    // optional uint32 trainIdx = 2;
    if (has_trainidx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->trainidx());
    }
    
    // optional uint32 imgIdx = 3;
    if (has_imgidx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->imgidx());
    }
    
    // optional float distance = 4;
    if (has_distance()) {
      total_size += 1 + 4;
    }
    
  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}