forked from pz4kybsvg/Conception
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
906 B
29 lines
906 B
/* clang-format off to disable clang-format-includes */
|
|
#include "drake/common/autodiff.h"
|
|
#include "drake/common/ad/test/standard_operations_test.h"
|
|
/* clang-format on */
|
|
|
|
namespace drake {
|
|
namespace test {
|
|
namespace {
|
|
|
|
TEST_F(AutoDiffXdTest, Pow1) {
|
|
CHECK_BINARY_FUNCTION_ADS_ADS(pow, x, y, 0.3);
|
|
CHECK_BINARY_FUNCTION_ADS_ADS(pow, x, y, -0.3);
|
|
CHECK_BINARY_FUNCTION_ADS_ADS(pow, y, x, 0.4);
|
|
CHECK_BINARY_FUNCTION_ADS_ADS(pow, y, x, -0.4);
|
|
}
|
|
|
|
TEST_F(AutoDiffXdTest, Pow2) {
|
|
CHECK_BINARY_FUNCTION_ADS_SCALAR(pow, x, y, 0.3);
|
|
CHECK_BINARY_FUNCTION_ADS_SCALAR(pow, x, y, -0.3);
|
|
CHECK_BINARY_FUNCTION_ADS_SCALAR(pow, y, x, 0.4);
|
|
CHECK_BINARY_FUNCTION_ADS_SCALAR(pow, y, x, -0.4);
|
|
// Note that Eigen's AutoDiffScalar does not provide an implementation for
|
|
// pow(double, ADS). Therefore, we do not provide tests for that here.
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace test
|
|
} // namespace drake
|