---
name: "PGAHammingDistance"
section: "3"
platform: "linux"
package: "pgapack"
version: "1.0.0.1-3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/PGAHammingDistance"
---

# PGAHammingDistance(3)

Calculates the mean Hamming distance for a population of binary strings. For all other data types returns a value of 0.0 and prints a warning message.

## NAME

PGAHammingDistance - Calculates the mean Hamming distance for a population of binary strings.  For all other data types returns a value of 0.0 and prints a warning message.

## INPUT PARAMETERS

- ctx

  \- context variable

- popindex

  \- symbolic constant of the population for which the Hamming distance is to be calculated Output: The mean Hamming distance in the population

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
double  PGAHammingDistance(ctx, popindex)
PGAContext *ctx
int popindex
```

## LOCATION

hamming.c

## EXAMPLE

```
:
hd = PGAHammingDistance(ctx, PGA_NEWPOP);
```
