vrpRouting  0.3
vrprouting::base Namespace Reference

Namespaces

 detail
 

Classes

class  Base_Matrix
 N x N matrix. More...
 

Functions

std::ostream & operator<< (std::ostream &log, const Base_Matrix &matrix)
 

Function Documentation

◆ operator<<()

std::ostream& vrprouting::base::operator<< ( std::ostream &  log,
const Base_Matrix matrix 
)
Parameters
[in,out]logstream variable where to print
[in]matrixThe matrix
dot_inline_dotgraph_6.png

Definition at line 567 of file base_matrix.cpp.

567  {
568  /*
569  * print the identifiers
570  */
571  for (const auto id : matrix.m_ids) {
572  log << "\t" << id;
573  }
574  log << "\n";
575  size_t i = 0;
576 
577  /*
578  * Cycle the cells
579  */
580  for (const auto &row : matrix.m_time_matrix) {
581  size_t j = 0;
582  for (const auto cost : row) {
583  /*
584  * print the information
585  */
586  log << "Internal(" << i << "," << j << ")"
587  << "\tOriginal(" << matrix.m_ids[i] << "," << matrix.m_ids[j] << ")"
588  << "\t = " << cost
589  << "\n";
590  ++j;
591  }
592  ++i;
593  }
594  return log;
595 }

References vrprouting::base::Base_Matrix::m_ids, and vrprouting::base::Base_Matrix::m_time_matrix.