//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_worklet_DotProduct_h #define vtk_m_worklet_DotProduct_h #include #include #include namespace vtkm { namespace worklet { class DotProduct : public vtkm::worklet::WorkletMapField { public: using ControlSignature = void(FieldIn, FieldIn, FieldOut); template VTKM_EXEC void operator()(const vtkm::Vec& v1, const vtkm::Vec& v2, T& outValue) const { outValue = static_cast(vtkm::Dot(v1, v2)); } template VTKM_EXEC void operator()(T s1, T s2, T& outValue) const { outValue = static_cast(s1 * s2); } }; } } // namespace vtkm::worklet #endif // vtk_m_worklet_Normalize_h