function b = innerproduct(a,x)

[n,m1] = size(a);
[n2,m2] = size(x);

if (n ~= n2) | (m1 ~= 1) | (m2 ~= 1)
	error('the inputs must be column vectors of same dimenion')
end

b = 0;

for j = 1:n
	b = b + a(j)*x(j);
end

return