matrix library