chromium/third_party/eigen3/src/Eigen/src/Core/CwiseUnaryView.h

// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2009-2010 Gael Guennebaud <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_CWISE_UNARY_VIEW_H
#define EIGEN_CWISE_UNARY_VIEW_H

// IWYU pragma: private
#include "./InternalHeaderCheck.h"

namespace Eigen {

namespace internal {
traits<CwiseUnaryView<ViewOp, MatrixType, StrideType>>;

// Generic API dispatcher
template <typename ViewOp, typename XprType, typename StrideType, typename StorageKind,
          bool Mutable = !std::is_const<XprType>::value>
class CwiseUnaryViewImpl : public generic_xpr_base<CwiseUnaryView<ViewOp, XprType, StrideType> >::type {};

CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType, Dense, false>;

CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType, Dense, true>;

}  // namespace internal

/** \class CwiseUnaryView
 * \ingroup Core_Module
 *
 * \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector
 *
 * \tparam ViewOp template functor implementing the view
 * \tparam MatrixType the type of the matrix we are applying the unary operator
 *
 * This class represents a lvalue expression of a generic unary view operator of a matrix or a vector.
 * It is the return type of real() and imag(), and most of the time this is the only way it is used.
 *
 * \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp
 */
template <typename ViewOp, typename MatrixType, typename StrideType>
class CwiseUnaryView : public internal::CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType,
                                                           typename internal::traits<MatrixType>::StorageKind> {};

}  // namespace Eigen

#endif  // EIGEN_CWISE_UNARY_VIEW_H