# HG changeset patch # User ronw@google.com # Date 1370986370 0 # Node ID 749b5aed61f6c8b83ac4e4599eccd30b2bce7b25 # Parent e76951e4da2089aec9b6fb1465fb820c47fc471e More #include cleanups. diff -r e76951e4da20 -r 749b5aed61f6 carfac/carfac.cc --- a/carfac/carfac.cc Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/carfac.cc Tue Jun 11 21:32:50 2013 +0000 @@ -20,9 +20,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "carfac.h" + #include -#include "carfac.h" +#include "carfac_output.h" +#include "carfac_util.h" +#include "ear.h" using std::vector; diff -r e76951e4da20 -r 749b5aed61f6 carfac/carfac.h --- a/carfac/carfac.h Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/carfac.h Tue Jun 11 21:32:50 2013 +0000 @@ -27,12 +27,12 @@ #include "agc.h" #include "car.h" -#include "carfac_output.h" -#include "carfac_util.h" #include "common.h" -#include "ear.h" #include "ihc.h" +class CARFACOutput; +class Ear; + // Top-level class implementing the CAR-FAC C++ model. See the chapter entitled // 'The CAR-FAC Digital Cochlear Model' in Lyon's book "Human and Machine // Hearing" for an overview. diff -r e76951e4da20 -r 749b5aed61f6 carfac/carfac_output.cc --- a/carfac/carfac_output.cc Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/carfac_output.cc Tue Jun 11 21:32:50 2013 +0000 @@ -21,6 +21,7 @@ // limitations under the License. #include "carfac_output.h" +#include "ear.h" using std::vector; diff -r e76951e4da20 -r 749b5aed61f6 carfac/carfac_output.h --- a/carfac/carfac_output.h Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/carfac_output.h Tue Jun 11 21:32:50 2013 +0000 @@ -27,7 +27,8 @@ #include #include "common.h" -#include "ear.h" + +class Ear; // Container for the different types of output from a CARFAC model. See the // private members below for details. diff -r e76951e4da20 -r 749b5aed61f6 carfac/carfac_test.cc --- a/carfac/carfac_test.cc Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/carfac_test.cc Tue Jun 11 21:32:50 2013 +0000 @@ -20,6 +20,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "carfac.h" + #include #include #include @@ -28,7 +30,7 @@ #include "agc.h" #include "car.h" -#include "carfac.h" +#include "carfac_output.h" #include "common.h" #include "ihc.h" diff -r e76951e4da20 -r 749b5aed61f6 carfac/common.h --- a/carfac/common.h Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/common.h Tue Jun 11 21:32:50 2013 +0000 @@ -23,15 +23,9 @@ #ifndef CARFAC_COMMON_H #define CARFAC_COMMON_H -// This macro disallows the copy constructor and operator= functions. -// This should be used in the private: declarations for a class. -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - void operator=(const TypeName&) - // The Eigen library is used extensively for floating point arrays. // For more information, see: http://eigen.tuxfamily.org -#include +#include // The 'FPType' typedef is used to enable easy switching in precision level. // It's currently set to double for during the unit testing phase of the @@ -42,7 +36,12 @@ typedef Eigen::Array ArrayX; typedef Eigen::Array ArrayXX; -// A fixed value of PI is defined throughout the project. static const FPType kPi = 3.141592653589793238; +// This macro disallows the copy constructor and operator= functions. +// This should be used in the private: declarations for a class. +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + #endif // CARFAC_COMMON_H diff -r e76951e4da20 -r 749b5aed61f6 carfac/ear.cc --- a/carfac/ear.cc Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/ear.cc Tue Jun 11 21:32:50 2013 +0000 @@ -20,9 +20,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "ear.h" + #include -#include "ear.h" +#include "carfac_util.h" Ear::Ear(const int num_channels, const CARCoeffs& car_coeffs, const IHCCoeffs& ihc_coeffs, @@ -152,7 +154,7 @@ ((ihc_state_.cap1_voltage - ihc_state_.cap2_voltage) * ihc_coeffs_.in2_rate); } - // Here we smooth the output twice using a LPF. + // Smooth the output twice using an LPF. ihc_state_.ihc_out *= ihc_coeffs_.output_gain; ihc_state_.lpf1_state += ihc_coeffs_.lpf_coeff * (ihc_state_.ihc_out - ihc_state_.lpf1_state); diff -r e76951e4da20 -r 749b5aed61f6 carfac/ear.h --- a/carfac/ear.h Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/ear.h Tue Jun 11 21:32:50 2013 +0000 @@ -27,7 +27,6 @@ #include "agc.h" #include "car.h" -#include "carfac_util.h" #include "common.h" #include "ihc.h" diff -r e76951e4da20 -r 749b5aed61f6 carfac/sai.cc --- a/carfac/sai.cc Tue Jun 11 20:41:15 2013 +0000 +++ b/carfac/sai.cc Tue Jun 11 21:32:50 2013 +0000 @@ -17,10 +17,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "sai.h" + #include -#include "sai.h" - SAI::SAI(const SAIParams& params) : params_(params) { assert(params_.window_width > params_.width && "SAI window_width must be larger than width.");