LCOV - code coverage report
Current view: top level - variable - operations.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 14 100.0 %
Date: 2024-04-28 01:25:40 Functions: 4 4 100.0 %

          Line data    Source code
       1             : // SPDX-License-Identifier: BSD-3-Clause
       2             : // Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
       3             : /// @file
       4             : /// @author Simon Heybrock
       5             : #include "scipp/core/element/geometric_operations.h"
       6             : #include "scipp/core/element/special_values.h"
       7             : #include "scipp/core/element/util.h"
       8             : #include "scipp/variable/creation.h"
       9             : #include "scipp/variable/misc_operations.h"
      10             : #include "scipp/variable/transform.h"
      11             : #include "scipp/variable/variable_concept.h"
      12             : 
      13             : #include "operations_common.h"
      14             : 
      15             : using namespace scipp::core;
      16             : 
      17             : namespace scipp::variable {
      18             : 
      19             : /// Return a deep copy of a Variable.
      20      279582 : Variable copy(const Variable &var) {
      21      559164 :   Variable out(empty_like(var));
      22      279582 :   out.set_aligned(var.is_aligned());
      23      279582 :   out.data().copy(var, out);
      24      279581 :   return out;
      25           1 : }
      26             : 
      27             : /// Copy variable to output variable.
      28      121268 : Variable &copy(const Variable &var, Variable &out) {
      29      121268 :   var.data().copy(var, out);
      30      121242 :   return out;
      31             : }
      32             : 
      33             : /// Copy variable to output variable.
      34       76205 : Variable copy(const Variable &var, Variable &&out) {
      35       76205 :   copy(var, out);
      36       76183 :   return std::move(out);
      37             : }
      38             : 
      39             : namespace geometry {
      40          11 : Variable position(const Variable &x, const Variable &y, const Variable &z) {
      41          11 :   return transform(x, y, z, element::geometry::position, "position");
      42             : }
      43             : } // namespace geometry
      44             : 
      45             : } // namespace scipp::variable

Generated by: LCOV version 1.14