31void gsWriteCsv(std::string 
const & filename, 
const gsMatrix<T> & matrix, 
const std::vector<std::string> & headers = std::vector<std::string>() )
 
   34    const static gsEigen::IOFormat CSVFormat(gsEigen::FullPrecision, gsEigen::Aligned, 
", ", 
"\n");
 
   36    std::ofstream csv_file;
 
   37    csv_file.open(filename);
 
   38    GISMO_ASSERT( (headers.empty() ||  headers.size() == (
size_t)matrix.cols()), 
"The column headers should be as many as the columns of the matrix provided." );
 
   41    if (! headers.empty())
 
   43        for ( 
size_t j=0 ; j <  headers.size() ; j++)
 
   45            csv_file << headers[j];
 
   46            if (headers.size()-1 == j)
 
   47                csv_file << CSVFormat.rowSeparator;
 
   49                csv_file << CSVFormat.coeffSeparator ;
 
   53    csv_file << matrix.format(CSVFormat);
 
 
void gsWriteCsv(std::string const &filename, const gsMatrix< T > &matrix, const std::vector< std::string > &headers=std::vector< std::string >())
Export a gsMatrix to a .csv (comma separated values) file.
Definition gsCsv.h:31