Skip to content

Commit

Permalink
addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobaustin123 committed Apr 18, 2020
1 parent 1ee259d commit 67f9edf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/autoppl/expression/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct var_traits
using pointer_t = typename VarType::pointer_t;
using state_t = typename VarType::state_t;

// TODO may have to move this to a different class for compile-time checking
static_assert(std::is_convertible_v<VarType, value_t>);
};

Expand Down
9 changes: 9 additions & 0 deletions test/distribution/normal_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ TEST_F(normal_dist_fixture, simple_gaussian) {
EXPECT_DOUBLE_EQ(dist1.log_pdf(0.0), std::log(dist1.pdf(0.0)));
EXPECT_DOUBLE_EQ(dist1.log_pdf(-0.5), std::log(dist1.pdf(-0.5)));
EXPECT_DOUBLE_EQ(dist1.log_pdf(4), std::log(dist1.pdf(4)));


EXPECT_DOUBLE_EQ(dist2.pdf(0.0), 0.3989422804014327);
EXPECT_DOUBLE_EQ(dist2.pdf(-0.5), 0.3520653267642995);
EXPECT_DOUBLE_EQ(dist2.pdf(4), 0.00013383022576488537);

EXPECT_DOUBLE_EQ(dist2.log_pdf(0.0), std::log(dist2.pdf(0.0)));
EXPECT_DOUBLE_EQ(dist2.log_pdf(-0.5), std::log(dist2.pdf(-0.5)));
EXPECT_DOUBLE_EQ(dist2.log_pdf(4), std::log(dist1.pdf(4)));
}

} // ppl

0 comments on commit 67f9edf

Please sign in to comment.