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

// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Gael Guennebaud <[email protected]>
// Copyright (C) 2006-2009 Benoit Jacob <[email protected]>
// Copyright (C) 2010-2013 Hauke Heibel <[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_MATRIXSTORAGE_H
#define EIGEN_MATRIXSTORAGE_H

#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
#define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
#else
#define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X)
#endif

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

namespace Eigen {

namespace internal {

struct constructor_without_unaligned_array_assert {};

template <typename T, int Size>
EIGEN_DEVICE_FUNC constexpr void check_static_allocation_size() {}

/** \internal
 * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned:
 * to 16 bytes boundary if the total size is a multiple of 16 bytes.
 */
template <typename T, int Size, int MatrixOrArrayOptions,
          int Alignment = (MatrixOrArrayOptions & DontAlign) ? 0 : compute_default_alignment<T, Size>::value>
struct plain_array {};

#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT
#else
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)
#endif

plain_array<T, Size, MatrixOrArrayOptions, 8>;

plain_array<T, Size, MatrixOrArrayOptions, 16>;

plain_array<T, Size, MatrixOrArrayOptions, 32>;

plain_array<T, Size, MatrixOrArrayOptions, 64>;

plain_array<T, 0, MatrixOrArrayOptions, Alignment>;

struct plain_array_helper {};

}  // end namespace internal

/** \internal
 *
 * \class DenseStorage
 * \ingroup Core_Module
 *
 * \brief Stores the data of a matrix
 *
 * This class stores the data of fixed-size, dynamic-size or mixed matrices
 * in a way as compact as possible.
 *
 * \sa Matrix
 */
template <typename T, int Size, int Rows_, int Cols_, int Options_>
class DenseStorage;

// purely fixed-size matrix
template <typename T, int Size, int Rows_, int Cols_, int Options_>
class DenseStorage {};

// null matrix
DenseStorage<T, 0, Rows_, Cols_, Options_>;

// more specializations for null matrices; these are necessary to resolve ambiguities
DenseStorage<T, 0, Dynamic, Dynamic, Options_>;

DenseStorage<T, 0, Rows_, Dynamic, Options_>;

DenseStorage<T, 0, Dynamic, Cols_, Options_>;

// dynamic-size matrix with fixed-size storage
DenseStorage<T, Size, Dynamic, Dynamic, Options_>;

// dynamic-size matrix with fixed-size storage and fixed width
DenseStorage<T, Size, Dynamic, Cols_, Options_>;

// dynamic-size matrix with fixed-size storage and fixed height
DenseStorage<T, Size, Rows_, Dynamic, Options_>;

// purely dynamic matrix.
DenseStorage<T, Dynamic, Dynamic, Dynamic, Options_>;

// matrix with dynamic width and fixed height (so that matrix has dynamic size).
DenseStorage<T, Dynamic, Rows_, Dynamic, Options_>;

// matrix with dynamic height and fixed width (so that matrix has dynamic size).
DenseStorage<T, Dynamic, Dynamic, Cols_, Options_>;

}  // end namespace Eigen

#endif  // EIGEN_MATRIX_H