diff --git a/gtsam_unstable/linear/LPState.h b/gtsam_unstable/linear/LPState.h new file mode 100644 index 000000000..df95f4623 --- /dev/null +++ b/gtsam_unstable/linear/LPState.h @@ -0,0 +1,33 @@ +/** + * @file LPState.h + * @brief This struct holds the state of QPSolver at each iteration + * @author Ivan Dario Jimenez + * @date 1/24/16 + */ + + + +namespace gtsam { + +struct LPState { + VectorValues values; + VectorValues duals; + InequalityFactorGraph workingSet; + bool converged; + size_t iterations; + + /// default constructor + LPState() : + values(), duals(), workingSet(), converged(false), iterations(0) { + } + + /// constructor with initial values + LPState(const VectorValues& initialValues, const VectorValues& initialDuals, + const InequalityFactorGraph& initialWorkingSet, bool _converged, + size_t _iterations) : + values(initialValues), duals(initialDuals), workingSet(initialWorkingSet), converged( + _converged), iterations(_iterations) { + } +}; + +} \ No newline at end of file diff --git a/gtsam_unstable/linear/tests/testLPSolver.cpp b/gtsam_unstable/linear/tests/testLPSolver.cpp index 156ba4195..0838c5378 100644 --- a/gtsam_unstable/linear/tests/testLPSolver.cpp +++ b/gtsam_unstable/linear/tests/testLPSolver.cpp @@ -32,6 +32,7 @@ #include #include #include +#include using namespace std; using namespace gtsam; @@ -39,28 +40,6 @@ using namespace gtsam::symbol_shorthand; namespace gtsam { -/// This struct holds the state of QPSolver at each iteration -struct LPState { - VectorValues values; - VectorValues duals; - InequalityFactorGraph workingSet; - bool converged; - size_t iterations; - - /// default constructor - LPState() : - values(), duals(), workingSet(), converged(false), iterations(0) { - } - - /// constructor with initial values - LPState(const VectorValues& initialValues, const VectorValues& initialDuals, - const InequalityFactorGraph& initialWorkingSet, bool _converged, - size_t _iterations) : - values(initialValues), duals(initialDuals), workingSet(initialWorkingSet), converged( - _converged), iterations(_iterations) { - } -}; - typedef std::map KeyDimMap; typedef std::vector > TermsContainer;