Diff from to

# File code/H_I_D_A_C/utilities/estimate_Dtemp2.m

 function [Dtemp2] = estimate_Dtemp2(X,Y,co)
-%Estimates Dtemp2 = \int p^a(x)q^b(x)dx; the Hellinger distance and the Bhattacharyya distance are simple functions of this quantity.
+%Estimates Dtemp2 = \int p^a(u)q^b(u)p(u)du; the Hellinger distance and the Bhattacharyya distance are simple functions of this quantity.
 %
 %INPUT:
-%   X: X(:,t) is the t^th sample from the first distribution.
-%   Y: Y(:,t) is the t^th sample from the second distribution.
+%   X: X(:,t) is the t^th sample from the first distribution (X~p).
+%   Y: Y(:,t) is the t^th sample from the second distribution (Y~q).
 %  co: cost object (structure).
 %
 %Copyright (C) 2012 Zoltan Szabo ("http://nipg.inf.elte.hu/szzoli", "szzoli (at) cs (dot) elte (dot) hu")
 %You should have received a copy of the GNU General Public License along with ITE. If not, see <http://www.gnu.org/licenses/>.

 %initialization:
-    [d,num_of_samplesY] = size(Y);
-    [d,num_of_samplesX] = size(X);
+    [dY,num_of_samplesY] = size(Y);
+    [dX,num_of_samplesX] = size(X);
+
+%verification:
+    if dX~=dY
+        error('The dimension of the samples in X and Y must be equal.');
+    end
+
+%initialization - continued:
+    d = dX; %=dY
     a = co.a;
     b = co.b;
     k = co.k;