From b576887e8f485d4bffd8bf74c2a5d6994664a9cd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Nov 2025 02:17:03 +0000 Subject: [PATCH] Fix build errors in PR #11 - Fix SigGrad template function compilation error by using Diff(T(1), mat) instead of Diff(1, mat) to properly cast the literal - Fix printf format specifiers in matrix.cpp (%0.2l -> %ld, %0.2d -> %d, %0.2u -> %u) - Remove invalid precision specifiers from integer format strings These changes resolve the compilation errors that were preventing the PR build from succeeding. --- Matrix/matrix.cpp | 6 +++--- network.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Matrix/matrix.cpp b/Matrix/matrix.cpp index 36d1bae..9273aca 100644 --- a/Matrix/matrix.cpp +++ b/Matrix/matrix.cpp @@ -384,15 +384,15 @@ void matrix_print_value(T& v, char* comma) { template <> void matrix_print_value(int& v, char* comma) { - printf("%0.2d%s ", v, comma); + printf("%d%s ", v, comma); } template <> void matrix_print_value(unsigned int& v, char* comma) { - printf("%0.2u%s ", v, comma); + printf("%u%s ", v, comma); } template <> void matrix_print_value(long& v, char* comma) { - printf("%0.2l%s ", v, comma); + printf("%ld%s ", v, comma); } template diff --git a/network.h b/network.h index 600a31d..06bb63f 100644 --- a/network.h +++ b/network.h @@ -74,7 +74,7 @@ namespace ml { template ml::Mat SigGrad(ml::Mat mat) { - return ml::ElementMult(mat, ml::Diff(1, mat)); + return ElementMult(mat, Diff(T(1), mat)); } }