From f0238cfb6997c4acfc2bd200de7295f3fa36968f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 3 Mar 2019 21:09:10 +0100 Subject: don't index Eigen --- .../unsupported/test/cxx11_tensor_custom_index.cpp | 100 --------------------- 1 file changed, 100 deletions(-) delete mode 100644 eigen/unsupported/test/cxx11_tensor_custom_index.cpp (limited to 'eigen/unsupported/test/cxx11_tensor_custom_index.cpp') diff --git a/eigen/unsupported/test/cxx11_tensor_custom_index.cpp b/eigen/unsupported/test/cxx11_tensor_custom_index.cpp deleted file mode 100644 index 4528cc1..0000000 --- a/eigen/unsupported/test/cxx11_tensor_custom_index.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2015 Benoit Steiner -// -// 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/. - -#include "main.h" -#include -#include - -#include -#include - -using Eigen::Tensor; - - -template -static void test_map_as_index() -{ -#ifdef EIGEN_HAS_SFINAE - Tensor tensor(2, 3, 5, 7); - tensor.setRandom(); - - using NormalIndex = DSizes; - using CustomIndex = std::map; - CustomIndex coeffC; - coeffC[0] = 1; - coeffC[1] = 2; - coeffC[2] = 4; - coeffC[3] = 1; - NormalIndex coeff(1,2,4,1); - - VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); - VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); -#endif -} - - -template -static void test_matrix_as_index() -{ -#ifdef EIGEN_HAS_SFINAE - Tensor tensor(2, 3, 5, 7); - tensor.setRandom(); - - using NormalIndex = DSizes; - using CustomIndex = Matrix; - CustomIndex coeffC(1,2,4,1); - NormalIndex coeff(1,2,4,1); - - VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); - VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); -#endif -} - - -template -static void test_varlist_as_index() -{ -#ifdef EIGEN_HAS_SFINAE - Tensor tensor(2, 3, 5, 7); - tensor.setRandom(); - - DSizes coeff(1,2,4,1); - - VERIFY_IS_EQUAL(tensor.coeff({1,2,4,1}), tensor.coeff(coeff)); - VERIFY_IS_EQUAL(tensor.coeffRef({1,2,4,1}), tensor.coeffRef(coeff)); -#endif -} - - -template -static void test_sizes_as_index() -{ -#ifdef EIGEN_HAS_SFINAE - Tensor tensor(2, 3, 5, 7); - tensor.setRandom(); - - DSizes coeff(1,2,4,1); - Sizes<1,2,4,1> coeffC; - - VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); - VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); -#endif -} - - -void test_cxx11_tensor_custom_index() { - test_map_as_index(); - test_map_as_index(); - test_matrix_as_index(); - test_matrix_as_index(); - test_varlist_as_index(); - test_varlist_as_index(); - test_sizes_as_index(); - test_sizes_as_index(); -} -- cgit v1.2.3