Skip to content
Snippets Groups Projects
Commit 04d8394c authored by mkirsz's avatar mkirsz
Browse files

added helper method

parent b2c0a837
No related branches found
No related tags found
1 merge request!15added bitmap for checking is calc initalised for atoms, fixed return to...
Pipeline #49807 passed
Pipeline: MLIP

#49809

    Pipeline: MD

    #49808

      ...@@ -26,6 +26,10 @@ public: ...@@ -26,6 +26,10 @@ public:
      int verbose; int verbose;
      virtual ~D_Base(); virtual ~D_Base();
      // return position of an argument given to TYPExB for a given key
      // if key is not used, returns -1
      int get_arg_pos(const std::string &key) const;
      /** \brief Return dimension of the descriptor. /** \brief Return dimension of the descriptor.
      */ */
      virtual size_t size() { return s; }; virtual size_t size() { return s; };
      ......
      ...@@ -91,3 +91,10 @@ void D_Base::set_fcut(Cut_Base* cut, bool manage_memory) { ...@@ -91,3 +91,10 @@ void D_Base::set_fcut(Cut_Base* cut, bool manage_memory) {
      fcut = cut; fcut = cut;
      this->manage_memory = manage_memory; this->manage_memory = manage_memory;
      } }
      int D_Base::get_arg_pos(const std::string &key) const {
      auto it = std::find(keys.begin(), keys.end(), key);
      if (it == keys.end()) return -1;
      return std::distance(keys.begin(), it)+(nparams-keys.size());
      }
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Finish editing this message first!
      Please register or to comment