Some matrix helper functions for automatic ingestions of relational data