load from file, and compute matrix