// inserts the sparse matrix 'ins' into the sparse matrix 'original' in the place given by 'row' and 'col' integers
void insertSparseBlock(const Eigen::SparseMatrix<Scalar>& ins, Eigen::SparseMatrix<Scalar>& original, const unsigned int& row, const unsigned int& col)
{
  for (int k=0; k<ins.outerSize(); ++k)
    for (Eigen::SparseMatrix<Scalar>::InnerIterator iti(ins,k); iti; ++iti)
      original.coeffRef(iti.row() + row, iti.col() + col) = iti.value();

  original.makeCompressed();
}
Esempio n. 2
0
void boundaryPart::update( boundaryArea * area, int timeIndex )
{
	trackDocument * doc = trackDocument::get();
	if ( ! doc ) return;
	for ( int time = 0; time < shapes.size; ++time ) {
		if ( timeIndex != -1 ) {
			time = timeIndex;
		}
		list< point2<int> > seg;
		for ( array<boundaryCurveIndex>::iterator it( curves ); it; ++it ) {
			boundaryCurve & curve = area->divisions[it->curve];//対象カーブ
			for ( boundaryCurveIndex::iterator iti( it() ); iti; ++iti ) {
				curve.segment( seg, iti(), time );
			}
		}
		region<int> shape;
		pointsToRegion( seg, shape, doc->width, doc->height );
		shape.fill( shapes[time] );
		if ( timeIndex != -1 ) {
			break;
		}
	}
}