// 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/.
// Fixme: we should check that the generated numbers follow a uniform // distribution instead. for (int i = 1; i < 6; ++i) {
VERIFY_IS_NOT_EQUAL(vec(i), vec(i-1));
}
}
// Fixme: we should check that the generated numbers follow a gaussian // distribution instead. for (int i = 1; i < 6; ++i) {
VERIFY_IS_NOT_EQUAL(vec(i), vec(i-1));
}
}
// Return a random value to be used. "element_location" is the // location of the entry to set in the tensor, it can typically // be ignored. intoperator()(Eigen::DenseIndex element_location, Eigen::DenseIndex /*unused*/ = 0) const { returnstatic_cast<int>(3 * element_location);
}
// Same as above but generates several numbers at a time.
internal::packet_traits<int>::type packetOp(
Eigen::DenseIndex packet_location, Eigen::DenseIndex /*unused*/ = 0) const { constint packetSize = internal::packet_traits<int>::size;
EIGEN_ALIGN_MAX int values[packetSize]; for (int i = 0; i < packetSize; ++i) {
values[i] = static_cast<int>(3 * (packet_location + i));
} return internal::pload<typename internal::packet_traits<int>::type>(values);
}
};
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.