Необходимо явно установить положение родительского контейнера наряду с положением дочернего контейнера. Типичный способ сделать, который является чем-то вроде этого:
div.parent{
position: relative;
left: 0px; /* stick it wherever it was positioned by default */
top: 0px;
}
div.child{
position: absolute;
left: 10px;
top: 10px;
}
Вы можете найти ответ в этом FAQ: Как перебирать все ненулевые элементы?
В вашем случае это будет:
typedef boost::numeric::ublas::compressed_matrix<int>::iterator1 it1_t;
typedef boost::numeric::ublas::compressed_matrix<int>::iterator2 it2_t;
for (it1_t it1 = adjacency.begin1(); it1 != adjacency.end1(); it1++)
{
for (it2_t it2 = it1.begin(); it2 != it1.end(); it2++)
{
std::cout << "(" << it2.index1() << "," << it2.index2() << ") = ";
std::cout << *it2 << std::endl;
}
}