calculate upper triangle, and just copy it to construct W