function [i,j,k] = linear2triple_index(N,I,J,K)
%--- conversion of linear index of 3D array into three indices --
%      N - linear index
%   I,J,K - sizes of 3D array
IJ=I.*J;
k=ceil(N./(IJ));
IJk=IJ.*(k-1);
j=ceil( (N-IJk)./I );
i=N-IJk-(j-1).*I;
