ENH: add a kind of dual tree construction