Readout Functions
The data can be printed with std::cout
:
-
template<class T>
std::ostream &operator<<(std::ostream &stream, const danceq::internal::Vector<T> vector) std::ofstream for the Vector class.
The function compatible with MPI. It has to be called by all processes.
Usage:
std::cout << vector: << vector << std::endl;
- Parameters:
stream – std::ofstream
vector – Output vector
- Returns:
std::ostream&
-
T *danceq::internal::Vector::get_data_ptr(const uint64_t offset = 0UL)
Pointer to the local data with an offset.
Points to the local data with an offset.
Note
If MPI is enabled, each rank points to its part with the same offset.
- Returns:
Pointer to data
-
const T *danceq::internal::Vector::get_const_data_ptr(const uint64_t offset = 0UL) const
const Pointer to the local data with an offset.
Points to the local data with an offset. This allows only read access.
Note
If MPI is enabled, each rank points to its part with the same offset.
- Returns:
const Pointer to data
-
int32_t danceq::internal::Vector::info(void) const
Prints information about the vector.
- Returns:
error_code
-
const T danceq::internal::Vector::operator[](const uint64_t index) const
Overloaded [] operator for readout.
Returns value at index that can range from 0 to dim. The function is compatible with MPI and each processes obtains the same value stored at index.
Note
It is not possible to set an entry with this operator! Use set_index(index,value) to do this.
Warning
The performance is bad if multiple values are requested, use get_const_data_ptr(…) instead.
- Parameters:
index – Index
- Returns:
Vales
-
std::vector<T> danceq::internal::Vector::gather_data(const int32_t root = 0) const
Gathers the data into one vector.
This is equivalent get_data() without MPI. The input root is meaningless in this case.
- Parameters:
root – Designated MPI rank (Default: 0)
- Returns:
data