Example shows Result class use.
#include "shared-tests/fixture.hh"
#include <iostream>
using namespace roboptim;
{
{}
void impl_compute (result_ref res,
const_argument_ref x) const
{
res (0) = x[0];
}
};
BOOST_FIXTURE_TEST_SUITE (core, TestSuiteConfiguration)
BOOST_AUTO_TEST_CASE (result)
{
boost::shared_ptr<boost::test_tools::output_test_stream>
output = retrievePattern ("result");
F f;
F::size_type c_size = 4;
result.constraints.resize (c_size);
result.constraints.setZero ();
result.lambda.resize (c_size);
result.lambda.setZero ();
result.constraint_violation = 0.;
assert (result.x.size () == 3);
assert (result.value.size () == 8);
assert (result.lambda.size () == c_size);
(*output) << result << std::endl;
std::cout << output->str () << std::endl;
BOOST_CHECK (output->match_pattern ());
}
BOOST_AUTO_TEST_SUITE_END ()