30 #include <gtest/gtest.h>
41 throw std::runtime_error(
"not implemented");
45 throw std::runtime_error(
"not implemented");
49 throw std::runtime_error(
"not implemented");
56 using namespace ifopt;
70 EXPECT_STREQ(
"ex_component", c.
GetName().c_str());
75 auto c1 = std::make_shared<ExComponent>(0,
"component1");
76 auto c2 = std::make_shared<ExComponent>(1,
"component2");
77 auto c3 = std::make_shared<ExComponent>(2,
"component3");
88 auto c1 = std::make_shared<ExComponent>(0,
"component1");
89 auto c2 = std::make_shared<ExComponent>(1,
"component2");
90 auto c3 = std::make_shared<ExComponent>(2,
"component3");
92 Composite constraint(
"constraint",
false);
93 constraint.AddComponent(c1);
94 constraint.AddComponent(c2);
95 constraint.AddComponent(c3);
96 EXPECT_EQ(0 + 1 + 2, constraint.GetRows());
101 auto c1 = std::make_shared<ExComponent>(0,
"component1");
102 auto c2 = std::make_shared<ExComponent>(1,
"component2");
103 auto c3 = std::make_shared<ExComponent>(2,
"component3");
106 comp.AddComponent(c1);
107 comp.AddComponent(c2);
108 comp.AddComponent(c3);
110 auto c1_new = comp.GetComponent(
"component1");
111 EXPECT_EQ(c1->GetRows(), c1_new->GetRows());
113 auto c2_new = comp.GetComponent<
ExComponent>(
"component2");
114 EXPECT_EQ(c2->GetRows(), c2_new->GetRows());
116 auto c3_new = comp.GetComponent<
ExComponent>(
"component3");
117 EXPECT_NE(c1->GetRows(), c3_new->GetRows());
122 auto c1 = std::make_shared<ExComponent>(0,
"component1");
123 auto c2 = std::make_shared<ExComponent>(1,
"component2");
124 auto c3 = std::make_shared<ExComponent>(2,
"component3");
131 EXPECT_EQ(0 + 1 + 2, comp.
GetRows());