preCICE v3.1.2
Loading...
Searching...
No Matches
Sample.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <Eigen/Core>
5
6namespace precice::time {
7
13struct Sample {
15 explicit Sample(int dims) noexcept
16 : dataDims(dims) {}
17
19 Sample(int dims, int dataCount)
20 : dataDims(dims), values(dims * dataCount) {}
21
23 Sample(int dims, Eigen::VectorXd inValues)
24 : dataDims(dims), values(std::move(inValues)) {}
25
27 Sample(int dims, Eigen::VectorXd inValues, Eigen::MatrixXd inGradients)
28 : dataDims(dims), values(std::move(inValues)), gradients(std::move(inGradients)) {}
29
30 Sample(const Sample &) = default;
31 Sample(Sample &&) = default;
32
33 Sample &operator=(const Sample &) = default;
34 Sample &operator=(Sample &&) = default;
35
38 {
41 return *this;
42 }
43
46
49 Eigen::VectorXd values;
50
52 Eigen::MatrixXd gradients;
53};
54
55} // namespace precice::time
contains the time interpolation logic.
Definition Sample.hpp:6
STL namespace.
Sample(int dims) noexcept
Constructs an empty Sample of a given data dimensionality.
Definition Sample.hpp:15
Sample(int dims, Eigen::VectorXd inValues, Eigen::MatrixXd inGradients)
Constructs a Sample of given data dimensionality, data values, and data gradients.
Definition Sample.hpp:27
Eigen::MatrixXd gradients
The gradients of the data. Use gradients.col(i) to get the gradient at vertex i.
Definition Sample.hpp:52
Sample(int dims, int dataCount)
Constructs a Sample of given data dimensionality and size without gradients.
Definition Sample.hpp:19
Sample & operator=(Sample &&)=default
Sample & setZero()
Sets values and gradients to zero.
Definition Sample.hpp:37
int dataDims
The dimensionality of the data.
Definition Sample.hpp:45
Sample(const Sample &)=default
Eigen::VectorXd values
Definition Sample.hpp:49
Sample(int dims, Eigen::VectorXd inValues)
Constructs a Sample of given data dimensionality and data values.
Definition Sample.hpp:23
Sample(Sample &&)=default
Sample & operator=(const Sample &)=default