update: the calculation method of VAR with paper

1. update calculation
2. split the unit test from .cpp