Skip to content

Commit

Permalink
{set_}scale -> prescale{d}_by
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Aug 9, 2019
1 parent 309f18a commit 93f3cfa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Following is a brief summary of changes made in each release of Libint.
- 2019-08-09: 2.7.0-beta.1
- PR #142: fixed cmake build of fortran interface (HT @pseewald )
- PR #141: can buile shared and static libs in one shot (HT @francesco-bosia )
- added Engine::{set_}scale that allows scaling target ints
- added Engine::prescale_by that allows scaling target ints

- 2019-07-23: 2.6.0
- fixed initialization order error in unit test
Expand Down
2 changes: 1 addition & 1 deletion doc/wiki
Submodule wiki updated from 250c94 to c82929
4 changes: 2 additions & 2 deletions include/libint2/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -798,14 +798,14 @@ class Engine {
}

/// @return the scaling factor by which the target integrals are multiplied
scalar_type scale() const {
scalar_type prescaled_by() const {
return scale_;
}

/// @param[in] sc the scaling factor by which the target integrals are multiplied
/// @note the default factor is 1
/// @return reference to @c this for daisy-chaining
Engine& set_scale(scalar_type sc) {
Engine& prescale_by(scalar_type sc) {
scale_ = sc;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test-1body.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TEST_CASE_METHOD(libint2::unit::DefaultFixture, "electrostatic potential", "[eng
engine.set_params(make_point_charges(atoms));

const auto scale = 2.3;
engine.set_scale(scale);
engine.prescale_by(scale);
engine.compute(obs[0], obs[0]);
{
std::vector<double> shellset_ref = {
Expand All @@ -38,7 +38,7 @@ TEST_CASE_METHOD(libint2::unit::DefaultFixture, "electrostatic potential", "[eng
}
}

engine.set_scale(1);
engine.prescale_by(1);
engine.compute(obs[0], obs[1]);
{
std::vector<double> shellset_ref = {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test-2body.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ TEST_CASE("Slater/Yukawa integrals", "[engine][2-body]") {
for (int k = -1; k <= 0; ++k) {
auto engine = Engine(k == 0 ? Operator::stg : Operator::yukawa, max_nprim, max_l);
const auto scale = 2.3;
engine.set_params(1.0).set_scale(scale);
REQUIRE(engine.scale() == scale);
engine.set_params(1.0).prescale_by(scale);
REQUIRE(engine.prescaled_by() == scale);
const auto &results = engine.results();
auto engine_ref =
Engine(k == 0 ? Operator::cgtg : Operator::cgtg_x_coulomb, max_nprim, max_l);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test-core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ TEST_CASE("Engine::set", "[engine]") {
REQUIRE_THROWS_AS(Engine{}.set(Operator::overlap), Engine::using_default_initialized);
REQUIRE_THROWS_AS(Engine{}.set(BraKet::x_x), Engine::using_default_initialized);
REQUIRE_NOTHROW(Engine{}.set(CartesianShellNormalization::uniform));
REQUIRE_NOTHROW(Engine{}.set_scale(1.5));
REQUIRE_NOTHROW(Engine(Operator::overlap, 1, 0).set(CartesianShellNormalization::uniform).set_precision(1e-20).set(Operator::overlap).set_scale(1.3).set(BraKet::x_x));
REQUIRE_NOTHROW(Engine{}.prescale_by(1.5));
REQUIRE_NOTHROW(Engine(Operator::overlap, 1, 0).set(CartesianShellNormalization::uniform).set_precision(1e-20).set(Operator::overlap).prescale_by(1.3).set(BraKet::x_x));
}

template <typename RealBuf> void check_uniform(int l, RealBuf && S) {
Expand Down

0 comments on commit 93f3cfa

Please sign in to comment.