An O(n.m) algorithm for calculating the closure of lca-type operators