replacing dscal_ with std::for_each

better to minimize BLAS1 calls