Skip to content

Commit

Permalink
Revert "Formatting, dont expect to pass style checker"
Browse files Browse the repository at this point in the history
This reverts commit 6b4d881.
  • Loading branch information
DavidH authored and DavidH committed Feb 5, 2018
1 parent 6b4d881 commit 570a8a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
6 changes: 3 additions & 3 deletions scripts/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function check_shogun_style {
fi
done

RESULT_OUTPUT="$(git clang-format --commit $BASE_COMMIT --diff --binary `which clang-format` $LIST)"
RESULT_OUTPUT="$(git clang-format-3.8 --commit $BASE_COMMIT --diff --binary `which clang-format-3.8` $LIST)"

if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
|| [ "$RESULT_OUTPUT" == "clang-format-3.8 did not modify any files" ] \
Expand All @@ -54,10 +54,10 @@ function check_shogun_style {
echo "clang-format failed."
echo "To reproduce it locally please run: "
echo -e "\t1) git checkout ${1:-}"
echo -e "\t2) git clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
echo -e "\t2) git clang-format-3.8 --commit $BASE_COMMIT --diff --binary $(which clang-format-3.8)"
echo "To fix the errors automatically please run: "
echo -e "\t1) git checkout ${1:-}"
echo -e "\t2) git clang-format --commit $BASE_COMMIT --binary $(which clang-format)"
echo -e "\t2) git clang-format-3.8 --commit $BASE_COMMIT --binary $(which clang-format-3.8)"
echo "-----"
echo "Style errors found:"
echo "$RESULT_OUTPUT"
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/kernel/CombinedKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ bool CCombinedKernel::init_with_extracted_subsets(

auto k_custom = dynamic_cast<CCustomKernel*>(k);
if (!k_custom)
SG_ERROR("Dynamic cast to custom kernel failed")
SG_ERROR(
"Dynamic cast to custom kernel failed")

// clear all previous subsets
k_custom->remove_all_row_subsets();
Expand Down
23 changes: 9 additions & 14 deletions tests/unit/kernel/CombinedKernel_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ TEST(CombinedKernelTest, test_subset_mixed)
CKernel* custom_kernel_1 = combined->get_kernel(0);
CKernel* custom_kernel_2 = combined->get_kernel(2);

SGMatrix<float64_t> gauss_matrix =
ground_truth_kernel->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_1 =
custom_kernel_1->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_2 =
custom_kernel_2->get_kernel_matrix();
SGMatrix<float64_t> gauss_matrix = ground_truth_kernel->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_1 = custom_kernel_1->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_2 = custom_kernel_2->get_kernel_matrix();

for (index_t j = 0; j < n_runs; ++j)
{
for (index_t k = 0; k < n_runs; ++k)
{
EXPECT_NEAR(gauss_matrix(j, k), custom_matrix_1(j, k), 1e-6);
EXPECT_NEAR(gauss_matrix(j, k), custom_matrix_1(j, k), 1e-6);
EXPECT_NEAR(gauss_matrix(j,k), custom_matrix_1(j,k), 1e-6);
EXPECT_NEAR(gauss_matrix(j,k), custom_matrix_1(j,k), 1e-6);
}
}

Expand Down Expand Up @@ -146,17 +143,15 @@ TEST(CombinedKernelTest, test_subset_combined_only)
CKernel* custom_kernel_2 = combined->get_kernel(1);

SGMatrix<float64_t> gauss_matrix = gaus_ck->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_1 =
custom_kernel_1->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_2 =
custom_kernel_2->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_1 = custom_kernel_1->get_kernel_matrix();
SGMatrix<float64_t> custom_matrix_2 = custom_kernel_2->get_kernel_matrix();

for (index_t j = 0; j < n_runs; ++j)
{
for (index_t k = 0; k < n_runs; ++k)
{
EXPECT_NEAR(gauss_matrix(j, k), custom_matrix_1(j, k), 1e-6);
EXPECT_NEAR(gauss_matrix(j, k), custom_matrix_1(j, k), 1e-6);
EXPECT_NEAR(gauss_matrix(j,k), custom_matrix_1(j,k), 1e-6);
EXPECT_NEAR(gauss_matrix(j,k), custom_matrix_1(j,k), 1e-6);
}
}

Expand Down

0 comments on commit 570a8a2

Please sign in to comment.