34 using namespace gtsam;
98 starter.
insert(Z, Vector::Constant(1, 2.0));
101 expected.
insert(X, Vector::Constant(1, 13.5));
102 expected.
insert(Y, Vector::Constant(1, 6.5));
103 expected.
insert(Z, Vector::Constant(1, -6.5));
115 expected_x0.
insert(1, Vector::Zero(2));
119 double expected_y0 = 0.0;
142 xy0.
insert(yKey, Vector::Constant(1, y0));
145 expected_init.
insert(1, Vector::Ones(2));
146 expected_init.
insert(2, Vector::Constant(1, -1));
166 graph.
add(1, A1, 2, A2, b, noiseModel::Constrained::All(3));
176 graph.
add(1, I_1x1, 2, I_1x1,
kOne, noiseModel::Constrained::All(1));
177 graph.
add(1, I_1x1, 2, -I_1x1, 5 *
kOne, noiseModel::Constrained::All(1));
178 graph.
add(1, I_1x1, 2, 2 * I_1x1, 6 *
kOne, noiseModel::Constrained::All(1));
190 init.
insert(1, Vector::Zero(2));
195 expected_x1.
insert(1, Vector::Ones(2));
226 double expectedError = 44.0;
TEST(LPSolver, OverConstrainedLinearSystem)
void add(Args &&... args)
Add a linear inequality, forwards arguments to LinearInequality.
double compute_y0(const VectorValues &x0) const
y = max_j ( Cj*x0 - dj ) – due to the inequality constraints y >= Cx - d
bool isFeasible(const VectorValues &x) const
check feasibility
Concept check for values that can be used in unit tests.
std::shared_ptr< LP > shared_ptr
InequalityFactorGraph inequalities
Linear inequality constraints: cI(x) <= 0.
static int runAllTests(TestResult &result)
#define DOUBLES_EQUAL(expected, actual, threshold)
LP::shared_ptr buildInitialLP(Key yKey) const
build initial LP
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Exception thrown when given Infeasible Initial Values.
BiCGSTAB< SparseMatrix< double > > solver
iterator insert(const std::pair< Key, Vector > &key_value)
Factor graph of all LinearInequality factors.
double error(const VectorValues &x) const
NonlinearFactorGraph graph
std::pair< VectorValues, VectorValues > optimize(const VectorValues &initialValues, const VectorValues &duals=VectorValues(), bool useWarmStart=false) const
Factor graph of all LinearEquality factors.
VectorValues optimize(const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
double error(const VectorValues &c) const override
void add(const GaussianFactor &factor)
LinearCost cost
Linear cost factor.
GaussianFactorGraph buildWorkingGraph(const InequalityFactorGraph &workingSet, const VectorValues &xk=VectorValues()) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Linear Factor Graph where all factors are Gaussians.
Key symbol(unsigned char c, std::uint64_t j)
std::shared_ptr< This > shared_ptr
shared_ptr to this class
VectorValues solve() const
static const Vector kZero
GaussianFactorGraph::shared_ptr buildInitOfInitGraph() const
std::map< std::string, Array< float, 1, 8, DontAlign|RowMajor > > results
detail::initimpl::constructor< Args... > init()
Binds an existing constructor taking arguments Args...
Policy of ActiveSetSolver to solve Linear Programming Problems.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
std::uint64_t Key
Integer nonlinear key type.
This finds a feasible solution for an LP problem.