added const for sum() in accumulator and tests for get_lp for double and var inputs