int poll_main () { if (1) { /** * Poll test */ PThreadController poll; poll.push([] { std::cout << "Whahoo\n"; }); poll.push(std::bind(&MyType::valami, MyType(), 12, 123)); poll.reset(); poll.join(); poll.restart(); poll.push([] { std::cout << "Whahoo\n"; }); poll.push(std::bind(&MyType::valami, MyType(), 12, 123)); poll.reset(); } }
MyClass() { bools[0] = true; bools[1] = false; ints[0] = -10; ints[1] = 10; ints[2] = 100; strings.push_back("string 0"); strings.push_back("string 1"); strings.push_back("string 2"); strings.push_back("string 3"); objects.push_back(MyType(0)); objects.push_back(MyType(1)); objects.push_back(MyType(2)); objects.push_back(MyType(3)); objects.push_back(MyType(4)); }
bool CheckNumericType(void) { bool ok = true; MyType A[4]; A[0] = MyType(1); A[1] = MyType(2); A[2] = MyType(3); A[3] = MyType(4); MyType b[2]; b[0] = MyType(1); b[1] = MyType(2); MyType x[2]; Solve(A, x, b); MyType sum; sum = A[0] * x[0] + A[1] * x[1]; ok &= CppAD::NearEqual(sum.Double(), b[0].Double(), 1e-10, 1e-10); sum = A[2] * x[0] + A[3] * x[1]; ok &= CppAD::NearEqual(sum.Double(), b[1].Double(), 1e-10, 1e-10); return ok; }
// CRTP MyType unaryMinus() const { return MyType(-elements[0], -elements[1]); }
// CRTP MyType unaryPlus() const { return MyType(+elements[0], +elements[1]); }
int main() { test(7); test(MyType()); }