function Y=arrshift(O,X)
% arrshift - columnwise or rowwise subtraction for arrays
%
% This SUBTRACTS the first argument (a vector) from each
% of the vectors (row or column) in the second argument.
% Works in two modes: row vector or column vector mode.
%
% arrshift :: 
%    [Size] ~'values to subtract', 
%    [[N,M]] ~'array of vectors, array domain is M'
% -> [[N,M]] ~'vectors relative to new origin'.
%
% The first argument is REPMATed up to the size of
% the second and then subtracted.
%
% NB: this used to be called vecshift. vecshift is now
% specialised to subtract a COLUMN vector from an array
% the same size in the first dimension. This version
% retains the generality of the original vecshift.

% note: this now works for any pair of arrays where size O
% is an integer fraction of size X in any dimension
Y=X-repmat_to(O,size(X));

