Dual Methods in Entropy Maximization. Application to Some Problems in Crystallography