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:
first1 | Beginning iterator for the first container of elements. |
---|---|
last1 | Ending iterator for the first container of elements. |
first2 | Beginning iterator for the second container of elements. |
last2 | Ending iterator for the second container of elements. |
dest | Beginning 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"