aresid

void aresid(double* first, double* last, double val)

Replaces the elements in [first, last) with thier absolute deviations from val.

Parameters:
firstBeginning iterator for the container of elements.
lastEnding iterator for the container of elements.
valPivot value

Returns:
On return, the elements of [first, last) are replaced with thier residuals.

Usage:

double x[] = {1.0, 2.0, 3.0, 4.0};
aresid(x, x + 4, 2.5);

Header:
#include "residual.h"