A generalization of Voronoi's reduction theory and its application