Exemplo n.º 1
0
void
show(vsip::const_Matrix<T, BlockT> view)
{
  using vsip::no_subblock;
  using vsip::index_type;
  typedef T value_type;

  std::cout << "[" << vsip::local_processor() << "] " << "show\n";
  if (subblock(view) != no_subblock)
  {
    for (index_type lr=0; lr<view.local().size(0); ++lr)
      for (index_type lc=0; lc<view.local().size(1); ++lc)
      {
	index_type gr = global_from_local_index(view, 0, lr); 
	index_type gc = global_from_local_index(view, 1, lc); 
	std::cout << "[" << vsip::local_processor() << "] "
		  << lr << "," << lc
		  << "  g:" << gr << "," << gc << " = "
		  << view.local().get(lr, lc)
		  << std::endl;
      }
  }
  else
    std::cout << "[" << vsip::local_processor() << "] "
	      << "show: no local subblock\n";
}
Exemplo n.º 2
0
void
check(vsip::const_Matrix<T, BlockT> view, int k, int rshift=0, int cshift=0)
{
  using vsip::no_subblock;
  using vsip::index_type;
  typedef T value_type;

#if VERBOSE
  std::cout << "check(k=" << k << ", rshift=" << rshift
	    << ", cshift=" << cshift << "):"
	    << std::endl;
#endif
  if (subblock(view) != no_subblock)
  {
    for (index_type lr=0; lr<view.local().size(0); ++lr)
      for (index_type lc=0; lc<view.local().size(1); ++lc)
      {
	index_type gr = global_from_local_index(view, 0, lr); 
	index_type gc = global_from_local_index(view, 1, lc); 
#if VERBOSE
	std::cout << " - " << lr << ", " << lc << "  g:"
		  << gr << ", " << gc << " = "
		  << view.local().get(lr, lc)
		  << "  exp: " << value<T>(gr+rshift, gc + cshift, k)
		  << std::endl;
#endif
#if DO_ASSERT
	test_assert(view.local().get(lr, lc) ==
		    value<T>(gr+rshift, gc+cshift, k));
#endif
      }
  }
}