// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com> // // 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 <Eigen/CXX11/Tensor>
using Eigen::Tensor; using Eigen::TensorMap;
staticvoid test_additions()
{
Tensor<std::complex<float>, 1> data1(3);
Tensor<std::complex<float>, 1> data2(3); for (int i = 0; i < 3; ++i) {
data1(i) = std::complex<float>(i, -i);
data2(i) = std::complex<float>(i, 7 * i);
}
Tensor<std::complex<float>, 1> sum = data1 + data2; for (int i = 0; i < 3; ++i) {
VERIFY_IS_EQUAL(sum(i), std::complex<float>(2*i, 6*i));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.