Although it may seem strange to us, the great Roman thermae often contained libraries; they were actually health spas, cultural complexes, and social gathering places rather than simply places to get clean. It is thought that the library was located in the southwest exedra of Trajan's Baths (see arrow).
The later Baths of Caracalla also had a library, which had mosaic floors like these. (Navigation aid: layout of the virtual Baths of Trajan)