Browse Source

Additional checks

Konstantin Ladutenko 10 years ago
parent
commit
c0b455c62b
2 changed files with 5 additions and 3 deletions
  1. 2 0
      nmie.cc
  2. 3 3
      nmie.h

+ 2 - 0
nmie.cc

@@ -965,6 +965,8 @@ c    MM       + 1  and - 1, alternately
   void MultiLayerMie::RunMieCalculations() {
     if (size_parameter_.size() != index_.size())
       throw std::invalid_argument("Each size parameter should have only one index!");
+    if (size_parameter_.size() == 0)
+      throw std::invalid_argument("Initialize model first!");
     std::vector<std::complex<double> > an, bn;
     std::complex<double> Qbktmp(0.0, 0.0);
     const std::vector<double>& x = size_parameter_;

+ 3 - 3
nmie.h

@@ -1,5 +1,5 @@
-#ifndef SRC_NMIE_NMIE_WRAPPER_H_
-#define SRC_NMIE_NMIE_WRAPPER_H_
+#ifndef SRC_NMIE_NMIE_H_
+#define SRC_NMIE_NMIE_H_
 ///
 /// @file   nmie-wrapper.h
 /// @author Ladutenko Konstantin <kostyfisik at gmail (.) com>
@@ -235,4 +235,4 @@ namespace nmie {
   };  // end of class MultiLayerMie
 
 }  // end of namespace nmie
-#endif  // SRC_NMIE_NMIE_WRAPPER_H_
+#endif  // SRC_NMIE_NMIE_H_