changeset 647:749b5aed61f6

More #include cleanups.
author ronw@google.com
date Tue, 11 Jun 2013 21:32:50 +0000
parents e76951e4da20
children 1c2a5868f23a
files carfac/carfac.cc carfac/carfac.h carfac/carfac_output.cc carfac/carfac_output.h carfac/carfac_test.cc carfac/common.h carfac/ear.cc carfac/ear.h carfac/sai.cc
diffstat 9 files changed, 27 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 <assert.h>
 
-#include "carfac.h"
+#include "carfac_output.h"
+#include "carfac_util.h"
+#include "ear.h"
 
 using std::vector;
 
--- 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.
--- 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;
 
--- 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 <vector>
 
 #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.
--- 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 <fstream>
 #include <string>
 #include <vector>
@@ -28,7 +30,7 @@
 
 #include "agc.h"
 #include "car.h"
-#include "carfac.h"
+#include "carfac_output.h"
 #include "common.h"
 #include "ihc.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 <Eigen/Dense>
+#include <Eigen/Core>
 
 // 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<FPType, Eigen::Dynamic, 1> ArrayX;
 typedef Eigen::Array<FPType, Eigen::Dynamic, Eigen::Dynamic> 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
--- 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 <assert.h>
 
-#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);
--- 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"
 
--- 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 <assert.h>
 
-#include "sai.h"
-
 SAI::SAI(const SAIParams& params) : params_(params) {
   assert(params_.window_width > params_.width &&
          "SAI window_width must be larger than width.");