pairwdiff

void pairwdiff(double* first1, double* last1, double* first2, double* last2, double* dest);

Computes the pairwise differences between the elements in [first1, last1) and the elements in [first2, last2) and places them in dest. dest must be large enough to hold all of the m * n differences, where m = slast - sfirst and n = tlast - tfirst.

Parameters:
first1Beginning iterator for the first container of elements.
last1Ending iterator for the first container of elements.
first2Beginning iterator for the second container of elements.
last2Ending iterator for the second container of elements.
destBeginning iterator for the destination container.

Returns:
On exit, [dest, dest + m * n) contains the pairwise differences

Usage:
double s[4] = {1, 2, 3, 4};
double t[4] = {2, 4, 5, 10, 11};
double d[16];
pairwdiff(s, s + 4, t, t + 5, d);

Header:
#include "algorthm.h"