@@ -198,8 +198,6 @@ QDataStream & operator>> ( QDataStream &in, ConstraintBase &c )
198198
199199// ! Implementation details of class 'state' (pImpl idiom)
200200class impl {
201- private:
202- using VectorXidx = Vector<Index,Dynamic>;
203201
204202public:
205203 bool deserialize ( QDataStream & in ); // !< Serialization
@@ -695,7 +693,7 @@ void impl::lookOutForParallelism(const Index c)
695693 const SparseMatrix<int > WW = Adj*Adj;
696694
697695 // case: straight line segment connects two segments
698- const VectorXidx idx = spfind< int > ( Adj.col (c) ); // neighbors of c
696+ const Vector<Index,Dynamic> idx = spfind ( Adj.col (c). eval ( ) ); // neighbors of c
699697
700698 // Check all pairs of direct neighbors.
701699 for ( Index i=0 ; i<idx.rows (); i++) {
@@ -720,7 +718,7 @@ void impl::lookOutForParallelism(const Index c)
720718
721719
722720 // Find walks of length 2 between the vertices of the graph.
723- const VectorXidx nbs = spfind< int > ( WW.col (c) );
721+ const Vector<Index,Dynamic> nbs = spfind ( WW.col (c). eval ( ) );
724722 for ( const auto a : nbs) { // Index n=0; n<nbs.rows()-1; n++) {
725723 // a is a walk of length 2 away from c.
726724 if ( !Adj.isSet (a,c) ) {
@@ -738,11 +736,11 @@ void impl::lookOutForCopunctuality( const Index c )
738736{
739737 const SparseMatrix<int > WW = Adj*Adj;
740738
741- const VectorXidx nbs = spfind< int > ( WW.col (c) );
739+ const Vector<Index,Dynamic> nbs = spfind ( WW.col (c). eval ( ) );
742740 for ( const auto a : nbs) {
743741 // a and c are adjacent and have at least one common neighbor.
744742 // Find all common neighbors of a and c.
745- const VectorXidx nbnb = spfind< int > ( Adj.col (a) ); // neighbors of a.
743+ const Vector<Index,Dynamic> nbnb = spfind ( Adj.col (a). eval ( ) ); // neighbors of a.
746744 for ( const auto b : nbnb ) {
747745 if ( !Adj.isSet ( b,c ) ) {
748746 continue ; // b is not a common neighbor of a and c.
@@ -1102,7 +1100,7 @@ void impl::remove_constraint( const Index i )
11021100
11031101 if ( m_constr.at (i)->isInstanceOf <Parallel>() )
11041102 {
1105- const VectorXidx idx = spfind< int > ( Rel.col (i) );
1103+ const Vector<Index,Dynamic> idx = spfind ( Rel.col (i). eval ( ) );
11061104 Q_ASSERT_X ( idx.size () == 2 , Q_FUNC_INFO,
11071105 QStringLiteral (" parallel with %1 entities" )
11081106 .arg ( QString::number (idx.size ())).toUtf8 () );
@@ -1296,8 +1294,8 @@ void impl::remove_elements()
12961294void impl::replaceGraphics () {
12971295
12981296 // qDebug() << Q_FUNC_INFO;
1299- Q_ASSERT ( m_constr.size () == m_qConstraint.size () );
1300- Q_ASSERT ( m_qConstraint.size () == Rel.cols () );
1297+ assert ( m_constr.size () == m_qConstraint.size () );
1298+ assert ( m_qConstraint.size () == Rel.cols () );
13011299
13021300 // *** Check segments. ***
13031301 // If reference count is 1, the segment has been added or modified.
@@ -1314,16 +1312,16 @@ void impl::replaceGraphics() {
13141312 // *** Check constraints. ***
13151313 // If any of the involved segements have been modified,
13161314 // the constraint has to be modified/replaced, too.
1317- for ( int c=0 ; c<m_constr.length (); c++)
1315+ for (Index c=0 ; c<m_constr.length (); c++)
13181316 {
13191317 bool modified = false ;
1320- const VectorXidx idxx = spfind< int > ( Rel.col (c) );
1318+ const Vector<Index,Dynamic> idx = spfind ( Rel.col (c). eval ( ) );
13211319
13221320 if ( m_constr.at (c).use_count ()==1 ) {
13231321 modified = true ; // actually not modified, but added
13241322 }
13251323 else {
1326- for ( int s=0 ; s<idxx .size (); s++) {
1324+ for (Index s=0 ; s<idx .size (); s++) {
13271325 if ( m_segm.at (s).use_count ()==1 ) {
13281326 modified = true ;
13291327 break ;
@@ -1333,10 +1331,10 @@ void impl::replaceGraphics() {
13331331
13341332 if ( modified ) {
13351333 auto q = m_qConstraint.at (c)->clone ();
1336- Q_ASSERT ( idxx .size ()>0 && idxx .size ()<4 ); // {1,2,3}-ary
1334+ assert ( idx .size ()>0 && idx .size ()<4 ); // {1,2,3}-ary
13371335 q->setStatus ( m_constr.at (c)->required (),
13381336 m_constr.at (c)->enforced () );
1339- q->setGeometry ( m_segm, idxx );
1337+ q->setGeometry ( m_segm, idx );
13401338 m_qConstraint.replace ( c, q);
13411339 }
13421340 }
0 commit comments