Program Listing for File fusion.hpp

Return to documentation for file (SeQuant/core/optimize/fusion.hpp)

#ifndef SEQUANT_OPT_FUSION_HPP
#define SEQUANT_OPT_FUSION_HPP

#include <SeQuant/core/expr.hpp>

namespace sequant::opt {


class Fusion {
 public:
  Fusion(Product const& lhs, Product const& rhs);

  ExprPtr left() const;

  ExprPtr right() const;

  static ExprPtr fuse_left(Product const& lhs, Product const& rhs);

  static ExprPtr fuse_right(Product const& lhs, Product const& rhs);

  static rational gcd_rational(rational const& left, rational const& right);

  static std::array<rational, 3> fuse_scalar(rational const& left,
                                             rational const& right);

 private:
  ExprPtr left_;

  ExprPtr right_;
};

}  // namespace sequant::opt

#endif  // SEQUANT_OPT_FUSION_HPP