NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ print_to_file()

template<typename T >
void cntr::function< T >::print_to_file ( const char *  file,
int  precision = 16 
) const

Store the function data to a txt file

Purpose

Store the function data to a file. It will be stored in txt form.

Parameters
file

the file name

precision

the precision of stored function data

Definition at line 714 of file cntr_function_impl.hpp.

714  {
715  int i, l, sg = element_size_;
716  std::ofstream out;
717  out.open(file, std::ios::out);
718  out.precision(precision);
719  out << "# " << nt_ << " " << size1_ << std::endl;
720  for (i = -1; i <= nt_; i++) {
721  for (l = 0; l < sg; l++)
722  out << ptr(i)[l].real() << " " << ptr(i)[l].imag() << " ";
723  out << std::endl;
724  }
725  out.close();
726 }
int size1_
Number of the colums in the Matrix form.
int nt_
Maximum number of the time steps.