Skip to content

Commit 51c2d2e

Browse files
committed
QList replaced by QVector
1 parent 92ffc81 commit 51c2d2e

File tree

3 files changed

+158
-160
lines changed

3 files changed

+158
-160
lines changed

src/adjustment.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ void AdjustmentFramework::update( const Index start,
128128
assert( l0_.segment( idx3,3).hasNaN()==false );
129129
}
130130

131-
bool AdjustmentFramework::enforce_constraints( const QList<std::shared_ptr<Constraint::ConstraintBase> > *constr,
132-
const IncidenceMatrix * bi,
133-
// const int E,
131+
bool AdjustmentFramework::enforce_constraints( const QVector<std::shared_ptr<Constraint::ConstraintBase> > *constr,
132+
const IncidenceMatrix * Bi,
134133
const Eigen::RowVectorXi & maps,
135134
const Eigen::RowVectorXi & mapc )
136135
{
@@ -176,7 +175,7 @@ bool AdjustmentFramework::enforce_constraints( const QList<std::shared_ptr<Const
176175
if ( verbose ) {
177176
qDebug().noquote() << QString(" iteration #%1...").arg(it+1);
178177
}
179-
a_Jacobian( constr, bi, BBr, g0, maps, mapc);
178+
a_Jacobian( constr, Bi, BBr, g0, maps, mapc);
180179

181180
// reduced coordinates: vector and covariance matrix .............
182181
for ( Index s=0; s<S; s++ )
@@ -264,14 +263,14 @@ bool AdjustmentFramework::enforce_constraints( const QList<std::shared_ptr<Const
264263
}
265264

266265
// check constraints .........................................
267-
a_check_constraints( constr, bi, maps, mapc);
266+
a_check_constraints( constr, Bi, maps, mapc);
268267

269268
return true;
270269
}
271270

272271

273272
void AdjustmentFramework::a_Jacobian(
274-
const QList<std::shared_ptr<ConstraintBase> > * constr,
273+
const QVector<std::shared_ptr<Constraint::ConstraintBase> > *constr,
275274
const IncidenceMatrix * Bi,
276275
SparseMatrix<double, Eigen::ColMajor> & BBr,
277276
VectorXd & g0,
@@ -316,7 +315,7 @@ void AdjustmentFramework::a_Jacobian(
316315
}
317316

318317
void AdjustmentFramework::a_check_constraints(
319-
const QList<std::shared_ptr<Constraint::ConstraintBase> > * constr,
318+
const QVector<std::shared_ptr<Constraint::ConstraintBase> > *constr,
320319
const IncidenceMatrix * bi,
321320
const Eigen::RowVectorXi & maps,
322321
const Eigen::RowVectorXi & mapc) const

src/adjustment.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class AdjustmentFramework
5959
AdjustmentFramework & operator= ( AdjustmentFramework &&) = delete;
6060

6161
//! Enforce the constraints of a subtask (adjustment)
62-
bool enforce_constraints( const QList<std::shared_ptr<ConstraintBase> > *constr,
63-
const Graph::IncidenceMatrix *bi,
62+
bool enforce_constraints(const QVector<std::shared_ptr<ConstraintBase> > *constr,
63+
const Graph::IncidenceMatrix *Bi,
6464
const RowVectorXi &maps,
6565
const RowVectorXi &mapc);
6666

@@ -84,18 +84,17 @@ class AdjustmentFramework
8484
void reset() { l0_ = l_;}
8585
void update( Index start, const VectorXd &x );
8686

87-
void a_Jacobian( const QList<std::shared_ptr<ConstraintBase> > *constr,
87+
void a_Jacobian( const QVector<std::shared_ptr<ConstraintBase> > *constr,
8888
const Graph::IncidenceMatrix *Bi,
89-
SparseMatrix<double,
90-
Eigen::ColMajor> & BBr,
89+
SparseMatrix<double, Eigen::ColMajor> & BBr,
9190
VectorXd & g0,
9291
const RowVectorXi & maps,
9392
const RowVectorXi & mapc) const;
9493

95-
void a_check_constraints( const QList<std::shared_ptr<ConstraintBase> > *constr,
94+
void a_check_constraints( const QVector<std::shared_ptr<ConstraintBase> > *constr,
9695
const Graph::IncidenceMatrix *bi,
9796
const RowVectorXi & maps,
98-
const RowVectorXi &mapc ) const;
97+
const RowVectorXi & mapc ) const;
9998

10099
bool verbose = false;
101100
VectorXd l0_; // vector of approximate/estimated observations

0 commit comments

Comments
 (0)