Cyclizes part of a (1->4)-alpha-D-glucan chain by formation of a (1->4)-alpha-D-glucosidic bond. Binds 2 calcium ions per subunit. Monomer. May consist of two protein domains: the one in the N-terminal side cleaves the alpha-1,4-glucosidic bond in starch, and the other in the C-terminal side catalyzes other activities, including the reconstitution of an alpha-1,4-glucosidic linkage for cyclizing the maltooligosaccharide produced. Belongs to the glycosyl hydrolase 13 family.