added ap function, moved typedefs to wrt_ap.hxx