text: #ifndef ALIEN_MCGIMPL_MCGINTERNAL_H
  #define ALIEN_MCGIMPL_MCGINTERNAL_H
  /* Author : havep at Fri Jun  6 17:56:23 2008
   * Generated by createNew
   */
  
  //! Internal struct for MCG implementation
  /*! Separate data from header;
   *  can be only included by LinearSystem and LinearSolver
   */
  
  #include <chrono>
  #if defined(__x86_64__) || defined(__amd64__)
  #include <x86intrin.h>
  #endif
  
  #include <MCGS.h>
  
  #include <alien/kernels/mcg/MCGPrecomp.h>
  
  BEGIN_MCGINTERNAL_NAMESPACE
  
  //! Check parallel feature for MCG
  inline void
  checkParallel(bool)
  {
    // This behaviour may be changed when Parallel MCG will be plugged
  }
  
  /*---------------------------------------------------------------------------*/
  class UniqueKey
  {
   public:
    UniqueKey()
    : m_rand(std::rand())
    ,
  #if defined(__x86_64__) || defined(__amd64__)
    m_ts(_rdtsc())
  #else
    m_ts(std::chrono::system_clock::now())
  #endif
  
    {}
  
    bool operator==(const UniqueKey& k) const
    {
      return m_rand == k.m_rand && m_ts == k.m_ts;
    }
  
    bool operator!=(const UniqueKey& k) const { return !operator==(k); }
  
   private:
    int m_rand = 0;
  #if defined(__x86_64__) || defined(__amd64__)
    uint64_t m_ts;
  #else
    std::chrono::time_point<std::chrono::system_clock> m_ts;
  #endif
  };
  
  class MatrixInternal
  {
   public:
    typedef MCGSolver::CSRProfile ProfileType;
    typedef MCGSolver::BCSRMatrix<double> MatrixType;
  
    UniqueKey m_key;
    std::shared_ptr<MatrixType> m_matrix[2][2] = { { nullptr, nullptr },
      { nullptr, nullptr } };
  
    MatrixInternal() {}
  
    ~MatrixInternal() {}
  };
  
  class VectorInternal
  {
   public:
    VectorInternal(int nrow, int block_size)
    : m_bvector(nrow, block_size)
    {}
  
    UniqueKey m_key;
    MCGSolver::BVector<double> m_bvector;
  };
  
  class CompositeVectorInternal
  {
   public:
    CompositeVectorInternal(const std::vector<std::pair<int, int>>& composite_info)
    {
      m_bvector.reserve(composite_info.size());
  
      for (const auto& p : composite_info) {
        m_bvector.emplace_back(p.first, p.second);
      }
    }
  
    UniqueKey m_key;
    std::vector<MCGSolver::BVector<double>> m_bvector;
  };
  
  END_MCGINTERNAL_NAMESPACE
  
  #endif /* ALIEN_MCGIMPL_MCGINTERNAL_H */
  