1 #ifndef MPQC_MATH_TENSOR_REF_HPP
2 #define MPQC_MATH_TENSOR_REF_HPP
4 #include "mpqc/math/tensor/base.hpp"
5 #include "mpqc/math/tensor/functional.hpp"
14 template<
typename T,
size_t N,
class Order = TensorColumnMajor >
19 TensorRef(T *data,
const size_t (&dims)[N])
22 T* data() {
return this->data_; }
23 const T* data()
const {
return this->data_; }
29 size_t size = this->size();
30 std::copy(u.data(), u.data()+size, this->data());
36 size_t size = this->size();
37 std::copy(u.data(), u.data()+size, this->data());
68 size_t size = this->size();
69 for (
size_t i = 0; i < size; ++i) {
75 template<
class F,
typename Iterator>
76 F apply(F f, Iterator it) {
77 size_t size = this->size();
78 for (
size_t i = 0; i < size; ++i) {
79 f(this->data_[i], *it++);
Contains new MPQC code since version 3.
Definition: integralenginepool.hpp:37
Definition: functional.hpp:70
TensorRef & operator=(const TensorRef< U, N, Order > &u)
fast assignment operator
Definition: ref.hpp:35
TensorRef & operator-=(const TensorRef< U, N, Order > &u)
fast -= operator
Definition: ref.hpp:48
Tensor reference class.
Definition: ref.hpp:15
TensorRef & operator/=(const U &u)
fast /= operator
Definition: ref.hpp:60
TensorRef & operator*=(const U &u)
fast *= operator
Definition: ref.hpp:54
Definition: functional.hpp:87
TensorRef & operator+=(const TensorRef< U, N, Order > &u)
fast += operator
Definition: ref.hpp:42
Tensor base class.
Definition: base.hpp:32
Definition: functional.hpp:59
Definition: functional.hpp:80
TensorRef & operator=(const TensorRef &u)
fast assignment operator
Definition: ref.hpp:28
Generated at Sun Jan 26 2020 23:24:01 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.