Magnetic ordering and ferroelectricity in multiferroic2H−AgFeO2: Comparison between hexagonal and rhombohedral polytypes