13 #ifndef piecewise_general_creator_test_suite_hpp
14 #define piecewise_general_creator_test_suite_hpp
28 template<
typename data__>
91 std::cout <<
"figure(" << figno <<
");" << std::endl;
94 std::cout <<
"cp_x=[";
95 for (pp=0; pp<ns; ++pp)
99 for (i=0; i<=bez.degree(); ++i)
101 std::cout << bez.get_control_point(i).x();
109 std::cout <<
"];" << std::endl;
111 std::cout <<
"cp_y=[";
112 for (pp=0; pp<ns; ++pp)
116 for (i=0; i<=bez.degree(); ++i)
118 std::cout << bez.get_control_point(i).y();
126 std::cout <<
"];" << std::endl;
128 std::cout <<
"cp_z=[";
129 for (pp=0; pp<ns; ++pp)
133 for (i=0; i<=bez.degree(); ++i)
135 std::cout << bez.get_control_point(i).z();
143 std::cout <<
"];" << std::endl;
146 std::vector<data__> t(129);
147 for (i=0; i<static_cast<index_type>(t.size()); ++i)
149 t[i]=tmin+(tmax-tmin)*static_cast<data__>(i)/(t.size()-1);
153 std::cout <<
"surf_x=[";
154 for (i=0; i<static_cast<index_type>(t.size()); ++i)
156 std::cout << pc.
f(t[i]).x();
157 if (i<static_cast<index_type>(t.size()-1))
160 std::cout <<
"];" << std::endl;
162 std::cout <<
"surf_y=[";
163 for (i=0; i<static_cast<index_type>(t.size()); ++i)
165 std::cout << pc.
f(t[i]).y();
166 if (i<static_cast<index_type>(t.size()-1))
169 std::cout <<
"];" << std::endl;
171 std::cout <<
"surf_z=[";
172 for (i=0; i<static_cast<index_type>(t.size()); ++i)
174 std::cout << pc.
f(t[i]).z();
175 if (i<static_cast<index_type>(t.size()-1))
178 std::cout <<
"];" << std::endl;
180 std::cout <<
"setenv('GNUTERM', 'x11');" << std::endl;
181 std::cout <<
"plot3(surf_x, surf_y, surf_z, '-k');" << std::endl;
182 std::cout <<
"hold on;" << std::endl;
183 std::cout <<
"plot3(cp_x', cp_y', cp_z', '-ok', 'MarkerFaceColor', [0 0 0]);" << std::endl;
184 std::cout <<
"hold off;" << std::endl;
197 joint_data_type joint;
201 TEST_ASSERT(!rtn_flag);
203 TEST_ASSERT(!joint.
use_f());
206 rtn_flag=joint.
set_f(p1);
207 TEST_ASSERT(rtn_flag);
209 TEST_ASSERT(joint.
use_f());
213 TEST_ASSERT(!rtn_flag);
214 TEST_ASSERT(!joint.
use_f());
219 joint_data_type joint;
223 TEST_ASSERT(!rtn_flag);
225 TEST_ASSERT(!joint.
use_f());
231 TEST_ASSERT(!rtn_flag);
233 TEST_ASSERT(!joint.
use_f());
238 rtn_flag=joint.
set_f(p1);
239 TEST_ASSERT(rtn_flag);
241 TEST_ASSERT(joint.
use_f());
247 TEST_ASSERT(rtn_flag);
249 TEST_ASSERT(joint.
use_f());
255 TEST_ASSERT(rtn_flag);
256 TEST_ASSERT(joint.
use_f());
262 TEST_ASSERT(rtn_flag);
263 TEST_ASSERT(joint.
use_f());
269 TEST_ASSERT(rtn_flag);
270 TEST_ASSERT(joint.
use_f());
275 rtn_flag=joint.
set_fp(p2);
276 TEST_ASSERT(rtn_flag);
279 TEST_ASSERT(joint.
use_f());
285 TEST_ASSERT(rtn_flag);
286 TEST_ASSERT(joint.
use_f());
293 joint_data_type joint;
297 TEST_ASSERT(!rtn_flag);
299 TEST_ASSERT(!joint.
use_f());
307 TEST_ASSERT(!rtn_flag);
309 TEST_ASSERT(!joint.
use_f());
317 TEST_ASSERT(!rtn_flag);
319 TEST_ASSERT(!joint.
use_f());
326 rtn_flag=joint.
set_f(p1);
327 TEST_ASSERT(rtn_flag);
329 TEST_ASSERT(joint.
use_f());
337 TEST_ASSERT(rtn_flag);
338 TEST_ASSERT(joint.
use_f());
346 TEST_ASSERT(rtn_flag);
347 TEST_ASSERT(joint.
use_f());
355 TEST_ASSERT(rtn_flag);
356 TEST_ASSERT(joint.
use_f());
363 rtn_flag=joint.
set_fp(p2);
364 TEST_ASSERT(rtn_flag);
367 TEST_ASSERT(joint.
use_f());
375 TEST_ASSERT(rtn_flag);
378 TEST_ASSERT(joint.
use_f());
386 TEST_ASSERT(rtn_flag);
387 TEST_ASSERT(joint.
use_f());
395 TEST_ASSERT(rtn_flag);
396 TEST_ASSERT(joint.
use_f());
404 TEST_ASSERT(rtn_flag);
406 TEST_ASSERT(rtn_flag);
408 TEST_ASSERT(!rtn_flag);
411 rtn_flag=joint.
set_f(p2);
412 TEST_ASSERT(rtn_flag);
414 TEST_ASSERT(rtn_flag);
416 TEST_ASSERT(rtn_flag);
417 TEST_ASSERT(joint.
use_f());
418 TEST_ASSERT(joint.
get_f()==p2);
429 joint_data_type joint;
432 rtn_flag=joint.
set_f(p1);
433 TEST_ASSERT(rtn_flag);
435 TEST_ASSERT(joint.
use_f());
443 TEST_ASSERT(rtn_flag);
445 TEST_ASSERT(joint.
use_f());
453 TEST_ASSERT(rtn_flag);
455 TEST_ASSERT(joint.
use_f());
463 TEST_ASSERT(!rtn_flag);
465 TEST_ASSERT(rtn_flag);
467 TEST_ASSERT(joint.
use_f());
475 TEST_ASSERT(rtn_flag);
477 TEST_ASSERT(joint.
use_f());
485 TEST_ASSERT(!rtn_flag);
487 TEST_ASSERT(rtn_flag);
489 TEST_ASSERT(joint.
use_f());
496 rtn_flag=joint.
set_fp(p1);
497 TEST_ASSERT(rtn_flag);
499 TEST_ASSERT(joint.
use_f());
507 TEST_ASSERT(rtn_flag);
509 TEST_ASSERT(joint.
use_f());
517 TEST_ASSERT(!rtn_flag);
519 TEST_ASSERT(joint.
use_f());
527 TEST_ASSERT(rtn_flag);
531 TEST_ASSERT(joint.
use_f());
539 TEST_ASSERT(rtn_flag);
541 TEST_ASSERT(joint.
use_f());
550 joint_data_type joint;
553 rtn_flag=joint.
set_f(p1);
554 TEST_ASSERT(rtn_flag);
555 rtn_flag=joint.
set_fp(p2);
556 TEST_ASSERT(rtn_flag);
558 TEST_ASSERT(rtn_flag);
560 TEST_ASSERT(joint.
use_f());
568 TEST_ASSERT(rtn_flag);
570 TEST_ASSERT(joint.
use_f());
578 TEST_ASSERT(!rtn_flag);
580 TEST_ASSERT(joint.
use_f());
588 TEST_ASSERT(rtn_flag);
590 TEST_ASSERT(joint.
use_f());
598 TEST_ASSERT(rtn_flag);
600 TEST_ASSERT(joint.
use_f());
608 TEST_ASSERT(!rtn_flag);
610 TEST_ASSERT(joint.
use_f());
618 TEST_ASSERT(rtn_flag);
620 TEST_ASSERT(joint.
use_f());
628 TEST_ASSERT(rtn_flag);
630 TEST_ASSERT(joint.
use_f());
637 rtn_flag=joint.
set_fp(p2);
638 TEST_ASSERT(rtn_flag);
640 TEST_ASSERT(joint.
use_f());
649 joint_data_type j1, j2, j3;
678 joint_data_type j4(j3);
688 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
689 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
691 general_creator_type gc;
692 piecewise_curve_type c;
693 data_type t0(2), t1(4);
707 TEST_ASSERT(rtn_flag);
711 TEST_ASSERT(rtn_flag);
717 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
722 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
734 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
735 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
737 general_creator_type gc;
738 piecewise_curve_type c;
739 data_type t0(2), t1(4);
750 joints[0].set_right_fp(p);
757 TEST_ASSERT(rtn_flag);
761 TEST_ASSERT(rtn_flag);
767 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
772 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
777 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fp(), p_test));
789 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
790 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
792 general_creator_type gc;
793 piecewise_curve_type c;
794 data_type t0(2), t1(4);
805 joints[0].set_right_fpp(p);
812 TEST_ASSERT(rtn_flag);
816 TEST_ASSERT(rtn_flag);
822 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
827 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
832 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fpp(), p_test));
844 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
845 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
847 general_creator_type gc;
848 piecewise_curve_type c;
849 data_type t0(2), t1(4);
860 joints[0].set_right_fp(p);
862 joints[1].set_left_fp(p);
869 TEST_ASSERT(rtn_flag);
873 TEST_ASSERT(!rtn_flag);
880 TEST_ASSERT(rtn_flag);
884 TEST_ASSERT(rtn_flag);
890 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
895 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
900 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fp(), p_test));
905 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
917 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
918 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
920 general_creator_type gc;
921 piecewise_curve_type c;
922 data_type t0(2), t1(4);
933 joints[0].set_right_fp(p);
935 joints[1].set_left_fp(p);
939 joints[0].set_right_fpp(p);
941 joints[1].set_left_fpp(p);
948 TEST_ASSERT(rtn_flag);
952 TEST_ASSERT(rtn_flag);
958 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
963 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
968 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fp(), p_test));
973 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
978 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fpp(), p_test));
983 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fpp(), p_test));
998 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
999 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1001 general_creator_type gc;
1002 piecewise_curve_type c;
1003 std::vector<data_type> t(nsegs+1);
1021 joints[0].set_right_fp(p);
1023 joints[1].set_left_fp(p);
1025 joints[1].set_right_fp(p);
1027 joints[2].set_left_fp(p);
1035 TEST_ASSERT(rtn_flag);
1040 TEST_ASSERT(!rtn_flag);
1048 TEST_ASSERT(rtn_flag);
1053 TEST_ASSERT(rtn_flag);
1057 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1060 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1065 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1070 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1075 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fp(), p_test));
1079 p_test=c.
fp(t[1]-small_num);
1080 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
1084 p_test=c.
fp(t[1]+small_num);
1085 TEST_ASSERT(tol.approximately_equal(joints[1].get_right_fp(), p_test));
1090 TEST_ASSERT(tol.approximately_equal(joints[2].get_left_fp(), p_test));
1101 index_type i, nsegs(5);
1102 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1103 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1105 general_creator_type gc;
1106 piecewise_curve_type c;
1107 std::vector<data_type> t(nsegs+1);
1134 joints[0].set_right_fp(p);
1136 joints[1].set_left_fp(p);
1138 joints[1].set_right_fp(p);
1140 joints[2].set_left_fp(p);
1142 joints[2].set_right_fp(p);
1144 joints[3].set_left_fp(p);
1146 joints[3].set_right_fp(p);
1148 joints[4].set_left_fp(p);
1150 joints[4].set_right_fp(p);
1152 joints[5].set_left_fp(p);
1163 TEST_ASSERT(rtn_flag);
1165 for (i=0; i<nsegs; ++i)
1170 TEST_ASSERT(rtn_flag);
1174 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1177 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1182 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1187 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1192 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
1197 TEST_ASSERT(tol.approximately_equal(joints[4].get_f(), p_test));
1202 TEST_ASSERT(tol.approximately_equal(joints[5].get_f(), p_test));
1207 TEST_ASSERT(tol.approximately_equal(joints[0].get_right_fp(), p_test));
1211 p_test=c.
fp(t[1]-small_num);
1212 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
1216 p_test=c.
fp(t[1]+small_num);
1217 TEST_ASSERT(tol.approximately_equal(joints[1].get_right_fp(), p_test));
1221 p_test=c.
fp(t[2]-small_num);
1222 TEST_ASSERT(tol.approximately_equal(joints[2].get_left_fp(), p_test));
1226 p_test=c.
fp(t[2]+small_num);
1227 TEST_ASSERT(tol.approximately_equal(joints[2].get_right_fp(), p_test));
1231 p_test=c.
fp(t[3]-small_num);
1232 TEST_ASSERT(tol.approximately_equal(joints[3].get_left_fp(), p_test));
1236 p_test=c.
fp(t[3]+small_num);
1237 TEST_ASSERT(tol.approximately_equal(joints[3].get_right_fp(), p_test));
1241 p_test=c.
fp(t[4]-small_num);
1242 TEST_ASSERT(tol.approximately_equal(joints[4].get_left_fp(), p_test));
1246 p_test=c.
fp(t[4]+small_num);
1247 TEST_ASSERT(tol.approximately_equal(joints[4].get_right_fp(), p_test));
1252 TEST_ASSERT(tol.approximately_equal(joints[5].get_left_fp(), p_test));
1266 index_type nsegs(2);
1267 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1268 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1270 general_creator_type gc;
1271 piecewise_curve_type c;
1272 std::vector<data_type> t(nsegs+1);
1297 TEST_ASSERT(rtn_flag);
1302 TEST_ASSERT(rtn_flag);
1305 point_type p_test, p_test1;
1306 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1309 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1314 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1319 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1323 p_test=c.
fp(t[1]-small_num);
1324 p_test1=c.
fp(t[1]+small_num);
1325 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1337 index_type nsegs(3);
1338 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1339 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1341 general_creator_type gc;
1342 piecewise_curve_type c;
1343 std::vector<data_type> t(nsegs+1);
1366 joints[0].set_right_fp(p);
1368 joints[1].set_left_fp(p);
1370 joints[1].set_right_fp(p);
1373 joints[3].set_left_fp(p);
1382 TEST_ASSERT(rtn_flag);
1388 TEST_ASSERT(rtn_flag);
1391 point_type p_test, p_test1;
1392 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1395 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1400 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1405 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1410 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
1414 p_test=c.
fp(t[1]-small_num);
1415 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
1419 p_test=c.
fp(t[1]+small_num);
1420 TEST_ASSERT(tol.approximately_equal(joints[1].get_right_fp(), p_test));
1425 p_test=c.
fp(t[2]-small_num);
1426 p_test1=c.
fp(t[2]+small_num);
1427 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1439 index_type nsegs(3);
1440 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1441 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1443 general_creator_type gc;
1444 piecewise_curve_type c;
1445 std::vector<data_type> t(nsegs+1);
1468 joints[0].set_right_fp(p);
1470 joints[1].set_left_fp(p);
1472 joints[1].set_right_fp(p);
1475 joints[2].set_right_fp(p);
1477 joints[3].set_left_fp(p);
1486 TEST_ASSERT(rtn_flag);
1492 TEST_ASSERT(rtn_flag);
1495 point_type p_test, p_test1;
1496 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1499 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1504 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1509 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1514 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
1518 p_test=c.
fp(t[1]-small_num);
1519 TEST_ASSERT(tol.approximately_equal(joints[1].get_left_fp(), p_test));
1523 p_test=c.
fp(t[1]+small_num);
1524 TEST_ASSERT(tol.approximately_equal(joints[1].get_right_fp(), p_test));
1529 p_test=c.
fp(t[2]-small_num);
1530 p_test1=c.
fp(t[2]+small_num);
1531 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1532 TEST_ASSERT(tol.approximately_equal(joints[2].get_right_fp(), p_test));
1543 index_type i, nsegs(5);
1544 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1545 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1547 general_creator_type gc;
1548 piecewise_curve_type c;
1549 std::vector<data_type> t(nsegs+1);
1589 TEST_ASSERT(rtn_flag);
1591 for (i=0; i<nsegs; ++i)
1596 TEST_ASSERT(rtn_flag);
1599 point_type p_test, p_test1;
1600 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1603 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1608 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1613 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1618 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
1623 TEST_ASSERT(tol.approximately_equal(joints[4].get_f(), p_test));
1628 TEST_ASSERT(tol.approximately_equal(joints[5].get_f(), p_test));
1632 p_test=c.
fp(t[1]-small_num);
1633 p_test1=c.
fp(t[1]+small_num);
1634 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1638 p_test=c.
fp(t[2]-small_num);
1639 p_test1=c.
fp(t[2]+small_num);
1640 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1644 p_test=c.
fp(t[3]-small_num);
1645 p_test1=c.
fp(t[3]+small_num);
1646 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1650 p_test=c.
fp(t[4]-small_num);
1651 p_test1=c.
fp(t[4]+small_num);
1652 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1665 index_type nsegs(2);
1666 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1667 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1669 general_creator_type gc;
1670 piecewise_curve_type c;
1671 std::vector<data_type> t(nsegs+1);
1696 TEST_ASSERT(rtn_flag);
1701 TEST_ASSERT(rtn_flag);
1704 point_type p_test, p_test1;
1705 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1708 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1713 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1718 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1722 p_test=c.
fp(t[1]-small_num);
1723 p_test1=c.
fp(t[1]+small_num);
1724 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1728 p_test=c.
fpp(t[1]-small_num);
1729 p_test1=c.
fpp(t[1]+small_num);
1730 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1741 index_type nsegs(2);
1742 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1743 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1745 general_creator_type gc;
1746 piecewise_curve_type c;
1747 std::vector<data_type> t(nsegs+1);
1772 TEST_ASSERT(rtn_flag);
1777 TEST_ASSERT(rtn_flag);
1780 point_type p_test, p_test1;
1781 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1784 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1789 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1794 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1798 p_test=c.
fp(t[1]-small_num);
1799 p_test1=c.
fp(t[1]+small_num);
1800 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1804 p_test=c.
fpp(t[1]-small_num);
1805 p_test1=c.
fpp(t[1]+small_num);
1806 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1817 index_type nsegs(2);
1818 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1819 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1821 general_creator_type gc;
1822 piecewise_curve_type c;
1823 std::vector<data_type> t(nsegs+1);
1848 TEST_ASSERT(rtn_flag);
1853 TEST_ASSERT(rtn_flag);
1856 point_type p_test, p_test1;
1857 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1860 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1865 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1870 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1874 p_test=c.
fp(t[1]-small_num);
1875 p_test1=c.
fp(t[1]+small_num);
1876 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1880 p_test=c.
fpp(t[1]-small_num);
1881 p_test1=c.
fpp(t[1]+small_num);
1882 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1893 index_type i, nsegs(5);
1894 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
1895 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
1897 general_creator_type gc;
1898 piecewise_curve_type c;
1899 std::vector<data_type> t(nsegs+1);
1939 TEST_ASSERT(rtn_flag);
1941 for (i=0; i<nsegs; ++i)
1946 TEST_ASSERT(rtn_flag);
1949 point_type p_test, p_test1;
1950 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
1953 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
1958 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
1963 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
1968 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
1973 TEST_ASSERT(tol.approximately_equal(joints[4].get_f(), p_test));
1978 TEST_ASSERT(tol.approximately_equal(joints[5].get_f(), p_test));
1982 p_test=c.
fp(t[1]-small_num);
1983 p_test1=c.
fp(t[1]+small_num);
1984 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1988 p_test=c.
fp(t[2]-small_num);
1989 p_test1=c.
fp(t[2]+small_num);
1990 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
1994 p_test=c.
fp(t[3]-small_num);
1995 p_test1=c.
fp(t[3]+small_num);
1996 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2000 p_test=c.
fp(t[4]-small_num);
2001 p_test1=c.
fp(t[4]+small_num);
2002 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2006 p_test=c.
fpp(t[1]-small_num);
2007 p_test1=c.
fpp(t[1]+small_num);
2008 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2012 p_test=c.
fpp(t[2]-small_num);
2013 p_test1=c.
fpp(t[2]+small_num);
2014 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2018 p_test=c.
fpp(t[3]-small_num);
2019 p_test1=c.
fpp(t[3]+small_num);
2020 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2024 p_test=c.
fpp(t[4]-small_num);
2025 p_test1=c.
fpp(t[4]+small_num);
2026 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2037 index_type i, nsegs(5);
2038 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
2039 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
2041 general_creator_type gc;
2042 piecewise_curve_type c;
2043 std::vector<data_type> t(nsegs+1);
2083 TEST_ASSERT(rtn_flag);
2085 for (i=0; i<nsegs; ++i)
2090 TEST_ASSERT(rtn_flag);
2093 point_type p_test, p_test1;
2094 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
2097 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
2102 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
2107 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
2112 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
2117 TEST_ASSERT(tol.approximately_equal(joints[4].get_f(), p_test));
2122 TEST_ASSERT(tol.approximately_equal(joints[5].get_f(), p_test));
2126 p_test=c.
fp(t[1]-small_num);
2127 p_test1=c.
fp(t[1]+small_num);
2128 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2132 p_test=c.
fp(t[2]-small_num);
2133 p_test1=c.
fp(t[2]+small_num);
2134 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2138 p_test=c.
fp(t[3]-small_num);
2139 p_test1=c.
fp(t[3]+small_num);
2140 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2144 p_test=c.
fp(t[4]-small_num);
2145 p_test1=c.
fp(t[4]+small_num);
2146 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2150 p_test=c.
fpp(t[1]-small_num);
2151 p_test1=c.
fpp(t[1]+small_num);
2152 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2156 p_test=c.
fpp(t[2]-small_num);
2157 p_test1=c.
fpp(t[2]+small_num);
2158 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2162 p_test=c.
fpp(t[3]-small_num);
2163 p_test1=c.
fpp(t[3]+small_num);
2164 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2168 p_test=c.
fpp(t[4]-small_num);
2169 p_test1=c.
fpp(t[4]+small_num);
2170 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2181 index_type i, nsegs(5);
2182 std::vector<typename general_creator_type::joint_data> joints(nsegs+1);
2183 std::vector<typename general_creator_type::index_type> max_degree(nsegs);
2185 general_creator_type gc;
2186 piecewise_curve_type c;
2187 std::vector<data_type> t(nsegs+1);
2227 TEST_ASSERT(rtn_flag);
2229 for (i=0; i<nsegs; ++i)
2234 TEST_ASSERT(rtn_flag);
2237 point_type p_test, p_test1;
2238 data_type small_num(100*std::numeric_limits<data_type>::epsilon());
2241 TEST_ASSERT(tol.approximately_equal(joints[0].get_f(), p_test));
2246 TEST_ASSERT(tol.approximately_equal(joints[1].get_f(), p_test));
2251 TEST_ASSERT(tol.approximately_equal(joints[2].get_f(), p_test));
2256 TEST_ASSERT(tol.approximately_equal(joints[3].get_f(), p_test));
2261 TEST_ASSERT(tol.approximately_equal(joints[4].get_f(), p_test));
2266 TEST_ASSERT(tol.approximately_equal(joints[5].get_f(), p_test));
2270 p_test=c.
fp(t[1]-small_num);
2271 p_test1=c.
fp(t[1]+small_num);
2272 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2276 p_test=c.
fp(t[2]-small_num);
2277 p_test1=c.
fp(t[2]+small_num);
2278 TEST_ASSERT(!tol.approximately_equal(p_test, p_test1));
2282 p_test=c.
fp(t[3]-small_num);
2283 p_test1=c.
fp(t[3]+small_num);
2284 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2288 p_test=c.
fp(t[4]-small_num);
2289 p_test1=c.
fp(t[4]+small_num);
2290 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2294 p_test=c.
fpp(t[1]-small_num);
2295 p_test1=c.
fpp(t[1]+small_num);
2296 TEST_ASSERT(!tol.approximately_equal(p_test, p_test1));
2300 p_test=c.
fpp(t[2]-small_num);
2301 p_test1=c.
fpp(t[2]+small_num);
2302 TEST_ASSERT(!tol.approximately_equal(p_test, p_test1));
2306 p_test=c.
fpp(t[3]-small_num);
2307 p_test1=c.
fpp(t[3]+small_num);
2308 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
2312 p_test=c.
fpp(t[4]-small_num);
2313 p_test1=c.
fpp(t[4]+small_num);
2314 TEST_ASSERT(tol.approximately_equal(p_test, p_test1));
piecewise_curve_type::point_type point_type
Definition: piecewise_general_creator_test_suite.hpp:34
general_creator_type::joint_data joint_data_type
Definition: piecewise_general_creator_test_suite.hpp:39
point_type get_f() const
Definition: piecewise_general_creator.hpp:138
bool set_f(const point_type &p)
Definition: piecewise_general_creator.hpp:132
virtual bool create(piecewise< bezier, data_type, dim__, tolerance_type > &pc) const
Definition: piecewise_general_creator.hpp:432
void AddTests(const float &)
Definition: piecewise_general_creator_test_suite.hpp:44
Definition: piecewise_general_creator_test_suite.hpp:29
bool unset_left_fpp()
Definition: piecewise_general_creator.hpp:283
bool unset_right_fpp()
Definition: piecewise_general_creator.hpp:289
void set_segment_dt(const data_type &dtt, const index_type &i)
Definition: piecewise_creator_base.hpp:64
bool set_right_fpp(const point_type &fppr)
Definition: piecewise_general_creator.hpp:242
void AddTests(const double &)
Definition: piecewise_general_creator_test_suite.hpp:53
bool set_continuity(joint_continuity jc)
Definition: piecewise_general_creator.hpp:305
bool unset_fpp()
Definition: piecewise_general_creator.hpp:278
bool set_conditions(const std::vector< joint_data > &jnts, const std::vector< index_type > &maxd, bool cl=false)
Definition: piecewise_general_creator.hpp:392
point_type get_right_fpp() const
Definition: piecewise_general_creator.hpp:268
tol__ tolerance_type
Definition: piecewise.hpp:278
bool set_right_fp(const point_type &fpr)
Definition: piecewise_general_creator.hpp:164
data__ data_type
Definition: piecewise.hpp:276
~piecewise_general_creator_test_suite()
Definition: piecewise_general_creator_test_suite.hpp:77
point_type get_right_fp() const
Definition: piecewise_general_creator.hpp:190
data_type get_parameter_min() const
Definition: piecewise.hpp:366
bool unset_fp()
Definition: piecewise_general_creator.hpp:200
curve_type::index_type index_type
Definition: piecewise.hpp:271
bool use_left_fp() const
Definition: piecewise_general_creator.hpp:218
index_type number_segments() const
Definition: piecewise.hpp:419
point_type get_left_fpp() const
Definition: piecewise_general_creator.hpp:264
bool check_state() const
Definition: piecewise_general_creator.hpp:315
piecewise_curve_type::index_type index_type
Definition: piecewise_general_creator_test_suite.hpp:36
bool set_fp(const point_type &p)
Definition: piecewise_general_creator.hpp:178
joint_continuity get_continuity() const
Definition: piecewise_general_creator.hpp:310
Definition: piecewise.hpp:244
bool unset_left_fp()
Definition: piecewise_general_creator.hpp:205
Definition: piecewise_general_creator.hpp:36
point_type fpp(const data_type &t) const
Definition: piecewise.hpp:1765
bool use_right_fp() const
Definition: piecewise_general_creator.hpp:222
curve__< data__, dim__, tol__ > curve_type
Definition: piecewise.hpp:270
piecewise_curve_type::curve_type curve_type
Definition: piecewise_general_creator_test_suite.hpp:33
void create_multi_curve_2nd_deriv_dep_test()
Definition: piecewise_general_creator_test_suite.hpp:1661
void create_joint_test()
Definition: piecewise_general_creator_test_suite.hpp:187
void octave_print(int figno, const piecewise_curve_type &pc) const
Definition: piecewise_general_creator_test_suite.hpp:82
bool use_left_fpp() const
Definition: piecewise_general_creator.hpp:296
void create_multi_curve_1st_deriv_dep_test()
Definition: piecewise_general_creator_test_suite.hpp:1262
void create_single_curve_test()
Definition: piecewise_general_creator_test_suite.hpp:683
Definition: piecewise_general_creator.hpp:57
data_type get_parameter_max() const
Definition: piecewise.hpp:374
point_type fp(const data_type &t) const
Definition: piecewise.hpp:1748
bool unset_f()
Definition: piecewise_general_creator.hpp:139
void AddTests(const long double &)
Definition: piecewise_general_creator_test_suite.hpp:62
bool unset_right_fp()
Definition: piecewise_general_creator.hpp:211
Definition: piecewise_general_creator.hpp:58
point_type f(const data_type &t) const
Definition: piecewise.hpp:1732
eli::geom::curve::piecewise< eli::geom::curve::bezier, data__, 3 > piecewise_curve_type
Definition: piecewise_general_creator_test_suite.hpp:32
eli::geom::curve::piecewise_general_creator< data__, 3, tolerance_type > general_creator_type
Definition: piecewise_general_creator_test_suite.hpp:38
tolerance_type tol
Definition: piecewise_general_creator_test_suite.hpp:41
bool set_fpp(const point_type &p)
Definition: piecewise_general_creator.hpp:256
bool use_right_fpp() const
Definition: piecewise_general_creator.hpp:300
Definition: piecewise_general_creator.hpp:56
void create_multi_curve_no_dep_test()
Definition: piecewise_general_creator_test_suite.hpp:993
piecewise_curve_type::tolerance_type tolerance_type
Definition: piecewise_general_creator_test_suite.hpp:37
error_code get(curve_type &curve, const index_type &index) const
Definition: piecewise.hpp:729
curve_type::point_type point_type
Definition: piecewise.hpp:272
bool set_left_fpp(const point_type &fppl)
Definition: piecewise_general_creator.hpp:228
point_type get_left_fp() const
Definition: piecewise_general_creator.hpp:186
void set_t0(const data_type &tt0)
Definition: piecewise_creator_base.hpp:61
piecewise_general_creator_test_suite()
Definition: piecewise_general_creator_test_suite.hpp:73
bool set_left_fp(const point_type &fpl)
Definition: piecewise_general_creator.hpp:150
bool use_f() const
Definition: piecewise_general_creator.hpp:144
piecewise_curve_type::data_type data_type
Definition: piecewise_general_creator_test_suite.hpp:35
Definition: piecewise_general_creator.hpp:61