소스 검색

Cleaning up MSVC compiler warnings

add-code-of-conduct-1
John Daily 5 년 전
부모
커밋
6f23d0d820

+ 1
- 1
Modules/FDEM1D/include/FHT.h 파일 보기

267
 
267
 
268
         // lambda needs to be expanded to include lagged results
268
         // lambda needs to be expanded to include lagged results
269
         VectorXr lambda = (VectorXr(WT.rows()+nlag) << WT.col(0).array()/rho, VectorXr::Zero(nlag)).finished();
269
         VectorXr lambda = (VectorXr(WT.rows()+nlag) << WT.col(0).array()/rho, VectorXr::Zero(nlag)).finished();
270
-        for (int ilam =WT.rows(); ilam< nlag+WT.rows(); ++ilam) {
270
+        for (Index ilam = WT.rows(); ilam< nlag+WT.rows(); ++ilam) {
271
             lambda(ilam) = lambda(ilam-1)/GetABSER();
271
             lambda(ilam) = lambda(ilam-1)/GetABSER();
272
         }
272
         }
273
 
273
 

+ 1
- 1
Modules/FDEM1D/include/HankelTransformFactory.h 파일 보기

119
                     return FHT<IRONS>::NewSP();
119
                     return FHT<IRONS>::NewSP();
120
                 default:
120
                 default:
121
                     std::cerr << "HankelTransformFactory only works with defined types\n";
121
                     std::cerr << "HankelTransformFactory only works with defined types\n";
122
+                    return FHTAnderson801::NewSP(); // dummy return 
122
             }
123
             }
123
-
124
         }
124
         }
125
 
125
 
126
         /**
126
         /**

+ 2
- 2
Modules/FDEM1D/include/KernelEM1DBase.h 파일 보기

67
 
67
 
68
             virtual void SetMode(const EMMODE& mode)=0;
68
             virtual void SetMode(const EMMODE& mode)=0;
69
 
69
 
70
-            int GetManagerIndex() const {
70
+            Index GetManagerIndex() const {
71
                 return this->managerIdx;
71
                 return this->managerIdx;
72
             }
72
             }
73
 
73
 
91
             // ====================  DATA MEMBERS  =========================
91
             // ====================  DATA MEMBERS  =========================
92
 
92
 
93
             /** Where does this kernel live on the vector managed by the manager */
93
             /** Where does this kernel live on the vector managed by the manager */
94
-            int  managerIdx;
94
+            Index  managerIdx;
95
 
95
 
96
         private:
96
         private:
97
 
97
 

+ 1
- 1
Modules/FDEM1D/include/WireAntenna.h 파일 보기

165
               * returns number of dipoles used to approximate this
165
               * returns number of dipoles used to approximate this
166
               * loop
166
               * loop
167
 			  */
167
 			  */
168
-            int GetNumberOfDipoles();
168
+            size_t GetNumberOfDipoles();
169
 
169
 
170
 			/**
170
 			/**
171
               * @return the number of frequencies of this wire loop.
171
               * @return the number of frequencies of this wire loop.

+ 2
- 2
Modules/FDEM1D/src/AEMSurveyReader.cpp 파일 보기

105
         int nb = Parser->ReadInts(1)[0];  // number of locations
105
         int nb = Parser->ReadInts(1)[0];  // number of locations
106
         for (int ib=0; ib<nb; ++ib) {
106
         for (int ib=0; ib<nb; ++ib) {
107
             std::vector<Real> rvals = Parser->ReadReals(6); // position and moment
107
             std::vector<Real> rvals = Parser->ReadReals(6); // position and moment
108
-            int bp = Parser->GetFileLocation(  );
108
+	    std::streamoff bp = Parser->GetFileLocation(  );
109
             Parser->JumpToLocation( 0 );
109
             Parser->JumpToLocation( 0 );
110
             //std::vector<int> ivals = Parser->ReadInts(1);   // number of frequencies
110
             //std::vector<int> ivals = Parser->ReadInts(1);   // number of frequencies
111
             int nf = Parser->ReadInts(1)[0];   // number of frequencies
111
             int nf = Parser->ReadInts(1)[0];   // number of frequencies
112
             for (int isc=0; isc<nf; ++isc) {
112
             for (int isc=0; isc<nf; ++isc) {
113
                 Survey->Sources.push_back(DipoleSource::NewSP());
113
                 Survey->Sources.push_back(DipoleSource::NewSP());
114
-                int cnt = Survey->Sources.size() - 1; //
114
+                size_t cnt = Survey->Sources.size() - 1; //
115
                 // and now set it
115
                 // and now set it
116
                 Survey->Sources[cnt]->SetNumberOfFrequencies(1);
116
                 Survey->Sources[cnt]->SetNumberOfFrequencies(1);
117
                 Survey->Sources[cnt]->SetFrequency(0, Parser->ReadReals(1)[0]);
117
                 Survey->Sources[cnt]->SetFrequency(0, Parser->ReadReals(1)[0]);

+ 1
- 2
Modules/FDEM1D/src/DipoleSource.cpp 파일 보기

8
   @file
8
   @file
9
   @author   Trevor Irons
9
   @author   Trevor Irons
10
   @date     12/02/2009
10
   @date     12/02/2009
11
-  @version  $Id: dipolesource.cpp 203 2015-01-09 21:19:04Z tirons $
12
  **/
11
  **/
13
 
12
 
14
 #include "DipoleSource.h"
13
 #include "DipoleSource.h"
1266
     }
1265
     }
1267
 
1266
 
1268
     int DipoleSource::GetNumberOfFrequencies() {
1267
     int DipoleSource::GetNumberOfFrequencies() {
1269
-        return this->Freqs.size();
1268
+        return (int)(this->Freqs.size());
1270
     }
1269
     }
1271
 
1270
 
1272
     void DipoleSource::SetNumberOfFrequencies(const int &nfreq){
1271
     void DipoleSource::SetNumberOfFrequencies(const int &nfreq){

+ 4
- 2
Modules/FDEM1D/src/GQChave.cpp 파일 보기

544
         np  = 0; // TI, zero based indexing
544
         np  = 0; // TI, zero based indexing
545
 
545
 
546
         int  NPB   = 1; // 0?
546
         int  NPB   = 1; // 0?
547
-        int  L     = 0; // TODO, should be 0?
547
+        int  L     = 0; 
548
         Real B     = 0.;
548
         Real B     = 0.;
549
         Real A     = 0.;
549
         Real A     = 0.;
550
         Real SUMR  = 0.;
550
         Real SUMR  = 0.;
580
                     LASTI=XSUMI;
580
                     LASTI=XSUMI;
581
                 }
581
                 }
582
             }
582
             }
583
-            while (ZeroJ(NPB,IORDER) > XSUM(NSUM*rho)) {
583
+	    // TODO, evaluate this case triggering cerr, as well as sttement below
584
+            //while ( ZeroJ(NPB,IORDER) > XSUM(NSUM*rho)) {
585
+            while ( ZeroJ(NPB,IORDER) > XSUM( (int)(NSUM*rho) )) {
584
                 ++NPB;
586
                 ++NPB;
585
             }
587
             }
586
         }
588
         }

+ 3
- 4
Modules/FDEM1D/src/WireAntenna.cpp 파일 보기

8
   @file
8
   @file
9
   @author   Trevor Irons
9
   @author   Trevor Irons
10
   @date     12/16/2009
10
   @date     12/16/2009
11
-  @version  $Id: wireantenna.cpp 199 2014-12-29 19:25:20Z tirons $
12
  **/
11
  **/
13
 
12
 
14
 #include "WireAntenna.h"
13
 #include "WireAntenna.h"
119
     }
118
     }
120
 
119
 
121
     int WireAntenna::GetNumberOfFrequencies() {
120
     int WireAntenna::GetNumberOfFrequencies() {
122
-        return Freqs.size();
121
+        return (int)(Freqs.size());  // Index to int
123
     }
122
     }
124
 
123
 
125
     Vector3Xr WireAntenna::GetPoints() {
124
     Vector3Xr WireAntenna::GetPoints() {
223
 
222
 
224
     // ====================  INQUIRY       =======================
223
     // ====================  INQUIRY       =======================
225
 
224
 
226
-    int WireAntenna::GetNumberOfDipoles() {
227
-        return Dipoles.size();
225
+    size_t WireAntenna::GetNumberOfDipoles() {
226
+        return Dipoles.size();  // size_t to int
228
     }
227
     }
229
 
228
 
230
     std::shared_ptr<DipoleSource> WireAntenna::GetDipoleSource(const int &dip) {
229
     std::shared_ptr<DipoleSource> WireAntenna::GetDipoleSource(const int &dip) {

+ 4
- 5
Modules/LemmaCore/include/ASCIIParser.h 파일 보기

10
 /**
10
 /**
11
  * @file
11
  * @file
12
  * @date      09/23/2013 02:31:24 PM
12
  * @date      09/23/2013 02:31:24 PM
13
- * @version   $Id$
14
  * @author    Trevor Irons (ti)
13
  * @author    Trevor Irons (ti)
15
- * @email     Trevor.Irons@xri-geo.com
16
- * @copyright Copyright (c) 2013, Trevor Irons
14
+ * @email     Trevor.Irons@LemmaSoftware.org
15
+ * @copyright Copyright (c) 2013, 2018 Trevor Irons
17
  */
16
  */
18
 
17
 
19
 #ifndef  ASCIIPARSER_INC
18
 #ifndef  ASCIIPARSER_INC
116
     /**
115
     /**
117
      * @param[in] loc is the point in the file to jump to. Uses seekg
116
      * @param[in] loc is the point in the file to jump to. Uses seekg
118
      */
117
      */
119
-    void JumpToLocation(const int& loc);
118
+    void JumpToLocation(const std::streamoff& loc);
120
 
119
 
121
     // ====================  ACCESS        =======================
120
     // ====================  ACCESS        =======================
122
 
121
 
135
     /**
134
     /**
136
      * @return the current position in the file, as reported by istream::tellg
135
      * @return the current position in the file, as reported by istream::tellg
137
      */
136
      */
138
-    int GetFileLocation();
137
+    std::streamoff GetFileLocation();
139
 
138
 
140
     /** Returns the name of the underlying class, similiar to Python's type */
139
     /** Returns the name of the underlying class, similiar to Python's type */
141
     virtual std::string GetName() const;
140
     virtual std::string GetName() const;

+ 3
- 3
Modules/LemmaCore/include/CubicSplineInterpolator.h 파일 보기

34
     SplineSet( ) {
34
     SplineSet( ) {
35
     }
35
     }
36
 
36
 
37
-    SplineSet(const int&n) {
37
+    SplineSet(const Index& n) {
38
         a = VectorXr::Zero(n+1);
38
         a = VectorXr::Zero(n+1);
39
         b = VectorXr::Zero(n);
39
         b = VectorXr::Zero(n);
40
         c = VectorXr::Zero(n+1);
40
         c = VectorXr::Zero(n+1);
163
 
163
 
164
     /** Finds the interval of knots in spline to use for integration.
164
     /** Finds the interval of knots in spline to use for integration.
165
      */
165
      */
166
-    int Interval(const Real& x);
166
+    Index Interval(const Real& x);
167
 
167
 
168
     private:
168
     private:
169
 
169
 
175
 
175
 
176
     SplineSet Spline;
176
     SplineSet Spline;
177
 
177
 
178
-    int ilo;
178
+    Index ilo;
179
 
179
 
180
     int mflag;
180
     int mflag;
181
 
181
 

+ 3
- 1
Modules/LemmaCore/include/lemma.h 파일 보기

213
         /// A 3 component Eigen vector of Reals
213
         /// A 3 component Eigen vector of Reals
214
         typedef Eigen::Matrix<Real, 3, 1> Vector3r;
214
         typedef Eigen::Matrix<Real, 3, 1> Vector3r;
215
 
215
 
216
-        /// A 3 X Dynamic Component Eigen matrix of Reals
216
+        typedef Eigen::Matrix<Real, Eigen::Dynamic, 1>::Index Index;
217
+        
218
+	/// A 3 X Dynamic Component Eigen matrix of Reals
217
         typedef Eigen::Matrix<Real, 3, Eigen::Dynamic> Vector3Xr;
219
         typedef Eigen::Matrix<Real, 3, Eigen::Dynamic> Vector3Xr;
218
 
220
 
219
         /// Variable length Eigen vector of Reals
221
         /// Variable length Eigen vector of Reals

+ 5
- 6
Modules/LemmaCore/src/ASCIIParser.cpp 파일 보기

10
 /**
10
 /**
11
  * @file
11
  * @file
12
  * @date      09/23/2013 02:33:41 PM
12
  * @date      09/23/2013 02:33:41 PM
13
- * @version   $Id$
14
  * @author    Trevor Irons (ti)
13
  * @author    Trevor Irons (ti)
15
- * @email     Trevor.Irons@xri-geo.com
16
- * @copyright Copyright (c) 2013, Trevor Irons
14
+ * @email     Trevor.Irons@Lemmasoftware.org
15
+ * @copyright Copyright (c) 2013,2018 Trevor Irons
17
  */
16
  */
18
 
17
 
19
 #include "ASCIIParser.h"
18
 #include "ASCIIParser.h"
24
     // ====================  FRIEND METHODS  =====================
23
     // ====================  FRIEND METHODS  =====================
25
 
24
 
26
     std::ostream &operator << (std::ostream &stream, const ASCIIParser &ob) {
25
     std::ostream &operator << (std::ostream &stream, const ASCIIParser &ob) {
27
-        stream << ob.Serialize()  << "\n---\n"; // End of doc
26
+        stream << ob.Serialize()  << "\n"; 
28
         return stream;
27
         return stream;
29
     }
28
     }
30
 
29
 
211
     //       Class:  ASCIIParser
210
     //       Class:  ASCIIParser
212
     //      Method:  GetFileLocation
211
     //      Method:  GetFileLocation
213
     //--------------------------------------------------------------------------------------
212
     //--------------------------------------------------------------------------------------
214
-    int ASCIIParser::GetFileLocation (  ) {
213
+    std::streamoff ASCIIParser::GetFileLocation (  ) {
215
         return input.tellg();
214
         return input.tellg();
216
     }		// -----  end of method ASCIIParser::GetFileLocation  -----
215
     }		// -----  end of method ASCIIParser::GetFileLocation  -----
217
 
216
 
219
     //       Class:  ASCIIParser
218
     //       Class:  ASCIIParser
220
     //      Method:  JumpToLocation
219
     //      Method:  JumpToLocation
221
     //--------------------------------------------------------------------------------------
220
     //--------------------------------------------------------------------------------------
222
-    void ASCIIParser::JumpToLocation ( const int& loc ) {
221
+    void ASCIIParser::JumpToLocation ( const std::streamoff& loc ) {
223
         input.seekg( loc );
222
         input.seekg( loc );
224
         return ;
223
         return ;
225
     }		// -----  end of method ASCIIParser::JumpToLocation  -----
224
     }		// -----  end of method ASCIIParser::JumpToLocation  -----

+ 19
- 19
Modules/LemmaCore/src/CubicSplineInterpolator.cpp 파일 보기

101
     //--------------------------------------------------------------------------------------
101
     //--------------------------------------------------------------------------------------
102
     void CubicSplineInterpolator::SetKnots ( const VectorXr& x, const VectorXr& y ) {
102
     void CubicSplineInterpolator::SetKnots ( const VectorXr& x, const VectorXr& y ) {
103
 
103
 
104
-        int n = x.size()-1;
104
+        //int n = x.size()-1;
105
+        Index n = x.size()-1;
105
 
106
 
106
         Spline = SplineSet(n);
107
         Spline = SplineSet(n);
107
 
108
 
108
         Spline.a = y;
109
         Spline.a = y;
109
         Spline.x = x;
110
         Spline.x = x;
110
         VectorXr h = VectorXr::Zero(n);
111
         VectorXr h = VectorXr::Zero(n);
111
-        for(int i=0; i<n; ++i)
112
+        for(Index i=0; i<n; ++i)
112
             h(i) = Spline.x(i+1)-Spline.x(i);
113
             h(i) = Spline.x(i+1)-Spline.x(i);
113
 
114
 
114
         VectorXr alpha(n-1);
115
         VectorXr alpha(n-1);
115
-        for(int i=1; i<n-1; ++i)
116
+        for(Index i=1; i<n-1; ++i)
116
             alpha(i) =  3.*(Spline.a[i+1]-Spline.a[i])/h[i] - 3.*(Spline.a[i]-Spline.a[i-1])/h[i-1] ;
117
             alpha(i) =  3.*(Spline.a[i+1]-Spline.a[i])/h[i] - 3.*(Spline.a[i]-Spline.a[i-1])/h[i-1] ;
117
 
118
 
118
         VectorXr l = VectorXr::Zero(n+1);
119
         VectorXr l = VectorXr::Zero(n+1);
122
         mu[0] = 0;
123
         mu[0] = 0;
123
         z[0] = 0;
124
         z[0] = 0;
124
 
125
 
125
-        for(int i = 1; i < n-1; ++i) {
126
+        for(Index i = 1; i < n-1; ++i) {
126
             l[i] = 2 *(Spline.x[i+1]-Spline.x[i-1])-h[i-1]*mu[i-1];
127
             l[i] = 2 *(Spline.x[i+1]-Spline.x[i-1])-h[i-1]*mu[i-1];
127
             mu[i] = h[i]/l[i];
128
             mu[i] = h[i]/l[i];
128
             z[i] = (alpha[i]-h[i-1]*z[i-1])/l[i];
129
             z[i] = (alpha[i]-h[i-1]*z[i-1])/l[i];
130
         l[n] = 1;
131
         l[n] = 1;
131
         z[n] = 0;
132
         z[n] = 0;
132
 
133
 
133
-        for(int j = n-1; j >= 0; --j) {
134
+        for(Index j = n-1; j >= 0; --j) {
134
             Spline.c[j] = z[j] - mu[j] * Spline.c[j+1];
135
             Spline.c[j] = z[j] - mu[j] * Spline.c[j+1];
135
             Spline.b[j] = (Spline.a[j+1]-Spline.a[j])/h[j]-h[j]*(Spline.c[j+1]+2*Spline.c[j])/3;
136
             Spline.b[j] = (Spline.a[j+1]-Spline.a[j])/h[j]-h[j]*(Spline.c[j+1]+2*Spline.c[j])/3;
136
             Spline.d[j] = (Spline.c[j+1]-Spline.c[j])/3/h[j];
137
             Spline.d[j] = (Spline.c[j+1]-Spline.c[j])/3/h[j];
230
     //--------------------------------------------------------------------------------------
231
     //--------------------------------------------------------------------------------------
231
     Real CubicSplineInterpolator::Integrate ( const Real& x0, const Real& x1 ) {
232
     Real CubicSplineInterpolator::Integrate ( const Real& x0, const Real& x1 ) {
232
 
233
 
233
-
234
-        int i0 = Interval(x0);
235
-        int i1 = Interval(x1);
234
+        Index i0 = Interval(x0);
235
+        Index i1 = Interval(x1);
236
 
236
 
237
         Real h0 = x0 - Spline.x(i0);
237
         Real h0 = x0 - Spline.x(i0);
238
         if (mflag == -1) h0 = 0;
238
         if (mflag == -1) h0 = 0;
245
 
245
 
246
         // Include integrals over intervening intervals.
246
         // Include integrals over intervening intervals.
247
         if (i1 > i0) {
247
         if (i1 > i0) {
248
-            for (int i=i0; i<i1-1; ++i) {
248
+            for (Index i=i0; i<i1-1; ++i) {
249
                 Real h = Spline.x(i+1) - Spline.x(i);
249
                 Real h = Spline.x(i+1) - Spline.x(i);
250
                 cubint +=  (((Spline.d(i)*h/4.0 + Spline.c(i) )*h/3.0 +
250
                 cubint +=  (((Spline.d(i)*h/4.0 + Spline.c(i) )*h/3.0 +
251
                               Spline.b(i))*h/2.0 + Spline.a(i) )*h;
251
                               Spline.b(i))*h/2.0 + Spline.a(i) )*h;
260
     //       Class:  CubicSplineInterpolator
260
     //       Class:  CubicSplineInterpolator
261
     //      Method:  Interval
261
     //      Method:  Interval
262
     //--------------------------------------------------------------------------------------
262
     //--------------------------------------------------------------------------------------
263
-    int CubicSplineInterpolator::Interval ( const Real& x ) {
263
+    Index CubicSplineInterpolator::Interval ( const Real& x ) {
264
 
264
 
265
         std::cerr << "ENTERING CubicSplineInterpolator::Inverval. Known bugs here"  << std::endl;
265
         std::cerr << "ENTERING CubicSplineInterpolator::Inverval. Known bugs here"  << std::endl;
266
-        int nx = Spline.x.size() - 2; // TODO check if this is correct or just -1
266
+        Index nx = Spline.x.size() - 2; // TODO check if this is correct or just -1
267
         // when x not in range
267
         // when x not in range
268
         if (x <= Spline.x(0) || nx <= 1 ) {
268
         if (x <= Spline.x(0) || nx <= 1 ) {
269
             mflag = -1;
269
             mflag = -1;
277
 
277
 
278
         mflag = 0;
278
         mflag = 0;
279
         if (ilo >= nx) ilo = nx-1;
279
         if (ilo >= nx) ilo = nx-1;
280
-        int ihi = ilo+1;
280
+        Index ihi = ilo+1;
281
 
281
 
282
         // if x is already in the interval
282
         // if x is already in the interval
283
         if ( x<Spline.x(ihi) && x >= Spline.x(ilo) ) {
283
         if ( x<Spline.x(ihi) && x >= Spline.x(ilo) ) {
286
         }
286
         }
287
 
287
 
288
         if (x <= Spline.x(ilo)) { // decrease ilo to capture
288
         if (x <= Spline.x(ilo)) { // decrease ilo to capture
289
-            int istep = 1;
290
-            for (int ix=1; ix<nx; ++ix) {
289
+            Index istep = 1;
290
+            for (Index ix=1; ix<nx; ++ix) {
291
                 ihi = ilo;
291
                 ihi = ilo;
292
                 ilo = ihi - istep;
292
                 ilo = ihi - istep;
293
-                ilo = std::max(1, ilo);
293
+                ilo = std::max(Index(1), ilo);
294
                 if (x >= Spline.x(ilo) || ilo == 1) break;
294
                 if (x >= Spline.x(ilo) || ilo == 1) break;
295
                 istep *= 2;
295
                 istep *= 2;
296
             }
296
             }
297
         } else if (x >= Spline.x(ihi)) { // increase ihi to capture
297
         } else if (x >= Spline.x(ihi)) { // increase ihi to capture
298
-            int istep = 1;
299
-            for (int ix=1; ix<nx; ++ix) {
298
+            Index istep = 1;
299
+            for (Index ix=1; ix<nx; ++ix) {
300
                 ilo = ihi;
300
                 ilo = ihi;
301
                 ihi = ilo + istep;
301
                 ihi = ilo + istep;
302
                 ihi = std::min(ihi, nx);
302
                 ihi = std::min(ihi, nx);
307
 
307
 
308
         // Now Spline.x(ilo) <= x < Spline.x(ihi) --> Narrow the interval.
308
         // Now Spline.x(ilo) <= x < Spline.x(ihi) --> Narrow the interval.
309
         //std::cout << "WIDE INTERVAL " << Spline.x(ilo) << "\t" << x << "\t" << Spline.x(ihi) << std::endl;
309
         //std::cout << "WIDE INTERVAL " << Spline.x(ilo) << "\t" << x << "\t" << Spline.x(ihi) << std::endl;
310
-        for (int ix=1; ix<nx; ++ix) {
311
-            int middle = (ilo+ihi) / 2;
310
+        for (Index ix=1; ix<nx; ++ix) {
311
+            Index middle = (ilo+ihi) / 2;
312
             if (middle == ilo) break;
312
             if (middle == ilo) break;
313
             if (x < Spline.x(middle)) {
313
             if (x < Spline.x(middle)) {
314
                 ihi = middle;
314
                 ihi = middle;

+ 8
- 4
Modules/LemmaCore/src/RectilinearGrid.cpp 파일 보기

16
 namespace Lemma {
16
 namespace Lemma {
17
 
17
 
18
     std::ostream &operator << (std::ostream &stream, const RectilinearGrid &ob) {
18
     std::ostream &operator << (std::ostream &stream, const RectilinearGrid &ob) {
19
-        stream << ob.Serialize()  << "\n---\n"; // End of doc
19
+        stream << ob.Serialize()  << "\n"; 
20
         return stream;
20
         return stream;
21
     }
21
     }
22
 
22
 
111
 
111
 
112
     void RectilinearGrid::SetSpacing (const VectorXr &idx, const VectorXr &idy,
112
     void RectilinearGrid::SetSpacing (const VectorXr &idx, const VectorXr &idy,
113
                 const VectorXr &idz) {
113
                 const VectorXr &idz) {
114
-        nx = idx.size();
115
-        ny = idy.size();
116
-        nz = idz.size();
114
+        // MSVC doens't allow static_cast here
115
+        //nx = std::static_cast<int>( idx.size() );
116
+        //ny = std::static_cast<int>( idy.size() );
117
+        //nz = std::static_cast<int>( idz.size() );
118
+        nx = (int)( idx.size() );
119
+        ny = (int)( idy.size() );
120
+        nz = (int)( idz.size() );
117
         dx = idx;
121
         dx = idx;
118
         dy = idy;
122
         dy = idy;
119
         dz = idz;
123
         dz = idz;

+ 1
- 2
Modules/LemmaCore/src/WindowFilter.cpp 파일 보기

8
   @file
8
   @file
9
   @author   Trevor Irons
9
   @author   Trevor Irons
10
   @date     07/20/2010
10
   @date     07/20/2010
11
-  @version  $Id: windowfilter.cpp 87 2013-09-05 22:44:05Z tirons $
12
  **/
11
  **/
13
 
12
 
14
 #include "WindowFilter.h"
13
 #include "WindowFilter.h"
134
         std::cout << "Window nyquist " << Nyquist << std::endl;
133
         std::cout << "Window nyquist " << Nyquist << std::endl;
135
         std::cout << "Window Nw  " << Nw << std::endl;
134
         std::cout << "Window Nw  " << Nw << std::endl;
136
         Real  df      = (Nyquist)/((Real)(Nw)); // df Hz per bin
135
         Real  df      = (Nyquist)/((Real)(Nw)); // df Hz per bin
137
-        Width         = Bandwidth/df;
136
+        Width         = (int)(std::round(Bandwidth/df));
138
         Coefficients.resize(Width);
137
         Coefficients.resize(Width);
139
         switch (Type) {
138
         switch (Type) {
140
             case HAMMING:
139
             case HAMMING:

Loading…
취소
저장