Skip to content

File arg.h

File List > algebra > complexalgebra > arg.h

Go to the documentation of this file

#ifndef COSMOINTERFACE_COMPLEXFIELDALGEBRA_HELPERS_ARG_H
#define COSMOINTERFACE_COMPLEXFIELDALGEBRA_HELPERS_ARG_H

/* This file is part of TempLat, available at https://cosmolattice.github.io/templat .
   Copyright 2021-2026 The TempLat authors, see AUTHORS.md.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Adrien Florio, Year: 2019

#include "TempLat/lattice/algebra/complexalgebra/helpers/hascomplexfieldget.h"
#include "TempLat/lattice/algebra/operators/arg.h"
#include "TempLat/lattice/algebra/operators/arg2.h"
#include "TempLat/lattice/algebra/helpers/iscomplextype.h"

namespace TempLat
{
  template <class T>
    requires HasComplexFieldGet<T>
  auto arg2(T &&t)
  {
    return arg2(t.ComplexFieldGet(Tag<1>()), t.ComplexFieldGet(Tag<0>()));
  }

  template <class T>
    requires IsComplexType<T>
  auto arg2(T &&t)
  {
    return arg2(t.imag(), t.real());
  }

  template <class T>
    requires HasComplexFieldGet<T>
  auto arg(T &&t)
  {
    return arg(t.ComplexFieldGet(Tag<1>()), t.ComplexFieldGet(Tag<0>()));
  }

  template <class T>
    requires IsComplexType<T>
  auto arg(T &&t)
  {
    return arg(t.imag(), t.real());
  }
} // namespace TempLat

#endif