77 #ifndef SLIP_DERIVATIVES_HPP
78 #define SLIP_DERIVATIVES_HPP
154 template<
class Container2D>
157 const std::size_t sch_shift,
161 assert(sch_ord >= sch_shift);
164 Container2D D(sch_ord+1,sch_ord+1,0.0);
166 for(std::size_t i = 0; i <= sch_ord; ++i)
169 tmp[i] =
typename Container2D::value_type(
int(i) -
int(sch_shift));
171 for(std::size_t i = 0; i <= sch_ord; ++i)
173 for(std::size_t j = 1; j <= sch_ord; ++j)
175 D[i][j] = D[i][j-1] * tmp[i] /
typename Container2D::value_type(j);
179 Dinv.resize(sch_ord+1,sch_ord+1);
211 template<
class Container2D>
214 const std::size_t sch_shift,
215 const typename Container2D::value_type& h,
219 assert(sch_ord >= sch_shift);
220 assert(h !=
typename Container2D::value_type(0));
221 typedef typename Container2D::value_type value_type;
224 Container2D D(sch_ord+1,sch_ord+1,0.0);
226 for(std::size_t i = 0; i <= sch_ord; ++i)
229 tmp[i] = value_type(
int(i) -
int(sch_shift));
231 for(std::size_t i = 0; i <= sch_ord; ++i)
233 for(std::size_t j = 1; j <= sch_ord; ++j)
235 D[i][j] = D[i][j-1] * tmp[i] / value_type(j);
239 Dinv.resize(sch_ord+1,sch_ord+1);
242 value_type inv_h = value_type(1)/h;
243 for(std::size_t i = 1; i <= sch_ord; ++i)
245 for(std::size_t j = 0; j <= sch_ord; ++j)
281 template<
typename KernelsIterator>
284 const std::size_t sch_ord,
285 const std::size_t sch_shift,
286 std::vector<KernelsIterator>& kernels_first)
293 for (std::size_t bord_shift = 0; bord_shift < sch_shift; ++bord_shift)
302 for (std::size_t bord_shift = sch_shift + 1; bord_shift <= sch_ord; ++bord_shift)
339 template<
typename KernelsIterator>
342 const std::size_t sch_ord,
343 const std::size_t sch_shift,
344 const typename std::iterator_traits<KernelsIterator>::value_type& h,
345 std::vector<KernelsIterator>& kernels_first)
352 for (std::size_t bord_shift = 0; bord_shift < sch_shift; ++bord_shift)
361 for (std::size_t bord_shift = sch_shift + 1; bord_shift <= sch_ord; ++bord_shift)
415 template<
typename SrcIter,
typename Container2D,
typename ResIter>
418 const std::size_t der_ord,
419 const std::size_t sch_ord,
420 const std::size_t sch_shift,
421 const Container2D& M,
424 assert(sch_ord >= der_ord);
425 assert(sch_shift <= sch_ord);
429 for(std::size_t i=0; i<=sch_ord; ++i)
430 K[sch_ord-i]=M[der_ord][i];
433 K.
begin(),K.
end(),sch_ord-sch_shift,sch_shift,
451 for (std::size_t bord_shift = 0; bord_shift < sch_shift; ++bord_shift)
456 for(std::size_t i = 0; i <= sch_ord; ++i)
457 K[sch_ord - i] = Dinv[der_ord][i];
460 K.
begin(),K.
end(),(sch_ord - bord_shift),
462 result + bord_shift);
468 for (std::size_t bord_shift = sch_shift + 1; bord_shift <= sch_ord; ++bord_shift)
473 for(std::size_t i = 0; i <= sch_ord; ++i)
474 K[sch_ord - i] = Dinv[der_ord][i];
479 K.
begin(),K.
end(),(sch_ord - bord_shift),bord_shift,
480 (result + (last-first))-(1 + sch_ord) + bord_shift);
510 template<
typename SrcIter,
typename KernelsIterator,
typename ResIter>
513 const std::size_t der_ord,
514 const std::size_t sch_ord,
515 const std::size_t sch_shift,
516 const std::vector<KernelsIterator>& kernels_first,
519 assert(sch_ord >= der_ord);
520 assert(sch_shift <= sch_ord);
522 std::size_t sch_ord_plus_one = sch_ord + 1;
524 kernels_first[0],kernels_first[0] + sch_ord_plus_one,
541 for (std::size_t bord_shift = 0; bord_shift < sch_shift; ++bord_shift)
545 kernels_first[bord_shift+1],
546 kernels_first[bord_shift+1]+ sch_ord_plus_one,
547 (sch_ord - bord_shift),
549 result + bord_shift);
555 for (std::size_t bord_shift = sch_shift + 1; bord_shift <= sch_ord; ++bord_shift)
560 kernels_first[bord_shift],
561 kernels_first[bord_shift]+ sch_ord_plus_one,
562 (sch_ord - bord_shift),
564 (result + (last-first))-sch_ord_plus_one + bord_shift);
590 template<
typename Iterator2d1,
typename Iterator2d2,
typename T>
596 const std::size_t der_order,
597 const std::size_t sch_order,
601 assert(sch_order >= der_order);
602 assert( ((der_dir ==
X_DIRECTION) && (
int((I_bot-I_up)[0]) >
int(sch_order)))
603 ||((der_dir ==
Y_DIRECTION) && (
int((I_bot-I_up)[1]) >
int(sch_order))) );
604 assert((sch_order / 2) <= sch_order);
605 assert((R_bot - R_up) == (I_bot-I_up));
606 typedef typename Iterator2d1::value_type value_type;
607 typedef typename Iterator2d1::size_type size_type;
608 size_type sch_shift = sch_order / 2;
613 std::vector<typename slip::Matrix<T>::iterator> kernels_iterators(sch_order + 1);
614 for(size_type i = 0; i < (sch_order + 1); ++i)
616 kernels_iterators[i] = kernels.
row_begin(i);
624 size_type rows = size_type((I_bot-I_up)[0]);
625 for(size_type i = 0; i < rows; ++i)
642 size_type cols = size_type((I_bot-I_up)[1]);
643 for(size_type j = 0; j < cols; ++j)
692 template<
typename RandomAccessIterator3d1,
693 typename RandomAccessIterator3d2,
697 RandomAccessIterator3d1 I_back_bot,
700 const std::size_t der_order,
701 const std::size_t sch_order,
702 RandomAccessIterator3d2 R_fup,
703 RandomAccessIterator3d2 R_back_bot)
705 assert(sch_order >= der_order);
706 assert( ((der_dir ==
X_DIRECTION) && (
int((I_back_bot-I_fup)[2]) >
int(sch_order)))
707 ||((der_dir ==
Y_DIRECTION) && (
int((I_back_bot-I_fup)[1]) >
int(sch_order)))
708 ||((der_dir ==
Z_DIRECTION) && (
int((I_back_bot-I_fup)[0]) >
int(sch_order))));
709 assert((sch_order / 2) <= sch_order);
710 assert((R_back_bot - R_fup) == (I_back_bot-I_fup));
711 typedef typename RandomAccessIterator3d1::value_type value_type;
712 typedef typename RandomAccessIterator3d1::size_type size_type;
713 size_type sch_shift = sch_order / 2;
718 std::vector<typename slip::Matrix<T>::iterator> kernels_iterators(sch_order + 1);
719 std::vector<typename slip::Matrix<T>::reverse_iterator> rkernels_iterators(sch_order + 1);
720 for(size_type i = 0; i < (sch_order + 1); ++i)
722 kernels_iterators[i] = kernels.
row_begin(i);
723 rkernels_iterators[i] = kernels.
row_rbegin(i);
731 const size_type rows =
static_cast<std::size_t
>((I_back_bot-I_fup)[1]);
732 const size_type slices =
static_cast<std::size_t
>((I_back_bot-I_fup)[0]);
733 for(size_type k = 0; k < slices; ++k)
735 for(size_type i = 0; i < rows; ++i)
743 R_fup.row_begin(k,i));
753 const size_type cols =
static_cast<std::size_t
>((I_back_bot-I_fup)[2]);
754 const size_type slices =
static_cast<std::size_t
>((I_back_bot-I_fup)[0]);
756 for(size_type k = 0; k < slices; ++k)
758 for(size_type j = 0; j < cols; ++j)
766 R_fup.col_begin(k,j));
775 const size_type rows =
static_cast<std::size_t
>((I_back_bot-I_fup)[1]);
776 const size_type cols =
static_cast<std::size_t
>((I_back_bot-I_fup)[2]);
778 for(size_type i = 0; i < rows; ++i)
780 for(size_type j = 0; j < cols; ++j)
783 I_fup.slice_end(i,j),
788 R_fup.slice_begin(i,j));
876 template<
typename RandomAccessIterator4d1,
877 typename RandomAccessIterator4d2,
881 RandomAccessIterator4d1 I_last_back_bot,
884 const std::size_t der_order,
885 const std::size_t sch_order,
886 RandomAccessIterator4d2 R_ffup,
887 RandomAccessIterator4d2 R_last_back_bot)
889 assert(sch_order >= der_order);
890 assert( ((der_dir ==
T_DIRECTION) && (
int((I_last_back_bot-I_ffup)[0]) >
int(sch_order)))
891 ||((der_dir ==
S_DIRECTION) && (
int((I_last_back_bot-I_ffup)[3]) >
int(sch_order)))
892 ||((der_dir ==
R_DIRECTION) && (
int((I_last_back_bot-I_ffup)[2]) >
int(sch_order)))
893 ||((der_dir ==
C_DIRECTION) && (
int((I_last_back_bot-I_ffup)[1]) >
int(sch_order))));
894 assert((sch_order / 2) <= sch_order);
895 assert((R_last_back_bot - R_ffup) == (I_last_back_bot-I_ffup));
896 typedef typename RandomAccessIterator4d1::value_type value_type;
897 typedef typename RandomAccessIterator4d1::size_type size_type;
898 size_type sch_shift = sch_order / 2;
903 std::vector<typename slip::Matrix<T>::iterator> kernels_iterators(sch_order + 1);
904 std::vector<typename slip::Matrix<T>::reverse_iterator> rkernels_iterators(sch_order + 1);
905 for(size_type i = 0; i < (sch_order + 1); ++i)
907 kernels_iterators[i] = kernels.
row_begin(i);
908 rkernels_iterators[i] = kernels.
row_rbegin(i);
916 const size_type rows =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[2]);
917 const size_type cols =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[3]);
918 const size_type slices =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[1]);
919 for(size_type k = 0; k < slices; ++k)
921 for(size_type i = 0; i < rows; ++i)
923 for(size_type j = 0; j < cols; ++j)
926 I_ffup.slab_end(k,i,j),
931 R_ffup.slab_begin(k,i,j));
942 const size_type rows =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[2]);
943 const size_type slices =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[1]);
944 const size_type slabs =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[0]);
945 for(size_type t = 0; t < slabs; ++t)
947 for(size_type k = 0; k < slices; ++k)
949 for(size_type i = 0; i < rows; ++i)
952 I_ffup.row_end(t,k,i),
957 R_ffup.row_begin(t,k,i));
968 const size_type cols =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[3]);
969 const size_type slices =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[1]);
970 const size_type slabs =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[0]);
971 for(size_type t = 0; t < slabs; ++t)
973 for(size_type k = 0; k < slices; ++k)
975 for(size_type j = 0; j < cols; ++j)
978 I_ffup.col_end(t,k,j),
983 R_ffup.col_begin(t,k,j));
993 const size_type rows =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[2]);
994 const size_type cols =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[3]);
995 const size_type slabs =
static_cast<std::size_t
>((I_last_back_bot-I_ffup)[0]);
996 for(size_type t = 0; t < slabs; ++t)
998 for(size_type i = 0; i < rows; ++i)
1000 for(size_type j = 0; j < cols; ++j)
1003 I_ffup.slice_end(t,i,j),
1008 R_ffup.slice_begin(t,i,j));
1025 template<
typename Real>
1027 Real
minmod(
const Real gplus,
const Real gminus)
1031 if (gplus*gminus > Real())
1045 template<
typename Real>
1055 template<
typename Real>
1066 template<
typename Real>
1079 template<
typename Real>
1097 template<
typename Real,
typename>
1100 template <
typename _II>
1104 Real left = *(it - 1);
1105 Real right = *(it + 1);
1107 return Real(0.5) * (right - left);
1111 template<
typename Real>
1112 struct __dx<Real,std::random_access_iterator_tag>
1114 template <
typename _II>
1118 Real left = *(it - 1);
1119 Real right = *(it + 1);
1121 return Real(0.5) * (right - left);
1125 template<
typename Real>
1126 struct __dx<Real, std::random_access_iterator2d_tag>
1128 template <
typename _II>
1132 Real left = it[slip::n_8c[4]];
1133 Real right = it[slip::n_8c[0]];
1135 return Real(0.5) * (right - left);
1139 template<
typename Real>
1140 struct __dx<Real, std::random_access_iterator3d_tag>
1142 template <
typename _II>
1146 Real left = it[slip::n_6c[3]];
1147 Real right = it[slip::n_6c[1]];
1149 return Real(0.5) * (right - left);
1159 template<
typename Real>
1160 struct __dx<Real,std::random_access_iterator4d_tag>
1162 template <
typename _II>
1166 Real left = it[slip::n_4d_8c[4]];
1167 Real right = it[slip::n_4d_8c[2]];
1169 return Real(0.5) * (right - left);
1174 template<
typename Real>
struct Dx
1178 template<
typename Iterator>
1181 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1182 return __dx<Real,_Category>::dx(it);
1191 template<
typename Real,
typename>
1194 template <
typename _II>
1198 Real left = *(it - 1);
1199 Real right = *(it + 1);
1201 return Real(0.5) * (right - left);
1205 template<
typename Real>
1206 struct __dy<Real,std::random_access_iterator_tag>
1208 template <
typename _II>
1212 return __dx<Real,std::random_access_iterator_tag>::dx(it);
1216 template<
typename Real>
1217 struct __dy<Real, std::random_access_iterator2d_tag>
1219 template <
typename _II>
1223 Real top = it[slip::n_8c[2]];
1224 Real bottom = it[slip::n_8c[6]];
1226 return Real(0.5) * (top - bottom);
1230 template<
typename Real>
1231 struct __dy<Real, std::random_access_iterator3d_tag>
1233 template <
typename _II>
1237 Real top = it[slip::n_6c[2]];
1238 Real bottom = it[slip::n_6c[4]];
1240 return Real(0.5) * (top - bottom);
1252 template<
typename Real>
1253 struct __dy<Real, std::random_access_iterator4d_tag>
1255 template <
typename _II>
1259 Real top = it[slip::n_4d_8c[3]];
1260 Real bottom = it[slip::n_4d_8c[5]];
1262 return Real(0.5) * (top - bottom);
1266 template<
typename Real>
struct Dy
1270 template<
typename Iterator>
1273 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1274 return __dy<Real,_Category>::dy(it);
1282 template<
typename Real,
typename>
1285 template <
typename _II>
1289 Real left = *(it - 1);
1290 Real right = *(it + 1);
1292 return Real(0.5) * (right - left);
1296 template<
typename Real>
1297 struct __dz<Real,std::random_access_iterator_tag>
1299 template <
typename _II>
1303 return __dx<Real,std::random_access_iterator_tag>::dx(it);
1307 template<
typename Real>
1308 struct __dz<Real, std::random_access_iterator2d_tag>
1310 template <
typename _II>
1314 Real top = it[slip::n_8c[5]];
1315 Real bottom = it[slip::n_8c[0]];
1317 return Real(0.5) * (top - bottom);
1321 template<
typename Real>
1322 struct __dz<Real, std::random_access_iterator3d_tag>
1324 template <
typename _II>
1328 Real top = it[slip::n_6c[0]];
1329 Real bottom = it[slip::n_6c[5]];
1331 return Real(0.5) * (top - bottom);
1344 template<
typename Real>
1345 struct __dz<Real, std::random_access_iterator4d_tag>
1347 template <
typename _II>
1351 Real top = it[slip::n_4d_8c[1]];
1352 Real bottom = it[slip::n_4d_8c[6]];
1354 return Real(0.5) * (top - bottom);
1359 template<
typename Real>
struct Dz
1363 template<
typename Iterator>
1366 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1367 return __dz<Real,_Category>::dz(it);
1378 template<
typename Real,
typename>
1381 template <
typename _II>
1385 Real prev = *(it - 1);
1386 Real next = *(it + 1);
1388 return Real(0.5) * (next - prev);
1392 template<
typename Real>
1393 struct __dt<Real,std::random_access_iterator_tag>
1395 template <
typename _II>
1399 return __dx<Real,std::random_access_iterator_tag>::dx(it);
1403 template<
typename Real>
1404 struct __dt<Real, std::random_access_iterator2d_tag>
1406 template <
typename _II>
1410 Real prev = it[slip::n_8c[5]];
1411 Real next = it[slip::n_8c[0]];
1413 return Real(next - prev);
1417 template<
typename Real>
1418 struct __dt<Real, std::random_access_iterator3d_tag>
1420 template <
typename _II>
1424 Real prev = it[slip::n_26c[5]];
1425 Real next = it[slip::n_26c[19]];
1427 return Real(next - prev);
1431 template<
typename Real>
1432 struct __dt<Real, std::random_access_iterator4d_tag>
1434 template <
typename _II>
1438 Real prev = it[slip::n_4d_8c[0]];
1439 Real next = it[slip::n_4d_8c[7]];
1441 return Real(0.5) * (next - prev);
1445 template<
typename Real>
struct Dt
1449 template<
typename Iterator>
1452 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1453 return __dt<Real,_Category>::dt(it);
1462 template<
typename Real,
typename>
1465 template <
typename _II>
1470 Real right = *(it + 1);
1472 return (right - center);
1476 template<
typename Real>
1477 struct __dx_fwd<Real,std::random_access_iterator_tag>
1479 template <
typename _II>
1484 Real right = *(it + 1);
1486 return (right - center);
1491 template<
typename Real>
1492 struct __dx_fwd<Real, std::random_access_iterator2d_tag>
1494 template <
typename _II>
1499 Real right = it[slip::n_8c[0]];
1501 return (right - center);
1505 template<
typename Real>
1506 struct __dx_fwd<Real, std::random_access_iterator3d_tag>
1508 template <
typename _II>
1513 Real right = it[slip::n_6c[1]];
1515 return (right - center);
1526 template<
typename Real>
1527 struct __dx_fwd<Real, std::random_access_iterator4d_tag>
1529 template <
typename _II>
1534 Real right = it[slip::n_4d_8c[2]];
1536 return (right - center);
1545 template<
typename Iterator>
1548 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1549 return __dx_fwd<Real,_Category>::dx_fwd(it);
1556 template<
typename Real,
typename>
1559 template <
typename _II>
1564 Real right = *(it + 1);
1566 return (right - center);
1570 template<
typename Real>
1571 struct __dy_fwd<Real,std::random_access_iterator_tag>
1573 template <
typename _II>
1577 return __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
1581 template<
typename Real>
1582 struct __dy_fwd<Real, std::random_access_iterator2d_tag>
1584 template <
typename _II>
1588 Real top = it[slip::n_8c[2]];
1591 return (top - center);
1595 template<
typename Real>
1596 struct __dy_fwd<Real, std::random_access_iterator3d_tag>
1598 template <
typename _II>
1602 Real top = it[slip::n_6c[2]];
1605 return (top - center);
1616 template<
typename Real>
1617 struct __dy_fwd<Real, std::random_access_iterator4d_tag>
1619 template <
typename _II>
1623 Real top = it[slip::n_4d_8c[3]];
1626 return (top - center);
1635 template<
typename Iterator>
1638 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1639 return __dy_fwd<Real,_Category>::dy_fwd(it);
1646 template<
typename Real,
typename>
1649 template <
typename _II>
1654 Real right = *(it + 1);
1656 return (right - center);
1660 template<
typename Real>
1661 struct __dz_fwd<Real,std::random_access_iterator_tag>
1663 template <
typename _II>
1667 return __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
1671 template<
typename Real>
1672 struct __dz_fwd<Real, std::random_access_iterator2d_tag>
1674 template <
typename _II>
1678 Real top = it[slip::n_8c[5]];
1681 return (top - center);
1685 template<
typename Real>
1686 struct __dz_fwd<Real, std::random_access_iterator3d_tag>
1688 template <
typename _II>
1692 Real top = it[slip::n_6c[0]];
1695 return (top - center);
1706 template<
typename Real>
1707 struct __dz_fwd<Real, std::random_access_iterator4d_tag>
1709 template <
typename _II>
1713 Real top = it[slip::n_4d_8c[1]];
1716 return (top - center);
1724 template<
typename Iterator>
1727 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1728 return __dz_fwd<Real,_Category>::dz_fwd(it);
1740 template<
typename Real,
typename>
1743 template <
typename _II>
1748 Real next = *(it + 1);
1750 return (next - center);
1754 template<
typename Real>
1755 struct __dt_fwd<Real,std::random_access_iterator_tag>
1757 template <
typename _II>
1761 return __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
1765 template<
typename Real>
1766 struct __dt_fwd<Real, std::random_access_iterator2d_tag>
1768 template <
typename _II>
1773 Real next = it[slip::n_8c[0]];
1775 return Real (next - center);
1779 template<
typename Real>
1780 struct __dt_fwd<Real, std::random_access_iterator3d_tag>
1782 template <
typename _II>
1787 Real next = it[slip::n_26c[19]];
1789 return Real (next - center);
1793 template<
typename Real>
1794 struct __dt_fwd<Real, std::random_access_iterator4d_tag>
1796 template <
typename _II>
1800 Real next = it[slip::n_4d_8c[7]];
1803 return (next - center);
1811 template<
typename Iterator>
1814 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1815 return __dt_fwd<Real,_Category>::dt_fwd(it);
1822 template<
typename Real,
typename>
1825 template <
typename _II>
1829 Real left = *(it - 1);
1832 return (center - left);
1836 template<
typename Real>
1837 struct __dx_bck<Real,std::random_access_iterator_tag>
1839 template <
typename _II>
1843 Real left = *(it - 1);
1846 return (center - left);
1850 template<
typename Real>
1851 struct __dx_bck<Real, std::random_access_iterator2d_tag>
1853 template <
typename _II>
1857 Real left = it[slip::n_8c[4]];
1860 return (center - left);
1864 template<
typename Real>
1865 struct __dx_bck<Real, std::random_access_iterator3d_tag>
1867 template <
typename _II>
1871 Real left = it[slip::n_6c[3]];
1874 return (center - left);
1886 template<
typename Real>
1887 struct __dx_bck<Real, std::random_access_iterator4d_tag>
1889 template <
typename _II>
1893 Real left = it[slip::n_4d_8c[4]];
1896 return (center - left);
1905 template<
typename Iterator>
1908 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
1909 return __dx_bck<Real,_Category>::dx_bck(it);
1916 template<
typename Real,
typename>
1919 template <
typename _II>
1923 Real left = *(it - 1);
1926 return (center - left);
1930 template<
typename Real>
1931 struct __dy_bck<Real,std::random_access_iterator_tag>
1933 template <
typename _II>
1937 return __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
1941 template<
typename Real>
1942 struct __dy_bck<Real, std::random_access_iterator2d_tag>
1944 template <
typename _II>
1949 Real bottom = it[slip::n_8c[6]];
1951 return (center - bottom);
1955 template<
typename Real>
1956 struct __dy_bck<Real, std::random_access_iterator3d_tag>
1958 template <
typename _II>
1963 Real bottom = it[slip::n_6c[4]];
1965 return Real(0.5) * (center - bottom);
1977 template<
typename Real>
1978 struct __dy_bck<Real, std::random_access_iterator4d_tag>
1980 template <
typename _II>
1985 Real bottom = it[slip::n_4d_8c[5]];
1987 return (center - bottom);
1996 template<
typename Iterator>
1999 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2000 return __dy_bck<Real,_Category>::dy_bck(it);
2008 template<
typename Real,
typename>
2011 template <
typename _II>
2015 Real left = *(it - 1);
2018 return (left - center);
2022 template<
typename Real>
2023 struct __dz_bck<Real,std::random_access_iterator_tag>
2025 template <
typename _II>
2029 return __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
2033 template<
typename Real>
2034 struct __dz_bck<Real, std::random_access_iterator2d_tag>
2036 template <
typename _II>
2041 Real bottom = it[slip::n_8c[0]];
2043 return (center - bottom);
2047 template<
typename Real>
2048 struct __dz_bck<Real, std::random_access_iterator3d_tag>
2050 template <
typename _II>
2055 Real bottom = it[slip::n_6c[5]];
2057 return (center - bottom);
2070 template<
typename Real>
2071 struct __dz_bck<Real, std::random_access_iterator4d_tag>
2073 template <
typename _II>
2078 Real bottom = it[slip::n_4d_8c[6]];
2080 return (center - bottom);
2088 template<
typename Iterator>
2091 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2092 return __dz_bck<Real,_Category>::dz_bck(it);
2105 template<
typename Real,
typename>
2108 template <
typename _II>
2112 Real prev = *(it - 1);
2115 return (center - prev);
2119 template<
typename Real>
2120 struct __dt_bck<Real,std::random_access_iterator_tag>
2122 template <
typename _II>
2126 return __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
2130 template<
typename Real>
2131 struct __dt_bck<Real, std::random_access_iterator2d_tag>
2133 template <
typename _II>
2138 Real prev = it[slip::n_8c[5]];
2140 return (center - prev);
2144 template<
typename Real>
2145 struct __dt_bck<Real, std::random_access_iterator3d_tag>
2147 template <
typename _II>
2152 Real prev = it[slip::n_26c[5]];
2154 return (center - prev);
2158 template<
typename Real>
2159 struct __dt_bck<Real, std::random_access_iterator4d_tag>
2161 template <
typename _II>
2166 Real prev = it[slip::n_4d_8c[0]];
2168 return (center - prev);
2176 template<
typename Iterator>
2179 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2180 return __dt_bck<Real,_Category>::dt_bck(it);
2188 template<
typename Real,
typename>
2191 template <
typename _II>
2195 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2199 template<
typename Real>
2200 struct __prewittx<Real,std::random_access_iterator_tag>
2202 template <
typename _II>
2206 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2210 template<
typename Real>
2211 struct __prewittx<Real, std::random_access_iterator2d_tag>
2213 template <
typename _II>
2218 Real NE = it[slip::n_8c[1]];
2219 Real E = it[slip::n_8c[0]];
2220 Real NW = it[slip::n_8c[3]];
2221 Real W = it[slip::n_8c[4]];
2222 Real SE = it[slip::n_8c[7]];
2223 Real SW = it[slip::n_8c[5]];
2225 return Real(0.5) * (((NE - NW) + (E - W)) + (SE - SW));
2229 template<
typename Real>
2230 struct __prewittx<Real, std::random_access_iterator3d_tag>
2232 template <
typename _II>
2237 Real RE = it[slip::n_26c[1]];
2238 Real RNE = it[slip::n_26c[2]];
2239 Real RN = it[slip::n_26c[10]];
2240 Real RNW = it[slip::n_26c[19]];
2241 Real RW = it[slip::n_26c[18]];
2242 Real RSW = it[slip::n_26c[17]];
2243 Real RS = it[slip::n_26c[25]];
2244 Real RSE = it[slip::n_26c[8]];
2245 Real S_RC = it[slip::n_26c[9]];
2248 Real LE = it[slip::n_26c[5]];
2249 Real LNE = it[slip::n_26c[4]];
2250 Real LN = it[slip::n_26c[12]];
2251 Real LNW = it[slip::n_26c[21]];
2252 Real LW = it[slip::n_26c[14]];
2253 Real LSW = it[slip::n_26c[15]];
2254 Real LS = it[slip::n_26c[23]];
2255 Real LSE = it[slip::n_26c[6]];
2256 Real LC = it[slip::n_26c[22]];
2258 return Real(0.5) * ((RE - LE) + (RNE - LNE) + (RN - LN)
2259 + (RNW - LNW)+ (RW - LW) + (RSW - LSW)
2260 + (RS - LS) + (RSE - LSE) + (S_RC - LC));
2268 template<
typename Iterator>
2271 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2272 return __prewittx<Real,_Category>::prewittx(it);
2279 template<
typename Real,
typename>
2282 template <
typename _II>
2286 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2290 template<
typename Real>
2291 struct __prewitty<Real,std::random_access_iterator_tag>
2293 template <
typename _II>
2297 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2301 template<
typename Real>
2302 struct __prewitty<Real, std::random_access_iterator2d_tag>
2304 template <
typename _II>
2309 Real NE = it[slip::n_8c[1]];
2310 Real N = it[slip::n_8c[2]];
2311 Real NW = it[slip::n_8c[3]];
2312 Real S = it[slip::n_8c[6]];
2313 Real SE = it[slip::n_8c[7]];
2314 Real SW = it[slip::n_8c[5]];
2316 return Real(0.5) * (((NE - SE) + (N - S)) + (NW - SW));
2320 template<
typename Real>
2321 struct __prewitty<Real, std::random_access_iterator3d_tag>
2323 template <
typename _II>
2328 Real TE = it[slip::n_26c[10]];
2329 Real TNE = it[slip::n_26c[2]];
2330 Real TN = it[slip::n_26c[3]];
2331 Real TNW = it[slip::n_26c[4]];
2332 Real TW = it[slip::n_26c[12]];
2333 Real TSW = it[slip::n_26c[21]];
2334 Real TS = it[slip::n_26c[20]];
2335 Real TSE = it[slip::n_26c[19]];
2336 Real TC = it[slip::n_26c[11]];
2339 Real BE = it[slip::n_26c[25]];
2340 Real BNE = it[slip::n_26c[8]];
2341 Real BN = it[slip::n_26c[7]];
2342 Real BNW = it[slip::n_26c[6]];
2343 Real BW = it[slip::n_26c[23]];
2344 Real BSW = it[slip::n_26c[15]];
2345 Real BS = it[slip::n_26c[16]];
2346 Real BSE = it[slip::n_26c[17]];
2347 Real S_BC = it[slip::n_26c[24]];
2349 return Real(0.5) * ((TE - BE) + (TNE - BNE) + (TN - BN)
2350 + (TNW - BNW)+ (TW - BW) + (TSW - BSW)
2351 + (TS - BS) + (TSE - BSE) + (TC - S_BC));
2359 template<
typename Iterator>
2362 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2363 return __prewitty<Real,_Category>::prewitty(it);
2370 template<
typename Real,
typename>
2373 template <
typename _II>
2377 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2381 template<
typename Real>
2382 struct __prewittz<Real,std::random_access_iterator_tag>
2384 template <
typename _II>
2388 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2393 template<
typename Real>
2394 struct __prewittz<Real, std::random_access_iterator3d_tag>
2396 template <
typename _II>
2401 Real FE = it[slip::n_26c[5]];
2402 Real FNE = it[slip::n_26c[4]];
2403 Real FN = it[slip::n_26c[3]];
2404 Real FNW = it[slip::n_26c[2]];
2405 Real FW = it[slip::n_26c[1]];
2406 Real FSW = it[slip::n_26c[8]];
2407 Real FS = it[slip::n_26c[7]];
2408 Real FSE = it[slip::n_26c[6]];
2409 Real FC = it[slip::n_26c[0]];
2412 Real BE = it[slip::n_26c[14]];
2413 Real BNE = it[slip::n_26c[21]];
2414 Real BN = it[slip::n_26c[20]];
2415 Real BNW = it[slip::n_26c[19]];
2416 Real BW = it[slip::n_26c[18]];
2417 Real BSW = it[slip::n_26c[17]];
2418 Real BS = it[slip::n_26c[16]];
2419 Real BSE = it[slip::n_26c[15]];
2420 Real S_BC = it[slip::n_26c[13]];
2422 return Real(0.5) * ((FE - BE) + (FNE - BNE) + (FN - BN)
2423 + (FNW - BNW)+ (FW - BW) + (FSW - BSW)
2424 + (FS - BS) + (FSE - BSE) + (FC - S_BC));
2432 template<
typename Iterator>
2435 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2436 return __prewittz<Real,_Category>::prewittz(it);
2443 template<
typename Real,
typename>
2446 template <
typename _II>
2450 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2454 template<
typename Real>
2455 struct __sobelx<Real,std::random_access_iterator_tag>
2457 template <
typename _II>
2461 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2465 template<
typename Real>
2466 struct __sobelx<Real, std::random_access_iterator2d_tag>
2468 template <
typename _II>
2473 Real NE = it[slip::n_8c[1]];
2474 Real E = it[slip::n_8c[0]];
2475 Real NW = it[slip::n_8c[3]];
2476 Real W = it[slip::n_8c[4]];
2477 Real SE = it[slip::n_8c[7]];
2478 Real SW = it[slip::n_8c[5]];
2480 return Real(0.5) * (((NE - NW) + Real(2.0) * (E - W)) + (SE - SW));
2484 template<
typename Real>
2485 struct __sobelx<Real, std::random_access_iterator3d_tag>
2487 template <
typename _II>
2492 Real RE = it[slip::n_26c[1]];
2493 Real RNE = it[slip::n_26c[2]];
2494 Real RN = it[slip::n_26c[10]];
2495 Real RNW = it[slip::n_26c[19]];
2496 Real RW = it[slip::n_26c[18]];
2497 Real RSW = it[slip::n_26c[17]];
2498 Real RS = it[slip::n_26c[25]];
2499 Real RSE = it[slip::n_26c[8]];
2500 Real S_RC = it[slip::n_26c[9]];
2503 Real LE = it[slip::n_26c[5]];
2504 Real LNE = it[slip::n_26c[4]];
2505 Real LN = it[slip::n_26c[12]];
2506 Real LNW = it[slip::n_26c[21]];
2507 Real LW = it[slip::n_26c[14]];
2508 Real LSW = it[slip::n_26c[15]];
2509 Real LS = it[slip::n_26c[23]];
2510 Real LSE = it[slip::n_26c[6]];
2511 Real LC = it[slip::n_26c[22]];
2513 return (Real(2.0) * (RE - LE) + (RNE - LNE) + Real(2.0) * (RN - LN)
2514 + (RNW - LNW) + Real(2.0) * (RW - LW) + (RSW - LSW) + Real(2.0) * (RS - LS) + (RSE - LSE)+ Real(4.0) * (S_RC - LC));
2522 template<
typename Iterator>
2525 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2526 return __sobelx<Real,_Category>::sobelx(it);
2534 template<
typename Real,
typename>
2537 template <
typename _II>
2541 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2545 template<
typename Real>
2546 struct __sobely<Real,std::random_access_iterator_tag>
2548 template <
typename _II>
2552 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2556 template<
typename Real>
2557 struct __sobely<Real, std::random_access_iterator2d_tag>
2559 template <
typename _II>
2564 Real NE = it[slip::n_8c[1]];
2565 Real N = it[slip::n_8c[2]];
2566 Real NW = it[slip::n_8c[3]];
2567 Real S = it[slip::n_8c[6]];
2568 Real SE = it[slip::n_8c[7]];
2569 Real SW = it[slip::n_8c[5]];
2571 return Real(0.5) * (((NE - SE) + Real(2.0) * (N - S)) + (NW - SW));
2575 template<
typename Real>
2576 struct __sobely<Real, std::random_access_iterator3d_tag>
2578 template <
typename _II>
2583 Real TE = it[slip::n_26c[10]];
2584 Real TNE = it[slip::n_26c[2]];
2585 Real TN = it[slip::n_26c[3]];
2586 Real TNW = it[slip::n_26c[4]];
2587 Real TW = it[slip::n_26c[12]];
2588 Real TSW = it[slip::n_26c[21]];
2589 Real TS = it[slip::n_26c[20]];
2590 Real TSE = it[slip::n_26c[19]];
2591 Real TC = it[slip::n_26c[11]];
2594 Real BE = it[slip::n_26c[25]];
2595 Real BNE = it[slip::n_26c[8]];
2596 Real BN = it[slip::n_26c[7]];
2597 Real BNW = it[slip::n_26c[6]];
2598 Real BW = it[slip::n_26c[23]];
2599 Real BSW = it[slip::n_26c[15]];
2600 Real BS = it[slip::n_26c[16]];
2601 Real BSE = it[slip::n_26c[17]];
2602 Real S_BC = it[slip::n_26c[24]];
2604 return (Real(2.0) * (TE - BE) + (TNE - BNE) + Real(2.0) * (TN - BN)
2605 + (TNW - BNW) + Real(2.0) * (TW - BW) + (TSW - BSW) + Real(2.0) * (TS - BS) + (TSE - BSE)+ Real(4.0) * (TC - S_BC));
2613 template<
typename Iterator>
2616 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2617 return __sobely<Real,_Category>::sobely(it);
2624 template<
typename Real,
typename>
2627 template <
typename _II>
2631 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2635 template<
typename Real>
2636 struct __sobelz<Real,std::random_access_iterator_tag>
2638 template <
typename _II>
2642 return __dx<Real,std::random_access_iterator_tag>::dx(it);
2648 template<
typename Real>
2649 struct __sobelz<Real, std::random_access_iterator3d_tag>
2651 template <
typename _II>
2657 Real FE = it[slip::n_26c[5]];
2658 Real FNE = it[slip::n_26c[4]];
2659 Real FN = it[slip::n_26c[3]];
2660 Real FNW = it[slip::n_26c[2]];
2661 Real FW = it[slip::n_26c[1]];
2662 Real FSW = it[slip::n_26c[8]];
2663 Real FS = it[slip::n_26c[7]];
2664 Real FSE = it[slip::n_26c[6]];
2665 Real FC = it[slip::n_26c[0]];
2668 Real BE = it[slip::n_26c[14]];
2669 Real BNE = it[slip::n_26c[21]];
2670 Real BN = it[slip::n_26c[20]];
2671 Real BNW = it[slip::n_26c[19]];
2672 Real BW = it[slip::n_26c[18]];
2673 Real BSW = it[slip::n_26c[17]];
2674 Real BS = it[slip::n_26c[16]];
2675 Real BSE = it[slip::n_26c[15]];
2676 Real S_BC = it[slip::n_26c[13]];
2678 return (Real(2.0) * (FE - BE) + (FNE - BNE) + Real(2.0) * (FN - BN)
2679 + (FNW - BNW) + Real(2.0) * (FW - BW) + (FSW - BSW) + Real(2.0) * (FS - BS) + (FSE - BSE)+ Real(4.0) * (FC - S_BC));
2687 template<
typename Iterator>
2690 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2691 return __sobelz<Real,_Category>::sobelz(it);
2698 template<
typename Real,
typename>
2701 template <
typename _II,
typename Block>
2705 assert(Block::SIZE == 1);
2706 Real dx = __dx<Real,std::random_access_iterator_tag>::dx(it);
2715 template<
typename Real>
2716 struct __dv<Real,std::random_access_iterator_tag>
2718 template <
typename _II,
typename Block>
2722 assert(Block::SIZE == 1);
2723 return __dv<Real,std::random_access_iterator_tag>::dv(it,v);
2727 template<
typename Real>
2728 struct __dv<Real, std::random_access_iterator2d_tag>
2730 template <
typename _II,
typename Block>
2734 assert(Block::SIZE == 2);
2735 Real result = Real(0);
2736 Real norm = slip::Euclidean_norm<Real>(v.begin(),v.end());
2741 grad[0] = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
2742 grad[1] = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
2749 template<
typename Real>
2750 struct __dv<Real, std::random_access_iterator3d_tag>
2752 template <
typename _II,
typename Block>
2756 assert(Block::SIZE == 3);
2757 Real result = Real(0);
2758 Real norm = slip::Euclidean_norm<Real>(v.begin(),v.end());
2762 grad[0] = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
2763 grad[1] = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
2764 grad[2] = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
2779 template<
typename Real>
2780 struct __dv<Real, std::random_access_iterator4d_tag>
2782 template <
typename _II,
typename Block>
2786 assert(Block::SIZE == 4);
2787 Real result = Real(0);
2788 Real norm = slip::Euclidean_norm<Real>(v.begin(),v.end());
2792 grad[0] = __dt<Real,std::random_access_iterator4d_tag>::dt(it);
2793 grad[1] = __dx<Real,std::random_access_iterator4d_tag>::dx(it);
2794 grad[2] = __dy<Real,std::random_access_iterator4d_tag>::dy(it);
2795 grad[3] = __dz<Real,std::random_access_iterator4d_tag>::dz(it);
2803 template<
typename Real,
typename Block>
struct Dv
2808 template<
typename Iterator>
2811 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2812 return __dv<Real,_Category>::dv(it,
v_);
2821 template<
typename Real,
typename>
2824 template <
typename _II>
2828 Real dx = __dx<Real,std::random_access_iterator_tag>::dx(it);
2834 template<
typename Real>
2835 struct __grad<Real, std::random_access_iterator2d_tag>
2837 template <
typename _II>
2841 Real dx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
2842 Real dy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
2844 return std::sqrt((dx * dx) + (dy * dy));
2849 template<
typename Real>
2850 struct __grad<Real, std::random_access_iterator3d_tag>
2852 template <
typename _II>
2856 Real dx = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
2857 Real dy = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
2858 Real dz = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
2860 return std::sqrt((dx * dx) + (dy * dy) + (dz * dz));
2875 template<
typename Real>
2876 struct __grad<Real, std::random_access_iterator4d_tag>
2878 template <
typename _II>
2882 Real dt = __dt<Real,std::random_access_iterator4d_tag>::dt(it);
2883 Real dx = __dx<Real,std::random_access_iterator4d_tag>::dx(it);
2884 Real dy = __dy<Real,std::random_access_iterator4d_tag>::dy(it);
2885 Real dz = __dz<Real,std::random_access_iterator4d_tag>::dz(it);
2887 return std::sqrt((dt * dt) + (dx * dx) + (dy * dy) + (dz * dz));
2893 template<
typename Real>
struct Grad
2896 template<
typename Iterator>
2899 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
2900 return __grad<Real,_Category>::grad(it);
2911 template<
typename Real,
typename>
2914 template <
typename _II>
2918 Real left = *(it - 1);
2920 Real right = *(it + 1);
2922 return ((right + left) - Real(2) *
center);
2926 template<
typename Real>
2927 struct __dxx<Real,std::random_access_iterator_tag>
2929 template <
typename _II>
2933 Real left = *(it - 1);
2935 Real right = *(it + 1);
2937 return ((right + left) - Real(2) *
center);
2941 template<
typename Real>
2942 struct __dxx<Real, std::random_access_iterator2d_tag>
2944 template <
typename _II>
2948 Real left = it[slip::n_8c[4]];
2950 Real right = it[slip::n_8c[0]];
2952 return ((right + left) - Real(2) * center);
2956 template<
typename Real>
2957 struct __dxx<Real, std::random_access_iterator3d_tag>
2959 template <
typename _II>
2963 Real left = it[slip::n_6c[3]];
2965 Real right = it[slip::n_6c[1]];
2967 return ((right + left) - Real(2) * center);
2979 template<
typename Real>
2980 struct __dxx<Real, std::random_access_iterator4d_tag>
2982 template <
typename _II>
2986 Real left = it[slip::n_4d_8c[4]];
2988 Real right = it[slip::n_4d_8c[2]];
2990 return ((right + left) - Real(2) * center);
2995 template<
typename Real>
struct Dxx
2999 template<
typename Iterator>
3002 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3003 return __dxx<Real,_Category>::dxx(it);
3011 template<
typename Real,
typename>
3014 template <
typename _II>
3018 Real left = *(it - 1);
3020 Real right = *(it + 1);
3022 return ((right + left) - Real(2) *
center);
3026 template<
typename Real>
3027 struct __dyy<Real,std::random_access_iterator_tag>
3029 template <
typename _II>
3033 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3037 template<
typename Real>
3038 struct __dyy<Real, std::random_access_iterator2d_tag>
3040 template <
typename _II>
3044 Real top = it[slip::n_8c[2]];
3046 Real bottom = it[slip::n_8c[6]];
3048 return ((top + bottom) - Real(2) * center);
3052 template<
typename Real>
3053 struct __dyy<Real, std::random_access_iterator3d_tag>
3055 template <
typename _II>
3059 Real top = it[slip::n_6c[2]];
3061 Real bottom = it[slip::n_6c[4]];
3063 return ((top + bottom) - Real(2) * center);
3074 template<
typename Real>
3075 struct __dyy<Real, std::random_access_iterator4d_tag>
3077 template <
typename _II>
3081 Real top = it[slip::n_4d_8c[3]];
3083 Real bottom = it[slip::n_4d_8c[5]];
3085 return ((top + bottom) - Real(2) * center);
3089 template<
typename Real>
struct Dyy
3093 template<
typename Iterator>
3096 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3097 return __dyy<Real,_Category>::dyy(it);
3104 template<
typename Real,
typename>
3107 template <
typename _II>
3111 Real left = *(it - 1);
3113 Real right = *(it + 1);
3115 return ((right + left) - Real(2) *
center);
3119 template<
typename Real>
3120 struct __dzz<Real,std::random_access_iterator_tag>
3122 template <
typename _II>
3126 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3130 template<
typename Real>
3131 struct __dzz<Real, std::random_access_iterator2d_tag>
3133 template <
typename _II>
3137 Real top = it[slip::n_8c[5]];
3139 Real bottom = it[slip::n_8c[0]];
3141 return ((top + bottom) - Real(2) * center);
3145 template<
typename Real>
3146 struct __dzz<Real, std::random_access_iterator3d_tag>
3148 template <
typename _II>
3152 Real top = it[slip::n_6c[5]];
3154 Real bottom = it[slip::n_6c[0]];
3156 return ((top + bottom) - Real(2) * center);
3168 template<
typename Real>
3169 struct __dzz<Real, std::random_access_iterator4d_tag>
3171 template <
typename _II>
3175 Real top = it[slip::n_4d_8c[6]];
3177 Real bottom = it[slip::n_4d_8c[1]];
3179 return ((top + bottom) - Real(2) * center);
3183 template<
typename Real>
struct Dzz
3187 template<
typename Iterator>
3190 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3191 return __dzz<Real,_Category>::dzz(it);
3202 template<
typename Real,
typename>
3205 template <
typename _II>
3209 Real prev = *(it - 1);
3211 Real next = *(it + 1);
3213 return ((next + prev) - Real(2) *
center);
3217 template<
typename Real>
3218 struct __dtt<Real,std::random_access_iterator_tag>
3220 template <
typename _II>
3224 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3228 template<
typename Real>
3229 struct __dtt<Real, std::random_access_iterator2d_tag>
3231 template <
typename _II>
3235 Real prev = it[slip::n_8c[5]];
3237 Real next = it[slip::n_8c[0]];
3239 return ((next + prev) - Real(2) * center);
3243 template<
typename Real>
3244 struct __dtt<Real, std::random_access_iterator3d_tag>
3246 template <
typename _II>
3250 Real prev = it[slip::n_26c[5]];
3252 Real next = it[slip::n_26c[19]];
3254 return ((next + prev) - Real(2) * center);
3258 template<
typename Real>
3259 struct __dtt<Real, std::random_access_iterator4d_tag>
3261 template <
typename _II>
3265 Real prev = it[slip::n_4d_8c[0]];
3267 Real next = it[slip::n_4d_8c[7]];
3269 return ((next + prev) - Real(2) * center);
3273 template<
typename Real>
struct Dtt
3277 template<
typename Iterator>
3280 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3281 return __dtt<Real,_Category>::dtt(it);
3285 template<
typename Real,
typename>
3288 template <
typename _II>
3292 Real left = *(it - 1);
3294 Real right = *(it + 1);
3296 return ((right + left) - Real(2) *
center);
3300 template<
typename Real>
3301 struct __dxy<Real,std::random_access_iterator_tag>
3303 template <
typename _II>
3307 Real left = *(it - 1);
3309 Real right = *(it + 1);
3311 return ((right + left) - Real(2) *
center);
3315 template<
typename Real>
3316 struct __dxy<Real, std::random_access_iterator2d_tag>
3318 template <
typename _II>
3323 Real NE = it[slip::n_8c[1]];
3324 Real NW = it[slip::n_8c[3]];
3325 Real SE = it[slip::n_8c[7]];
3326 Real SW = it[slip::n_8c[5]];
3328 return ((SW + NE) - (SE + NW)) * Real(0.25);
3332 template<
typename Real>
3333 struct __dxy<Real, std::random_access_iterator3d_tag>
3335 template <
typename _II>
3339 Real NE = it[slip::n_26c[10]];
3340 Real NW = it[slip::n_26c[12]];
3341 Real SE = it[slip::n_26c[25]];
3342 Real SW = it[slip::n_26c[23]];
3344 return ((SW + NE) - (SE + NW)) * Real(0.25);
3348 template<
typename Real>
struct Dxy
3352 template<
typename Iterator>
3355 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3356 return __dxy<Real,_Category>::dxy(it);
3362 template<
typename Real,
typename>
3365 template <
typename _II>
3369 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3373 template<
typename Real>
3374 struct __dxz<Real,std::random_access_iterator_tag>
3376 template <
typename _II>
3380 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3385 template<
typename Real>
3386 struct __dxz<Real, std::random_access_iterator3d_tag>
3388 template <
typename _II>
3392 Real NE = it[slip::n_26c[1]];
3393 Real NW = it[slip::n_26c[5]];
3394 Real SE = it[slip::n_26c[18]];
3395 Real SW = it[slip::n_26c[14]];
3397 return ((SW + NE) - (SE + NW)) * Real(0.25);
3401 template<
typename Real>
struct Dxz
3405 template<
typename Iterator>
3408 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3409 return __dxz<Real,_Category>::dxz(it);
3415 template<
typename Real,
typename>
3418 template <
typename _II>
3422 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3426 template<
typename Real>
3427 struct __dyz<Real,std::random_access_iterator_tag>
3429 template <
typename _II>
3433 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3439 template<
typename Real>
3440 struct __dyz<Real, std::random_access_iterator3d_tag>
3442 template <
typename _II>
3446 Real NE = it[slip::n_26c[3]];
3447 Real NW = it[slip::n_26c[20]];
3448 Real SE = it[slip::n_26c[18]];
3449 Real SW = it[slip::n_26c[7]];
3451 return ((SW + NE) - (SE + NW)) * Real(0.25);
3455 template<
typename Real>
struct Dyz
3459 template<
typename Iterator>
3462 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3463 return __dyz<Real,_Category>::dyz(it);
3473 template<
typename Real,
typename>
3476 template <
typename _II>
3480 Real left = *(it - 1);
3482 Real right = *(it + 1);
3484 return ((right + left) - Real(2) *
center);
3488 template<
typename Real>
3489 struct __dxy_w<Real,std::random_access_iterator_tag>
3491 template <
typename _II>
3495 Real left = *(it - 1);
3497 Real right = *(it + 1);
3499 return ((right + left) - Real(2) *
center);
3503 template<
typename Real>
3504 struct __dxy_w<Real, std::random_access_iterator2d_tag>
3506 template <
typename _II>
3510 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
3511 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
3512 Real gxgy = gx * gy;
3517 Real E = it[slip::n_8c[0]];
3518 Real NE = it[slip::n_8c[1]];
3519 Real N = it[slip::n_8c[2]];
3520 Real NW = it[slip::n_8c[3]];
3521 Real W = it[slip::n_8c[4]];
3522 Real SW = it[slip::n_8c[5]];
3523 Real S = it[slip::n_8c[6]];
3524 Real SE = it[slip::n_8c[7]];
3527 dxy = (SW + NE + Real(2) * center - E - S - N - W) * Real(0.5);
3531 dxy = (E + S + N + W - NW - SE - Real(2) *
center) * Real(0.5);
3538 template<
typename Real>
3539 struct __dxy_w<Real, std::random_access_iterator3d_tag>
3541 template <
typename _II>
3545 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
3546 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
3547 Real gxgy = gx * gy;
3552 Real E = it[slip::n_26c[9]];
3553 Real NE = it[slip::n_26c[10]];
3554 Real N = it[slip::n_26c[11]];
3555 Real NW = it[slip::n_26c[12]];
3556 Real W = it[slip::n_26c[22]];
3557 Real SW = it[slip::n_26c[23]];
3558 Real S = it[slip::n_26c[24]];
3559 Real SE = it[slip::n_26c[25]];
3563 dxy = (SW + NE + Real(2) * center - E - S - N - W) * Real(0.5);
3567 dxy = (E + S + N + W - NW - SE - Real(2) *
center) * Real(0.5);
3579 template<
typename Iterator>
3582 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3583 return __dxy_w<Real,_Category>::dxy_w(it);
3590 template<
typename Real,
typename>
3593 template <
typename _II>
3597 return __dx<Real,std::random_access_iterator_tag>::dx(it);
3601 template<
typename Real>
3602 struct __div<Real,std::random_access_iterator_tag>
3604 template <
typename _II>
3608 return __dx<Real,std::random_access_iterator_tag>::dx(it);
3612 template<
typename Real>
3613 struct __div<Real,std::random_access_iterator2d_tag>
3615 template <
typename _II>
3619 return __dx<Real,std::random_access_iterator2d_tag>::dx(it)
3620 +__dy<Real,std::random_access_iterator2d_tag>::dy(it);
3624 template<
typename Real>
3625 struct __div<Real,std::random_access_iterator3d_tag>
3627 template <
typename _II>
3631 return __dx<Real,std::random_access_iterator3d_tag>::dx(it)
3632 +__dy<Real,std::random_access_iterator3d_tag>::dy(it)
3633 +__dz<Real,std::random_access_iterator3d_tag>::dz(it);
3644 template<
typename Real>
3645 struct __div<Real,std::random_access_iterator4d_tag>
3647 template <
typename _II>
3651 return __dt<Real,std::random_access_iterator4d_tag>::dt(it)
3652 +__dx<Real,std::random_access_iterator4d_tag>::dx(it)
3653 +__dy<Real,std::random_access_iterator4d_tag>::dy(it)
3654 +__dz<Real,std::random_access_iterator4d_tag>::dz(it);
3659 template<
typename Real>
struct Div
3663 template<
typename Iterator>
3666 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3667 return __div<Real,_Category>::div(it);
3677 template<
typename Real,
typename>
3680 template <
typename _II>
3684 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3688 template<
typename Real>
3689 struct __lap<Real,std::random_access_iterator_tag>
3691 template <
typename _II>
3695 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3699 template<
typename Real>
3700 struct __lap<Real,std::random_access_iterator2d_tag>
3702 template <
typename _II>
3706 return __dxx<Real,std::random_access_iterator2d_tag>::dxx(it)
3707 +__dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
3711 template<
typename Real>
3712 struct __lap<Real,std::random_access_iterator3d_tag>
3714 template <
typename _II>
3718 return __dxx<Real,std::random_access_iterator3d_tag>::dxx(it)
3719 +__dyy<Real,std::random_access_iterator3d_tag>::dyy(it)
3720 +__dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
3731 template<
typename Real>
3732 struct __lap<Real,std::random_access_iterator4d_tag>
3734 template <
typename _II>
3738 return __dtt<Real,std::random_access_iterator4d_tag>::dtt(it)
3739 +__dxx<Real,std::random_access_iterator4d_tag>::dxx(it)
3740 +__dyy<Real,std::random_access_iterator4d_tag>::dyy(it)
3741 +__dzz<Real,std::random_access_iterator4d_tag>::dzz(it);
3746 template<
typename Real>
struct Lap
3750 template<
typename Iterator>
3753 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3754 return __lap<Real,_Category>::lap(it);
3758 template<
typename Real,
typename>
3761 template <
typename _II>
3765 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3768 template<
typename Real>
3769 struct __lap_8c<Real, std::random_access_iterator2d_tag>
3771 template <
typename _II>
3776 const Real gamma = Real(2) / Real(3);
3777 Real gamma2 = Real(1) - gamma;
3778 Real inv_2h2 = Real(0.5);
3780 Real Ixx = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
3781 Real Iyy = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
3782 Real NE = it[slip::n_8c[1]];
3783 Real NW = it[slip::n_8c[3]];
3784 Real SE = it[slip::n_8c[7]];
3785 Real SW = it[slip::n_8c[5]];
3786 Real diag = (((SE + NW) + (SW + NE)) - ((Real(4) * *it))) * inv_2h2;
3788 return ((gamma2 * Ixx) + (gamma2 * Iyy)) + (gamma * diag);
3791 template<
typename Real>
struct Lap8
3795 template<
typename Iterator>
3798 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3799 return __lap_8c<Real,_Category>::lap(it);
3808 template<
typename Iterator>
3811 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3818 template<
typename Real,
typename>
3821 template <
typename _II>
3825 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3829 template<
typename Real>
3830 struct __iee_sapiro<Real, std::random_access_iterator2d_tag>
3832 template <
typename _II>
3837 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
3838 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
3841 Real g2 = gx2 + gy2;
3849 Real lambda3 = Real(0.5) * (gx * gy);
3850 Real lambda4 = - lambda3;
3851 Real lambda0 = Real(-2.0) * (lambda1 + lambda2);
3853 Real E = it[slip::n_8c[0]];
3854 Real NE = it[slip::n_8c[1]];
3855 Real N = it[slip::n_8c[2]];
3856 Real NW = it[slip::n_8c[3]];
3857 Real W = it[slip::n_8c[4]];
3858 Real SW = it[slip::n_8c[5]];
3859 Real S = it[slip::n_8c[6]];
3860 Real SE = it[slip::n_8c[7]];
3863 iee = ( lambda4 * (NW + SE)
3864 + lambda3 * (NE + SW)
3867 + lambda0 *
center) / g2 ;
3876 template<
typename Real>
3877 struct __iee_sapiro<Real, std::random_access_iterator3d_tag>
3879 template <
typename _II>
3884 Real dx = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
3885 Real dy = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
3886 Real dz = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
3892 Real g2 = (dx2 + dy2) + dz2;
3899 Real dxx = __dxx<Real,std::random_access_iterator3d_tag>::dxx(it);
3900 Real dyy = __dyy<Real,std::random_access_iterator3d_tag>::dyy(it);
3901 Real dzz = __dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
3903 Real dxy = __dxy<Real,std::random_access_iterator3d_tag>::dxy(it);
3904 Real dxz = __dxz<Real,std::random_access_iterator3d_tag>::dxz(it);
3905 Real dyz = __dyz<Real,std::random_access_iterator3d_tag>::dyz(it);
3907 Real dxdy = dx * dy;
3908 Real dxdz = dx * dz;
3909 Real dydz = dy * dz;
3911 Real a = (dy2 + dz2) * dxx;
3912 Real b = (dx2 + dz2) * dyy;
3913 Real c = (dx2 + dy2) * dzz;
3914 Real d = Real(2.0) * (dxdy * dxy);
3915 Real e = Real(2.0) * (dxdz * dxz);
3916 Real f = Real(2.0) * (dydz * dyz);
3918 iee = ((a + b) + (c + d) + (e + f)) / g2;
3930 template<
typename Iterator>
3933 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
3934 return __iee_sapiro<Real,_Category>::iee_sapiro(it);
3938 template<
typename Real,
typename>
3941 template <
typename _II>
3945 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
3949 template<
typename Real>
3950 struct __iee_lucido<Real, std::random_access_iterator2d_tag>
3952 template <
typename _II>
3957 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
3958 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
3961 Real g2 = gx2 + gy2;
3962 Real gxgy = gx * gy;
3971 Real lambda1 = gx2 - gxgy;
3972 Real lambda2 = gy2 - gxgy;
3973 Real lambda3 = gxgy;
3975 Real lambda0 = Real(-2.0) * ((lambda1 + lambda2) + lambda3);
3977 Real E = it[slip::n_8c[0]];
3978 Real NE = it[slip::n_8c[1]];
3979 Real N = it[slip::n_8c[2]];
3980 Real W = it[slip::n_8c[4]];
3981 Real SW = it[slip::n_8c[5]];
3982 Real S = it[slip::n_8c[6]];
3984 iee = ( lambda3 * (NE + SW)
3987 + lambda0 * center)/ g2;
3991 Real lambda1 = gx2 + gxgy;
3992 Real lambda2 = gy2 + gxgy;
3993 Real lambda4 = - gxgy;
3994 Real lambda0 = Real(-2.0) * ((lambda1 + lambda2) + lambda4);
3996 Real E = it[slip::n_8c[0]];
3997 Real N = it[slip::n_8c[2]];
3998 Real NW = it[slip::n_8c[3]];
3999 Real W = it[slip::n_8c[4]];
4000 Real S = it[slip::n_8c[6]];
4001 Real SE = it[slip::n_8c[7]];
4002 iee = ( lambda4 * (NW + SE)
4005 + lambda0 * center)/ g2;
4019 template<
typename Iterator>
4022 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4023 return __iee_lucido<Real,_Category>::iee_lucido(it);
4026 template<
typename Real,
typename>
4027 struct __iee_augereau
4029 template <
typename _II>
4031 iee_augereau(_II it)
4033 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4037 template<
typename Real>
4038 struct __iee_augereau<Real, std::random_access_iterator2d_tag>
4040 template <
typename _II>
4042 iee_augereau(_II it)
4045 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4046 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4049 Real g2 = gx2 + gy2;
4050 Real gxgy = gx * gy;
4059 Real lambda0 = Real(-2.0) * gx2;
4060 Real lambda1 = gx2 - gy2;
4061 Real lambda3 = Real(0.5) * (gy2 + gxgy);
4062 Real lambda4 = Real(0.5) * (gy2 - gxgy);
4065 Real E = it[slip::n_8c[0]];
4066 Real NE = it[slip::n_8c[1]];
4067 Real NW = it[slip::n_8c[3]];
4068 Real W = it[slip::n_8c[4]];
4069 Real SW = it[slip::n_8c[5]];
4070 Real SE = it[slip::n_8c[7]];
4072 iee = ( lambda4 * (NW + SE)
4073 + lambda3 * (NE + SW)
4075 + lambda0 * center)/ g2;
4079 Real lambda0 = Real(-2.0) * gy2;
4080 Real lambda2 = gy2 - gx2;
4081 Real lambda3 = Real(0.5) * (gx2 + gxgy);
4082 Real lambda4 = Real(0.5) * (gx2 - gxgy);
4085 Real NE = it[slip::n_8c[1]];
4086 Real N = it[slip::n_8c[2]];
4087 Real NW = it[slip::n_8c[3]];
4088 Real SW = it[slip::n_8c[5]];
4089 Real S = it[slip::n_8c[6]];
4090 Real SE = it[slip::n_8c[7]];
4091 iee = ( lambda4 * (NW + SE)
4092 + lambda3 * (NE + SW)
4094 + lambda0 * center)/ g2;
4108 template<
typename Iterator>
4111 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4112 return __iee_augereau<Real,_Category>::iee_augereau(it);
4120 template<
typename Real,
typename>
4121 struct __iee_alvarez
4123 template <
typename _II>
4127 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4131 template<
typename Real>
4132 struct __iee_alvarez<Real, std::random_access_iterator2d_tag>
4134 template <
typename _II>
4139 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4140 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4143 Real g2 = gx2 + gy2;
4144 Real gxgy = gx * gy;
4151 Real lambda0 = Real(0.25);
4152 Real lambda1 = Real(2.0) * lambda0 - gy2 / g2;
4153 Real lambda2 = Real(2.0) * lambda0 - gx2 / g2;
4154 Real lambda3 = -lambda0 + Real(0.5) * ( Real(1) + gxgy / g2);
4155 Real lambda4 = -lambda0 + Real(0.5) * ( Real(1) - gxgy / g2);
4156 lambda0 = Real(-1.0);
4158 Real E = it[slip::n_8c[0]];
4159 Real NE = it[slip::n_8c[1]];
4160 Real N = it[slip::n_8c[2]];
4161 Real NW = it[slip::n_8c[3]];
4162 Real W = it[slip::n_8c[4]];
4163 Real SW = it[slip::n_8c[5]];
4164 Real S = it[slip::n_8c[6]];
4165 Real SE = it[slip::n_8c[7]];
4167 iee = ( lambda4 * (NW + SE)
4168 + lambda3 * (NE + SW)
4182 template<
typename Iterator>
4185 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4186 return __iee_alvarez<Real,_Category>::iee_alvarez(it);
4191 template<
typename Real,
typename>
4192 struct __iee_alvarez2
4194 template <
typename _II>
4196 iee_alvarez2(_II it)
4198 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4202 template<
typename Real>
4203 struct __iee_alvarez2<Real, std::random_access_iterator2d_tag>
4205 template <
typename _II>
4207 iee_alvarez2(_II it)
4210 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4211 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4214 Real g2 = gx2 + gy2;
4215 Real gxgy = gx * gy;
4223 Real lambda0 = Real(0);
4224 if ( (absgx > absgy) && (gxgy>=0) )
4226 lambda0 = ( Real(2.0) * gx2 + gy2 - gxgy ) / Real(4.0);
4229 else if ( (absgx <= absgy) && (gxgy >= 0) )
4231 lambda0 = ( Real(2.0) * gy2 + gx2 - gxgy ) / Real(4.0);
4234 else if ( (absgx > absgy) && (gxgy <= 0) )
4237 lambda0 = ( Real(2.0) * gx2 + gy2 + gxgy ) / Real(4.0);
4242 lambda0 = ( gy2 + Real(2.0) * gx2 - gxgy ) / Real(4.0);
4246 Real lambda1 = Real(2.0) * lambda0 - gy2;
4247 Real lambda2 = Real(2.0) *lambda0 - gx2;
4248 Real lambda3 = -lambda0 + Real(0.5) * ( gx2 + gxgy + gy2 );
4249 Real lambda4 = -lambda0 + Real(0.5) * ( gx2 - gxgy + gy2 );
4250 lambda0 = -4.0*lambda0;
4253 Real E = it[slip::n_8c[0]];
4254 Real NE = it[slip::n_8c[1]];
4255 Real N = it[slip::n_8c[2]];
4256 Real NW = it[slip::n_8c[3]];
4257 Real W = it[slip::n_8c[4]];
4258 Real SW = it[slip::n_8c[5]];
4259 Real S = it[slip::n_8c[6]];
4260 Real SE = it[slip::n_8c[7]];
4262 iee = ( lambda4 * (NW + SE)
4263 + lambda3 * (NE + SW)
4276 template<
typename Iterator>
4279 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4280 return __iee_alvarez2<Real,_Category>::iee_alvarez2(it);
4284 template<
typename Real,
typename>
4285 struct __iee_cohignac
4287 template <
typename _II>
4289 iee_cohignac(_II it)
4291 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4295 template<
typename Real>
4296 struct __iee_cohignac<Real, std::random_access_iterator2d_tag>
4298 template <
typename _II>
4300 iee_cohignac(_II it)
4303 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4304 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4307 Real g2 = gx2 + gy2;
4308 Real gxgy = gx * gy;
4314 Real lambda0 = Real(0.5) - gx2/g2 + (gx2 / g2) * (gy2 / g2);
4315 Real lambda1 = Real(2.0) * lambda0 - gy2 /g2;
4316 Real lambda2 = Real(2.0) * lambda0 - gx2 / g2;
4317 Real lambda3 = -lambda0 + Real(0.5) * (Real(1.0) + gxgy / g2);
4318 Real lambda4 = -lambda0 + Real(0.5) * (Real(1.0) - gxgy / g2);
4319 lambda0 = Real(-4.0) * lambda0;
4321 Real E = it[slip::n_8c[0]];
4322 Real NE = it[slip::n_8c[1]];
4323 Real N = it[slip::n_8c[2]];
4324 Real NW = it[slip::n_8c[3]];
4325 Real W = it[slip::n_8c[4]];
4326 Real SW = it[slip::n_8c[5]];
4327 Real S = it[slip::n_8c[6]];
4328 Real SE = it[slip::n_8c[7]];
4330 iee = ( lambda4 * (NW + SE)
4331 + lambda3 * (NE + SW)
4344 template<
typename Iterator>
4347 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4348 return __iee_cohignac<Real,_Category>::iee_cohignac(it);
4357 template<
typename Real,
typename>
4360 template <
typename _II>
4364 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4368 template<
typename Real>
4369 struct __inn_sapiro<Real, std::random_access_iterator2d_tag>
4371 template <
typename _II>
4376 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4377 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4380 Real g2 = gx2 + gy2;
4381 Real gxgy = gx * gy;
4388 Real lambda4 = Real(0.5) * gxgy;
4389 Real lambda3 = - lambda4;
4390 Real lambda0 = Real(-2.0) * (lambda1 + lambda2);
4392 Real E = it[slip::n_8c[0]];
4393 Real NE = it[slip::n_8c[1]];
4394 Real N = it[slip::n_8c[2]];
4395 Real NW = it[slip::n_8c[3]];
4396 Real W = it[slip::n_8c[4]];
4397 Real SW = it[slip::n_8c[5]];
4398 Real S = it[slip::n_8c[6]];
4399 Real SE = it[slip::n_8c[7]];
4402 inn = ( lambda4 * (NW + SE)
4403 + lambda3 * (NE + SW)
4406 + lambda0 *
center) / g2 ;
4415 template<
typename Real>
4416 struct __inn_sapiro<Real, std::random_access_iterator3d_tag>
4418 template <
typename _II>
4423 Real dx = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
4424 Real dy = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
4425 Real dz = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
4431 Real g2 = (dx2 + dy2) + dz2;
4438 Real dxx = __dxx<Real,std::random_access_iterator3d_tag>::dxx(it);
4439 Real dyy = __dyy<Real,std::random_access_iterator3d_tag>::dyy(it);
4440 Real dzz = __dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
4442 Real dxy = __dxy<Real,std::random_access_iterator3d_tag>::dxy(it);
4443 Real dxz = __dxz<Real,std::random_access_iterator3d_tag>::dxz(it);
4444 Real dyz = __dyz<Real,std::random_access_iterator3d_tag>::dyz(it);
4446 Real dxdy = dx * dy;
4447 Real dxdz = dx * dz;
4448 Real dydz = dy * dz;
4450 Real a = (dy2 + dz2) * dxx;
4451 Real b = (dx2 + dz2) * dyy;
4452 Real c = (dx2 + dy2) * dzz;
4453 Real d = - Real(2.0) * (dxdy * dxy);
4454 Real e = - Real(2.0) * (dxdz * dxz);
4455 Real f = - Real(2.0) * (dydz * dyz);
4457 inn = ((a + b) + (c + d) + (e + f)) / g2;
4467 template<
typename Iterator>
4470 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4471 return __inn_sapiro<Real,_Category>::inn_sapiro(it);
4475 template<
typename Real,
typename>
4478 template <
typename _II>
4482 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4486 template<
typename Real>
4487 struct __inn_lucido<Real, std::random_access_iterator2d_tag>
4489 template <
typename _II>
4494 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4495 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4498 Real g2 = gx2 + gy2;
4499 Real gxgy = gx * gy;
4508 Real lambda1 = gy2 - gxgy;
4509 Real lambda2 = gx2 - gxgy;
4510 Real lambda4 = gxgy;
4511 Real lambda0 = Real(-2.0) * ((lambda1 + lambda2) + lambda4);
4513 Real E = it[slip::n_8c[0]];
4514 Real N = it[slip::n_8c[2]];
4515 Real NW = it[slip::n_8c[3]];
4516 Real W = it[slip::n_8c[4]];
4517 Real S = it[slip::n_8c[6]];
4518 Real SE = it[slip::n_8c[7]];
4520 inn = ( lambda4 * (NW + SE)
4523 + lambda0 * center)/ g2;
4527 Real lambda1 = gy2 + gxgy;
4528 Real lambda2 = gx2 + gxgy;
4529 Real lambda3 = - gxgy;
4530 Real lambda0 = Real(-2.0) * ((lambda1 + lambda2) + lambda3);
4532 Real E = it[slip::n_8c[0]];
4533 Real N = it[slip::n_8c[2]];
4534 Real SW = it[slip::n_8c[5]];
4535 Real W = it[slip::n_8c[4]];
4536 Real S = it[slip::n_8c[6]];
4537 Real NE = it[slip::n_8c[1]];
4538 inn = ( lambda3 * (SW + NE)
4541 + lambda0 * center)/ g2;
4555 template<
typename Iterator>
4558 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4559 return __inn_lucido<Real,_Category>::inn_lucido(it);
4564 template<
typename Real,
typename>
4565 struct __inn_augereau
4567 template <
typename _II>
4569 inn_augereau(_II it)
4571 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4575 template<
typename Real>
4576 struct __inn_augereau<Real, std::random_access_iterator2d_tag>
4578 template <
typename _II>
4580 inn_augereau(_II it)
4583 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4584 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4587 Real g2 = gx2 + gy2;
4588 Real gxgy = gx * gy;
4597 Real lambda0 = Real(-2.0) * gx2;
4598 Real lambda2 = gx2 - gy2;
4599 Real lambda3 = Real(0.5) * (gy2 - gxgy);
4600 Real lambda4 = Real(0.5) * (gy2 + gxgy);
4604 Real NE = it[slip::n_8c[1]];
4605 Real N = it[slip::n_8c[2]];
4606 Real NW = it[slip::n_8c[3]];
4607 Real SW = it[slip::n_8c[5]];
4608 Real S = it[slip::n_8c[6]];
4609 Real SE = it[slip::n_8c[7]];
4612 inn = ( lambda4 * (NW + SE)
4613 + lambda3 * (NE + SW)
4615 + lambda0 * center)/ g2;
4619 Real lambda0 = Real(-2.0) * gy2;
4620 Real lambda1 = gy2 - gx2;
4621 Real lambda3 = Real(0.5) * (gx2 - gxgy);
4622 Real lambda4 = Real(0.5) * (gx2 + gxgy);
4625 Real E = it[slip::n_8c[0]];
4626 Real NE = it[slip::n_8c[1]];
4628 Real NW = it[slip::n_8c[3]];
4629 Real W = it[slip::n_8c[4]];
4630 Real SW = it[slip::n_8c[5]];
4632 Real SE = it[slip::n_8c[7]];
4633 inn = ( lambda4 * (NW + SE)
4634 + lambda3 * (NE + SW)
4636 + lambda0 * center)/ g2;
4649 template<
typename Iterator>
4652 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4653 return __inn_augereau<Real,_Category>::inn_augereau(it);
4658 template<
typename Real,
typename>
4659 struct __inn_alvarez
4661 template <
typename _II>
4665 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4669 template<
typename Real>
4670 struct __inn_alvarez<Real, std::random_access_iterator2d_tag>
4672 template <
typename _II>
4677 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4678 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4681 Real g2 = gx2 + gy2;
4682 Real gxgy = gx * gy;
4689 Real lambda0 = Real(0.25);
4690 Real lambda1 = Real(2.0) * lambda0 - gx2 / g2;
4691 Real lambda2 = Real(2.0) * lambda0 - gy2 / g2;
4692 Real lambda3 = -lambda0 + Real(0.5) * ( Real(1) - gxgy / g2);
4693 Real lambda4 = -lambda0 + Real(0.5) * ( Real(1) + gxgy / g2);
4694 lambda0 = Real(-1.0);
4696 Real E = it[slip::n_8c[0]];
4697 Real NE = it[slip::n_8c[1]];
4698 Real N = it[slip::n_8c[2]];
4699 Real NW = it[slip::n_8c[3]];
4700 Real W = it[slip::n_8c[4]];
4701 Real SW = it[slip::n_8c[5]];
4702 Real S = it[slip::n_8c[6]];
4703 Real SE = it[slip::n_8c[7]];
4705 inn = ( lambda4 * (NW + SE)
4706 + lambda3 * (NE + SW)
4719 template<
typename Iterator>
4722 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4723 return __inn_alvarez<Real,_Category>::inn_alvarez(it);
4727 template<
typename Real,
typename>
4728 struct __inn_alvarez2
4730 template <
typename _II>
4732 inn_alvarez2(_II it)
4734 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4738 template<
typename Real>
4739 struct __inn_alvarez2<Real, std::random_access_iterator2d_tag>
4741 template <
typename _II>
4743 inn_alvarez2(_II it)
4746 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4747 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4750 Real g2 = gx2 + gy2;
4751 Real gxgy = gx * gy;
4759 Real lambda0 = Real(0);
4760 if ( (absgx > absgy) && (gxgy>=0) )
4762 lambda0 = ( Real(2.0) * gy2 + gx2 + gxgy ) / Real(4.0);
4765 else if ( (absgx <= absgy) && (gxgy >= 0) )
4767 lambda0 = ( Real(2.0) * gx2 + gy2 + gxgy ) / Real(4.0);
4770 else if ( (absgx > absgy) && (gxgy <= 0) )
4773 lambda0 = ( Real(2.0) * gy2 + gx2 + gxgy ) / Real(4.0);
4778 lambda0 = ( gx2 + Real(2.0) * gy2 + gxgy ) / Real(4.0);
4782 Real lambda1 = Real(2.0) * lambda0 - gx2;
4783 Real lambda2 = Real(2.0) *lambda0 - gy2;
4784 Real lambda3 = -lambda0 + Real(0.5) * ( gx2 - gxgy + gy2 );
4785 Real lambda4 = -lambda0 + Real(0.5) * ( gx2 + gxgy + gy2 );
4786 lambda0 = -4.0*lambda0;
4789 Real E = it[slip::n_8c[0]];
4790 Real NE = it[slip::n_8c[1]];
4791 Real N = it[slip::n_8c[2]];
4792 Real NW = it[slip::n_8c[3]];
4793 Real W = it[slip::n_8c[4]];
4794 Real SW = it[slip::n_8c[5]];
4795 Real S = it[slip::n_8c[6]];
4796 Real SE = it[slip::n_8c[7]];
4798 inn = ( lambda4 * (NW + SE)
4799 + lambda3 * (NE + SW)
4812 template<
typename Iterator>
4815 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4816 return __inn_alvarez2<Real,_Category>::inn_alvarez2(it);
4820 template<
typename Real,
typename>
4821 struct __inn_cohignac
4823 template <
typename _II>
4825 inn_cohignac(_II it)
4827 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4831 template<
typename Real>
4832 struct __inn_cohignac<Real, std::random_access_iterator2d_tag>
4834 template <
typename _II>
4836 inn_cohignac(_II it)
4839 Real gx = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
4840 Real gy = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
4843 Real g2 = gx2 + gy2;
4844 Real gxgy = gx * gy;
4850 Real lambda0 = Real(0.5) - gx2/g2 + (gx2 / g2) * (gx2 / g2);
4851 Real lambda1 = Real(2.0) * lambda0 - gx2 /g2;
4852 Real lambda2 = Real(2.0) * lambda0 - gy2 / g2;
4853 Real lambda3 = -lambda0 + Real(0.5) * (Real(1.0) - gxgy / g2);
4854 Real lambda4 = -lambda0 + Real(0.5) * (Real(1.0) + gxgy / g2);
4855 lambda0 = Real(-4.0) * lambda0;
4858 Real E = it[slip::n_8c[0]];
4859 Real NE = it[slip::n_8c[1]];
4860 Real N = it[slip::n_8c[2]];
4861 Real NW = it[slip::n_8c[3]];
4862 Real W = it[slip::n_8c[4]];
4863 Real SW = it[slip::n_8c[5]];
4864 Real S = it[slip::n_8c[6]];
4865 Real SE = it[slip::n_8c[7]];
4867 inn = ( lambda4 * (NW + SE)
4868 + lambda3 * (NE + SW)
4881 template<
typename Iterator>
4884 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
4885 return __inn_cohignac<Real,_Category>::inn_cohignac(it);
4892 template<
typename Real,
typename>
4895 template <
typename _II,
typename Block>
4897 dvv(_II it, Block v)
4899 assert(Block::SIZE == 1);
4900 Real dxx = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
4909 template<
typename Real>
4910 struct __dvv<Real,std::random_access_iterator_tag>
4912 template <
typename _II,
typename Block>
4914 dvv(_II it, Block v)
4916 assert(Block::SIZE == 1);
4917 return __dvv<Real,std::random_access_iterator_tag>::dvv(it,v);
4921 template<
typename Real>
4922 struct __dvv<Real, std::random_access_iterator2d_tag>
4924 template <
typename _II,
typename Block>
4926 dvv(_II it, Block v)
4928 assert(Block::SIZE == 2);
4929 Real result = Real(0);
4930 Real a2 = v[0] * v[0];
4931 Real b2 = v[1] * v[1];
4932 Real norm2 = a2 + b2;
4934 if(norm2 != Real(0))
4937 Real dxx = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
4938 Real dyy = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
4939 Real dxy = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
4941 result = (a2 * dxx + 2.0 * v[0] * v[1] * dxy + b2 * dyy) / norm2 ;
4947 template<
typename Real>
4948 struct __dvv<Real, std::random_access_iterator3d_tag>
4950 template <
typename _II,
typename Block>
4952 dvv(_II it, Block v)
4954 assert(Block::SIZE == 3);
4955 Real result = Real(0);
4956 Real a2 = v[0] * v[0];
4957 Real b2 = v[1] * v[1];
4958 Real c2 = v[2] * v[2];
4959 Real norm2 = a2 + b2 + c2;
4961 if(norm2 != Real(0))
4963 Real dxx = __dxx<Real,std::random_access_iterator3d_tag>::dxx(it);
4964 Real dyy = __dyy<Real,std::random_access_iterator3d_tag>::dyy(it);
4965 Real dzz = __dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
4967 Real dxy = __dxy<Real,std::random_access_iterator3d_tag>::dxy(it);
4968 Real dxz = __dxz<Real,std::random_access_iterator3d_tag>::dxz(it);
4969 Real dyz = __dyz<Real,std::random_access_iterator3d_tag>::dyz(it);
4971 Real ab = v[0] * v[1];
4972 Real ac = v[0] * v[2];
4973 Real bc = v[1] * v[2];
4978 Real a4 = 2.0 * (ab * dxy);
4979 Real a5 = 2.0 * (ac * dxz);
4980 Real a6 = 2.0 * (bc * dyz);
4983 result = ((a1 + a2) + (a3 + a4) + (a5 + a6)) / norm2;
4992 template<
typename Real,
typename Block>
struct Dvv
4997 template<
typename Iterator>
5000 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5001 return __dvv<Real,_Category>::dvv(it,
v_);
5008 template<
typename Real,
typename>
5011 template <
typename _II>
5015 Real dxp = __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
5016 Real dxm = __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
5018 return minmod<Real>(dxp,dxm);
5022 template<
typename Real>
5023 struct __minmodx<Real, std::random_access_iterator2d_tag>
5025 template <
typename _II>
5030 Real dxp = __dx_fwd<Real,std::random_access_iterator2d_tag>::dx_fwd(it);
5031 Real dxm = __dx_bck<Real,std::random_access_iterator2d_tag>::dx_bck(it);
5032 return minmod<Real>(dxp,dxm);
5037 template<
typename Real>
5038 struct __minmodx<Real, std::random_access_iterator3d_tag>
5040 template <
typename _II>
5045 Real dxp = __dx_fwd<Real,std::random_access_iterator3d_tag>::dx_fwd(it);
5046 Real dxm = __dx_bck<Real,std::random_access_iterator3d_tag>::dx_bck(it);
5047 return minmod<Real>(dxp,dxm);
5054 template<
typename Iterator>
5057 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5058 return __minmodx<Real,_Category>::minmodx(it);
5063 template<
typename Real,
typename>
5066 template <
typename _II>
5070 Real dyp = __dy_fwd<Real,std::random_access_iterator_tag>::dy_fwd(it);
5071 Real dym = __dy_bck<Real,std::random_access_iterator_tag>::dy_bck(it);
5073 return minmod<Real>(dyp,dym);
5077 template<
typename Real>
5078 struct __minmody<Real, std::random_access_iterator2d_tag>
5080 template <
typename _II>
5085 Real dyp = __dy_fwd<Real,std::random_access_iterator2d_tag>::dy_fwd(it);
5086 Real dym = __dy_bck<Real,std::random_access_iterator2d_tag>::dy_bck(it);
5087 return minmod<Real>(dyp,dym);
5092 template<
typename Real>
5093 struct __minmody<Real, std::random_access_iterator3d_tag>
5095 template <
typename _II>
5100 Real dyp = __dy_fwd<Real,std::random_access_iterator3d_tag>::dy_fwd(it);
5101 Real dym = __dy_bck<Real,std::random_access_iterator3d_tag>::dy_bck(it);
5102 return minmod<Real>(dyp,dym);
5109 template<
typename Iterator>
5112 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5113 return __minmody<Real,_Category>::minmody(it);
5119 template<
typename Real,
typename>
5122 template <
typename _II>
5126 Real dzp = __dz_fwd<Real,std::random_access_iterator_tag>::dz_fwd(it);
5127 Real dzm = __dz_bck<Real,std::random_access_iterator_tag>::dz_bck(it);
5129 return minmod<Real>(dzp,dzm);
5133 template<
typename Real>
5134 struct __minmodz<Real, std::random_access_iterator2d_tag>
5136 template <
typename _II>
5141 Real dzp = __dz_fwd<Real,std::random_access_iterator2d_tag>::dz_fwd(it);
5142 Real dzm = __dz_bck<Real,std::random_access_iterator2d_tag>::dz_bck(it);
5143 return minmod<Real>(dzp,dzm);
5148 template<
typename Real>
5149 struct __minmodz<Real, std::random_access_iterator3d_tag>
5151 template <
typename _II>
5156 Real dzp = __dz_fwd<Real,std::random_access_iterator3d_tag>::dz_fwd(it);
5157 Real dzm = __dz_bck<Real,std::random_access_iterator3d_tag>::dz_bck(it);
5158 return minmod<Real>(dzp,dzm);
5165 template<
typename Iterator>
5168 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5169 return __minmodz<Real,_Category>::minmodz(it);
5176 template<
typename Real,
typename>
5177 struct __gradminus_OS
5179 template <
typename _II>
5181 gradminus_OS(_II it)
5183 Real dxp = __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
5184 Real dxm = __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
5185 Real max_x = osher_sethian_minus<Real>(dxp,dxm);
5190 template<
typename Real>
5191 struct __gradminus_OS<Real, std::random_access_iterator2d_tag>
5193 template <
typename _II>
5195 gradminus_OS(_II it)
5197 Real dxp = __dx_fwd<Real,std::random_access_iterator2d_tag>::dx_fwd(it);
5198 Real dxm = __dx_bck<Real,std::random_access_iterator2d_tag>::dx_bck(it);
5199 Real dyp = __dy_fwd<Real,std::random_access_iterator2d_tag>::dy_fwd(it);
5200 Real dym = __dy_bck<Real,std::random_access_iterator2d_tag>::dy_bck(it);
5201 Real max_x = osher_sethian_minus<Real>(dxp,dxm);
5202 Real max_y = osher_sethian_minus<Real>(dyp,dym);
5208 template<
typename Real>
5209 struct __gradminus_OS<Real, std::random_access_iterator3d_tag>
5211 template <
typename _II>
5213 gradminus_OS(_II it)
5215 Real dxp = __dx_fwd<Real,std::random_access_iterator3d_tag>::dx_fwd(it);
5216 Real dxm = __dx_bck<Real,std::random_access_iterator3d_tag>::dx_bck(it);
5217 Real dyp = __dy_fwd<Real,std::random_access_iterator3d_tag>::dy_fwd(it);
5218 Real dym = __dy_bck<Real,std::random_access_iterator3d_tag>::dy_bck(it);
5219 Real dzp = __dz_fwd<Real,std::random_access_iterator3d_tag>::dz_fwd(it);
5220 Real dzm = __dz_bck<Real,std::random_access_iterator3d_tag>::dz_bck(it);
5222 Real max_x = osher_sethian_minus<Real>(dxp,dxm);
5223 Real max_y = osher_sethian_minus<Real>(dyp,dym);
5224 Real max_z = osher_sethian_minus<Real>(dzp,dzm);
5226 return std::sqrt(max_x + max_y + max_z);
5233 template<
typename Iterator>
5236 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5237 return __gradminus_OS<Real,_Category>::gradminus_OS(it);
5245 template<
typename Real,
typename>
5246 struct __gradplus_OS
5248 template <
typename _II>
5252 Real dxp = __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
5253 Real dxm = __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
5254 Real max_x = osher_sethian_plus<Real>(dxp,dxm);
5259 template<
typename Real>
5260 struct __gradplus_OS<Real, std::random_access_iterator2d_tag>
5262 template <
typename _II>
5266 Real dxp = __dx_fwd<Real,std::random_access_iterator2d_tag>::dx_fwd(it);
5267 Real dxm = __dx_bck<Real,std::random_access_iterator2d_tag>::dx_bck(it);
5268 Real dyp = __dy_fwd<Real,std::random_access_iterator2d_tag>::dy_fwd(it);
5269 Real dym = __dy_bck<Real,std::random_access_iterator2d_tag>::dy_bck(it);
5270 Real max_x = osher_sethian_plus<Real>(dxp,dxm);
5271 Real max_y = osher_sethian_plus<Real>(dyp,dym);
5277 template<
typename Real>
5278 struct __gradplus_OS<Real, std::random_access_iterator3d_tag>
5280 template <
typename _II>
5284 Real dxp = __dx_fwd<Real,std::random_access_iterator3d_tag>::dx_fwd(it);
5285 Real dxm = __dx_bck<Real,std::random_access_iterator3d_tag>::dx_bck(it);
5286 Real dyp = __dy_fwd<Real,std::random_access_iterator3d_tag>::dy_fwd(it);
5287 Real dym = __dy_bck<Real,std::random_access_iterator3d_tag>::dy_bck(it);
5288 Real dzp = __dz_fwd<Real,std::random_access_iterator3d_tag>::dz_fwd(it);
5289 Real dzm = __dz_bck<Real,std::random_access_iterator3d_tag>::dz_bck(it);
5291 Real max_x = osher_sethian_plus<Real>(dxp,dxm);
5292 Real max_y = osher_sethian_plus<Real>(dyp,dym);
5293 Real max_z = osher_sethian_plus<Real>(dzp,dzm);
5295 return std::sqrt(max_x + max_y + max_z);
5302 template<
typename Iterator>
5305 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5306 return __gradplus_OS<Real,_Category>::gradplus_OS(it);
5314 template<
typename Real,
typename>
5315 struct __gradminus_BM
5317 template <
typename _II>
5319 gradminus_BM(_II it)
5321 Real dxp = __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
5322 Real dxm = __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
5323 Real max_x = max_brockett_maragos_minus<Real>(dxp,dxm);
5328 template<
typename Real>
5329 struct __gradminus_BM<Real, std::random_access_iterator2d_tag>
5331 template <
typename _II>
5333 gradminus_BM(_II it)
5335 Real dxp = __dx_fwd<Real,std::random_access_iterator2d_tag>::dx_fwd(it);
5336 Real dxm = __dx_bck<Real,std::random_access_iterator2d_tag>::dx_bck(it);
5337 Real dyp = __dy_fwd<Real,std::random_access_iterator2d_tag>::dy_fwd(it);
5338 Real dym = __dy_bck<Real,std::random_access_iterator2d_tag>::dy_bck(it);
5339 Real max_x = max_brockett_maragos_minus<Real>(dxp,dxm);
5340 Real max_y = max_brockett_maragos_minus<Real>(dyp,dym);
5346 template<
typename Real>
5347 struct __gradminus_BM<Real, std::random_access_iterator3d_tag>
5349 template <
typename _II>
5351 gradminus_BM(_II it)
5353 Real dxp = __dx_fwd<Real,std::random_access_iterator3d_tag>::dx_fwd(it);
5354 Real dxm = __dx_bck<Real,std::random_access_iterator3d_tag>::dx_bck(it);
5355 Real dyp = __dy_fwd<Real,std::random_access_iterator3d_tag>::dy_fwd(it);
5356 Real dym = __dy_bck<Real,std::random_access_iterator3d_tag>::dy_bck(it);
5357 Real dzp = __dz_fwd<Real,std::random_access_iterator3d_tag>::dz_fwd(it);
5358 Real dzm = __dz_bck<Real,std::random_access_iterator3d_tag>::dz_bck(it);
5360 Real max_x = max_brockett_maragos_minus<Real>(dxp,dxm);
5361 Real max_y = max_brockett_maragos_minus<Real>(dyp,dym);
5362 Real max_z = max_brockett_maragos_minus<Real>(dzp,dzm);
5364 return std::sqrt(max_x + max_y + max_z);
5371 template<
typename Iterator>
5374 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5375 return __gradminus_BM<Real,_Category>::gradminus_BM(it);
5382 template<
typename Real,
typename>
5383 struct __gradplus_BM
5385 template <
typename _II>
5389 Real dxp = __dx_fwd<Real,std::random_access_iterator_tag>::dx_fwd(it);
5390 Real dxm = __dx_bck<Real,std::random_access_iterator_tag>::dx_bck(it);
5391 Real max_x = max_brockett_maragos_plus<Real>(dxp,dxm);
5396 template<
typename Real>
5397 struct __gradplus_BM<Real, std::random_access_iterator2d_tag>
5399 template <
typename _II>
5403 Real dxp = __dx_fwd<Real,std::random_access_iterator2d_tag>::dx_fwd(it);
5404 Real dxm = __dx_bck<Real,std::random_access_iterator2d_tag>::dx_bck(it);
5405 Real dyp = __dy_fwd<Real,std::random_access_iterator2d_tag>::dy_fwd(it);
5406 Real dym = __dy_bck<Real,std::random_access_iterator2d_tag>::dy_bck(it);
5407 Real max_x = max_brockett_maragos_plus<Real>(dxp,dxm);
5408 Real max_y = max_brockett_maragos_plus<Real>(dyp,dym);
5414 template<
typename Real>
5415 struct __gradplus_BM<Real, std::random_access_iterator3d_tag>
5417 template <
typename _II>
5421 Real dxp = __dx_fwd<Real,std::random_access_iterator3d_tag>::dx_fwd(it);
5422 Real dxm = __dx_bck<Real,std::random_access_iterator3d_tag>::dx_bck(it);
5423 Real dyp = __dy_fwd<Real,std::random_access_iterator3d_tag>::dy_fwd(it);
5424 Real dym = __dy_bck<Real,std::random_access_iterator3d_tag>::dy_bck(it);
5425 Real dzp = __dz_fwd<Real,std::random_access_iterator3d_tag>::dz_fwd(it);
5426 Real dzm = __dz_bck<Real,std::random_access_iterator3d_tag>::dz_bck(it);
5428 Real max_x = max_brockett_maragos_plus<Real>(dxp,dxm);
5429 Real max_y = max_brockett_maragos_plus<Real>(dyp,dym);
5430 Real max_z = max_brockett_maragos_plus<Real>(dzp,dzm);
5432 return std::sqrt(max_x + max_y + max_z);
5439 template<
typename Iterator>
5442 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5443 return __gradplus_BM<Real,_Category>::gradplus_BM(it);
5450 template<
typename Real,
typename>
5451 struct __gradminus_minmod
5453 template <
typename _II>
5455 gradminus_minmod(_II it)
5457 Real dx = __minmodx<Real,std::random_access_iterator_tag>::minmodx(it);
5462 template<
typename Real>
5463 struct __gradminus_minmod<Real, std::random_access_iterator2d_tag>
5465 template <
typename _II>
5467 gradminus_minmod(_II it)
5469 Real dx = __minmodx<Real,std::random_access_iterator2d_tag>::minmodx(it);
5470 Real dy = __minmody<Real,std::random_access_iterator2d_tag>::minmody(it);
5476 template<
typename Real>
5477 struct __gradminus_minmod<Real, std::random_access_iterator3d_tag>
5479 template <
typename _II>
5481 gradminus_minmod(_II it)
5484 Real dx = __minmodx<Real,std::random_access_iterator3d_tag>::minmodx(it);
5485 Real dy = __minmody<Real,std::random_access_iterator3d_tag>::minmody(it);
5486 Real dz = __minmodz<Real,std::random_access_iterator3d_tag>::minmodz(it);
5495 template<
typename Iterator>
5498 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5499 return __gradminus_minmod<Real,_Category>::gradminus_minmod(it);
5506 template<
typename Iterator>
5509 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5510 return __gradminus_minmod<Real,_Category>::gradminus_minmod(it);
5521 template<
typename Real,
typename>
5524 template <
typename _II>
5528 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5529 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5531 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5535 template<
typename Real>
5536 struct __min_curv<Real,std::random_access_iterator_tag>
5538 template <
typename _II>
5542 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5543 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5545 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5549 template<
typename Real>
5550 struct __min_curv<Real, std::random_access_iterator2d_tag>
5552 template <
typename _II>
5556 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
5557 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
5558 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5559 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5560 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5563 Real H = 1 + p2 + q2;
5568 Real ctot = (r * t - s * s) / n4;
5569 Real rau = ( (Real(1) + p2) * t - Real(2) * p * q * s + (Real(1) + q2) * r) / n3;
5571 return( rau - Real(
std::sqrt(rau * rau - ctot)) );
5582 template<
typename Iterator>
5585 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5586 return __min_curv<Real,_Category>::min_curv(it);
5593 template<
typename Real,
typename>
5596 template <
typename _II>
5600 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5601 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5603 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5608 template<
typename Real>
5609 struct __max_curv<Real,std::random_access_iterator_tag>
5611 template <
typename _II>
5615 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5616 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5618 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5622 template<
typename Real>
5623 struct __max_curv<Real, std::random_access_iterator2d_tag>
5625 template <
typename _II>
5629 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
5630 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
5631 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5632 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5633 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5636 Real H = 1 + p2 + q2;
5641 Real ctot = (r * t - s * s) / n4;
5642 Real rau = ( (Real(1) + p2) * t - Real(2) * p * q * s + (Real(1) + q2) * r) / n3;
5644 return( rau + Real(
std::sqrt(rau * rau - ctot)) );
5656 template<
typename Iterator>
5659 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5660 return __max_curv<Real,_Category>::max_curv(it);
5668 template<
typename Real,
typename>
5671 template <
typename _II>
5675 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5676 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5678 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5683 template<
typename Real>
5684 struct __mean_curv<Real,std::random_access_iterator_tag>
5686 template <
typename _II>
5690 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5691 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5693 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5697 template<
typename Real>
5698 struct __mean_curv<Real, std::random_access_iterator2d_tag>
5700 template <
typename _II>
5704 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
5705 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
5706 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5707 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5708 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5711 Real H = 1 + p2 + q2;
5715 return ( ( (Real(1) + p2) * t - Real(2) * p * q * s + (Real(1) + q2) * r) /(Real(2.0) * n3) );
5719 template<
typename Real>
5720 struct __mean_curv<Real, std::random_access_iterator3d_tag>
5722 template <
typename _II>
5727 Real Ix = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
5728 Real Iy = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
5729 Real Iz = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
5730 Real Ixy = __dxy<Real,std::random_access_iterator3d_tag>::dxy(it);
5731 Real Ixz = __dxz<Real,std::random_access_iterator3d_tag>::dxz(it);
5732 Real Iyz = __dyz<Real,std::random_access_iterator3d_tag>::dyz(it);
5733 Real Ixx = __dxx<Real,std::random_access_iterator3d_tag>::dxx(it);
5734 Real Iyy = __dyy<Real,std::random_access_iterator3d_tag>::dyy(it);
5735 Real Izz = __dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
5741 Real IxIy = Ix * Iy;
5742 Real IxIz = Ix * Iz;
5743 Real IyIz = Iy * Iz;
5745 Real a = (Real(1.0) + (Ix2 + Iz2));
5746 Real b = (Real(1.0) + (Iy2 + Iz2));
5747 Real c = (Real(1.0) + (Ix2 + Iy2));
5749 Real g = (Real(1.0) + Ix2) + (Iy2 + Iz2);
5751 Real den = Real(std::pow(
double(g),
double(3.0/2.0)));
5754 (a * Iyy) + (b * Ixx) + (c * Izz)
5755 - Real(2.0) * IxIy * Ixy
5756 - Real(2.0) * IxIz * Ixz
5757 - Real(2.0) * IyIz * Iyz ) / den ;
5759 return (H / Real(3.0));
5769 template<
typename Iterator>
5772 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5773 return __mean_curv<Real,_Category>::mean_curv(it);
5780 template<
typename Real,
typename>
5783 template <
typename _II>
5787 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5788 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5790 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5794 template<
typename Real>
5795 struct __total_curv<Real,std::random_access_iterator_tag>
5797 template <
typename _II>
5801 Real p = __dx<Real,std::random_access_iterator_tag>::dx(it);
5802 Real r = __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5804 return -r / Real(
std::sqrt(1.0 +
double(p2)));
5808 template<
typename Real>
5809 struct __total_curv<Real, std::random_access_iterator2d_tag>
5811 template <
typename _II>
5815 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
5816 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
5817 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5818 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5819 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5823 Real n = (Real(1) + p2 + q2) * (Real(1) + p2 + q2);
5825 return (( r * t - s * s) / n);
5829 template<
typename Real>
5830 struct __total_curv<Real, std::random_access_iterator3d_tag>
5832 template <
typename _II>
5837 Real Ix = __dx<Real,std::random_access_iterator3d_tag>::dx(it);
5838 Real Iy = __dy<Real,std::random_access_iterator3d_tag>::dy(it);
5839 Real Iz = __dz<Real,std::random_access_iterator3d_tag>::dz(it);
5840 Real Ixy = __dxy<Real,std::random_access_iterator3d_tag>::dxy(it);
5841 Real Ixz = __dxz<Real,std::random_access_iterator3d_tag>::dxz(it);
5842 Real Iyz = __dyz<Real,std::random_access_iterator3d_tag>::dyz(it);
5843 Real Ixx = __dxx<Real,std::random_access_iterator3d_tag>::dxx(it);
5844 Real Iyy = __dyy<Real,std::random_access_iterator3d_tag>::dyy(it);
5845 Real Izz = __dzz<Real,std::random_access_iterator3d_tag>::dzz(it);
5851 Real Ixy2 = Ixy * Ixy;
5852 Real Ixz2 = Ixz * Ixz;
5853 Real Iyz2 = Iyz * Iyz;
5856 Real g = (Real(1.0) + Ix2) + (Iy2 + Iz2);
5858 Real den = Real(std::pow(
double(g),
double(2.0/5.0)));
5860 Real K = ( (Ixx * Iyy) * Izz
5861 + (Real(2.0) * Ixy) * (Ixz * Iyz)
5862 - (Ixx * Iyz2) - (Iyy * Ixz2) - (Izz * Ixy2)) / den;
5875 template<
typename Iterator>
5878 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5879 return __total_curv<Real,_Category>::total_curv(it);
5887 template<
typename Real,
typename>
5888 struct __lambda1_curv
5890 template <
typename _II>
5892 lambda1_curv(_II it)
5894 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5898 template<
typename Real>
5899 struct __lambda1_curv<Real,std::random_access_iterator_tag>
5901 template <
typename _II>
5903 lambda1_curv(_II it)
5905 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5909 template<
typename Real>
5910 struct __lambda1_curv<Real, std::random_access_iterator2d_tag>
5912 template <
typename _II>
5914 lambda1_curv(_II it)
5916 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5917 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5918 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5921 return (((r + t) + Real(
std::sqrt(
double( (r - t) * (r - t) + 4.0 * s2) ) ) )/ Real(2.0) );
5931 template<
typename Iterator>
5934 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5935 return __lambda1_curv<Real,_Category>::lambda1_curv(it);
5943 template<
typename Real,
typename>
5944 struct __lambda2_curv
5946 template <
typename _II>
5948 lambda2_curv(_II it)
5950 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5954 template<
typename Real>
5955 struct __lambda2_curv<Real,std::random_access_iterator_tag>
5957 template <
typename _II>
5959 lambda2_curv(_II it)
5961 return __dxx<Real,std::random_access_iterator_tag>::dxx(it);
5965 template<
typename Real>
5966 struct __lambda2_curv<Real, std::random_access_iterator2d_tag>
5968 template <
typename _II>
5970 lambda2_curv(_II it)
5972 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
5973 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
5974 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
5977 return (((r + t) - Real(
std::sqrt(
double( (r - t) * (r - t) + 4.0 * s2) ) ) )/ Real(2.0) );
5988 template<
typename Iterator>
5991 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
5992 return __lambda2_curv<Real,_Category>::lambda2_curv(it);
6000 template<
typename Real,
typename>
6003 template <
typename _II>
6007 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6011 template<
typename Real>
6012 struct __iso_curv<Real,std::random_access_iterator_tag>
6014 template <
typename _II>
6018 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6022 template<
typename Real>
6023 struct __iso_curv<Real, std::random_access_iterator2d_tag>
6025 template <
typename _II>
6029 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
6030 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
6031 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
6032 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
6033 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
6040 Real result = Real(0.0);
6044 result = (Real(2.0) * p * q * s - q2 * r - p2 * t ) / n3;
6059 template<
typename Iterator>
6062 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
6063 return __iso_curv<Real,_Category>::iso_curv(it);
6070 template<
typename Real,
typename>
6071 struct __courant_line_curv
6073 template <
typename _II>
6075 courant_line_curv(_II it)
6077 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6081 template<
typename Real>
6082 struct __courant_line_curv<Real,std::random_access_iterator_tag>
6084 template <
typename _II>
6086 courant_line_curv(_II it)
6088 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6092 template<
typename Real>
6093 struct __courant_line_curv<Real, std::random_access_iterator2d_tag>
6095 template <
typename _II>
6097 courant_line_curv(_II it)
6099 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
6100 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
6101 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
6102 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
6103 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
6110 Real result = Real(0.0);
6114 result = (p * q * (t - r) + s * (p2 - q2) ) / n3;
6129 template<
typename Iterator>
6132 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
6133 return __courant_line_curv<Real,_Category>::courant_line_curv(it);
6141 template<
typename Real,
typename>
6142 struct __delta_g_curv
6144 template <
typename _II>
6146 delta_g_curv(_II it)
6148 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6152 template<
typename Real>
6153 struct __delta_g_curv<Real,std::random_access_iterator_tag>
6155 template <
typename _II>
6157 delta_g_curv(_II it)
6159 return __min_curv<Real,std::random_access_iterator_tag>::min_curv(it);
6163 template<
typename Real>
6164 struct __delta_g_curv<Real, std::random_access_iterator2d_tag>
6166 template <
typename _II>
6168 delta_g_curv(_II it)
6170 Real p = __dx<Real,std::random_access_iterator2d_tag>::dx(it);
6171 Real q = __dy<Real,std::random_access_iterator2d_tag>::dy(it);
6172 Real s = __dxy<Real,std::random_access_iterator2d_tag>::dxy(it);
6173 Real r = __dxx<Real,std::random_access_iterator2d_tag>::dxx(it);
6174 Real t = __dyy<Real,std::random_access_iterator2d_tag>::dyy(it);
6181 Real result = Real(0.0);
6185 result = - (((2.0 * p) * (q * s) + (q2 * r) + (p2 * t) ) / n3);
6200 template<
typename Iterator>
6203 typedef typename std::iterator_traits<Iterator>::iterator_category _Category;
6204 return __delta_g_curv<Real,_Category>::delta_g_curv(it);
6252 template <
typename RandomAccessIteratorNd1,
6253 typename RandomAccessIteratorNd2,
6256 RandomAccessIteratorNd1 in_last,
6257 RandomAccessIteratorNd2 out_first,
6260 for(; in_first != in_last; ++in_first, ++out_first)
6262 *out_first = op(in_first);
6319 template <
typename RandomAccessIteratorNd1,
6320 typename RandomAccessIteratorNd2,
6321 typename RandomAccessIteratorNd3,
6325 RandomAccessIteratorNd1 in_last,
6326 RandomAccessIteratorNd2 out_first1,
6327 RandomAccessIteratorNd3 out_first2,
6332 for(; in_first != in_last; ++in_first, ++out_first1, ++out_first2)
6334 *out_first1 = op1(in_first);
6335 *out_first2 = op2(in_first);
6399 template <
typename RandomAccessIteratorNd1,
6400 typename RandomAccessIteratorNd2,
6401 typename RandomAccessIteratorNd3,
6402 typename RandomAccessIteratorNd4,
6407 RandomAccessIteratorNd1 in_last,
6408 RandomAccessIteratorNd2 out_first1,
6409 RandomAccessIteratorNd3 out_first2,
6410 RandomAccessIteratorNd4 out_first3,
6415 for(; in_first != in_last; ++in_first, ++out_first1, ++out_first2,
6418 *out_first1 = op1(in_first);
6419 *out_first2 = op2(in_first);
6420 *out_first3 = op3(in_first);
6428 #endif //SLIP_DERIVATIVES_HPP
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
Real operator()(Iterator &it) const
Provides a class to modelize 3d points.
Real operator()(Iterator it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
void center(RandomAccessIterator first, RandomAccessIterator last, RandomAccessIterator2 out_first)
Substracts its mean to a range.
Real operator()(Iterator it) const
Real operator()(Iterator &it) const
reverse_row_iterator row_rbegin(const size_type row)
Returns a read/write reverse iterator that points to the last element of the row row in the Matrix...
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it)
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
iterator end()
Returns a read/write iterator that points one past the last element in the Vector. Iteration is done in ordinary element order.
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
Real minmod(const Real gplus, const Real gminus)
Real operator()(Iterator &it) const
Provides a class to modelize 4d points.
void differential_operator_2(RandomAccessIteratorNd1 in_first, RandomAccessIteratorNd1 in_last, RandomAccessIteratorNd2 out_first1, RandomAccessIteratorNd3 out_first2, Operator1 &op1, Operator2 &op2)
Applies 2 differential operators on a range.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
void derivative_3d(RandomAccessIterator3d1 I_fup, RandomAccessIterator3d1 I_back_bot, const slip::Point3d< T > &grid_step, slip::SPATIAL_DIRECTION der_dir, const std::size_t der_order, const std::size_t sch_order, RandomAccessIterator3d2 R_fup, RandomAccessIterator3d2 R_back_bot)
Computes finite differences derivatives of a 3d range.
Real operator()(Iterator it) const
Real osher_sethian_minus(const Real gplus, const Real gminus)
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Provides common linear algebra algorithms.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
HyperVolume< T > abs(const HyperVolume< T > &M)
void differential_operator_3(RandomAccessIteratorNd1 in_first, RandomAccessIteratorNd1 in_last, RandomAccessIteratorNd2 out_first1, RandomAccessIteratorNd3 out_first2, RandomAccessIteratorNd4 out_first3, Operator1 &op1, Operator2 &op2, Operator3 &op3)
Applies 3 differential operators on a range.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2...
Real operator()(Iterator &it) const
Real max_brockett_maragos_minus(const Real gplus, const Real gminus)
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
reverse_row_iterator row_rend(const size_type row)
Returns a read/write reverse iterator that points one past the first element of the row row in the Ma...
Real operator()(Iterator &it) const
void derivative_2d(Iterator2d1 I_up, Iterator2d1 I_bot, const slip::Point2d< T > &grid_step, slip::SPATIAL_DIRECTION der_dir, const std::size_t der_order, const std::size_t sch_order, Iterator2d2 R_up, Iterator2d2 R_bot)
Computes finite differences derivatives of a 2d range.
Provides a class to manipulate neighbourhood configurations.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
This is a point4d class, a specialized version of Point<CoordType,DIM> with DIM = 4...
Real operator()(Iterator &it) const
void finite_diff_coef(const std::size_t sch_ord, const std::size_t sch_shift, Container2D &Dinv)
return finite differences coefficients for derivation based on Taylor series (sch_ord-sch_shift steps...
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
static _Tp half()
Constant .
void derivative_4d(RandomAccessIterator4d1 I_ffup, RandomAccessIterator4d1 I_last_back_bot, const slip::Point4d< T > &grid_step, slip::FOUR_DIM_DIRECTION der_dir, const std::size_t der_order, const std::size_t sch_order, RandomAccessIterator4d2 R_ffup, RandomAccessIterator4d2 R_last_back_bot)
Computes finite differences derivatives of a 4d range.
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
Numerical Vector class. This container statisfies the RandomAccessContainer concepts of the Standard ...
Real operator()(Iterator &it) const
HyperVolume< T > sqrt(const HyperVolume< T > &M)
Real operator()(Iterator it) const
Real max_brockett_maragos_plus(const Real gplus, const Real gminus)
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Numerical matrix class. This container statisfies the BidirectionnalContainer concepts of the STL...
Real operator()(Iterator &it) const
void same_convolution(SrcIter first, SrcIter last, KernelIter kernel_first, KernelIter kernel_last, std::size_t ksize_left, std::size_t ksize_right, ResIter result, slip::BORDER_TREATMENT bt=slip::BORDER_TREATMENT_ZERO_PADDED)
Computes the same convolution of signal by a 1d-kernel.
void valid_convolution(SrcIter first, SrcIter last, KernelIter kernel_first, KernelIter kernel_last, std::size_t ksize_left, std::size_t ksize_right, ResIter result)
Computes the valid convolution of signal by a 1d-kernel.
void inverse(const Matrix1 &M, const std::size_t nr1, const std::size_t nc1, Matrix2 &IM, const std::size_t nr2, const std::size_t nc2)
Computes the inverse of a matrix using gaussian elimination.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
std::iterator_traits< RandomAccessIterator1 >::value_type inner_product(RandomAccessIterator1 first1, RandomAccessIterator1 last1, RandomAccessIterator2 first2, typename std::iterator_traits< RandomAccessIterator1 >::value_type init=typename std::iterator_traits< RandomAccessIterator1 >::value_type())
Computes the inner_product of two ranges X and Y: .
Real osher_sethian_plus(const Real gplus, const Real gminus)
Provides some convolution algorithms.
FOUR_DIM_DIRECTION
Choose between different directions in a 4D space.
SPATIAL_DIRECTION
Choose between different spatial directions.
Provides a class to manipulate Numerical Matrix.
Provides a class to modelize 2d points.
Real operator()(Iterator &it) const
void differential_operator(RandomAccessIteratorNd1 in_first, RandomAccessIteratorNd1 in_last, RandomAccessIteratorNd2 out_first, Operator &op)
Applies a differential operator on a range.
Real operator()(Iterator &it) const
Real operator()(Iterator &it) const
void derivative(SrcIter first, SrcIter last, const std::size_t der_ord, const std::size_t sch_ord, const std::size_t sch_shift, const Container2D &M, ResIter result)
Computes 1d finite differences derivatives of an iterator range.
Real operator()(Iterator &it) const
void finite_diff_kernels(const std::size_t der_ord, const std::size_t sch_ord, const std::size_t sch_shift, std::vector< KernelsIterator > &kernels_first)
Computes finite differences kernels for derivation based on Taylor series (sch_ord-sch_shift steps up...
Real operator()(Iterator it) const
row_iterator row_begin(const size_type row)
Returns a read/write iterator that points to the first element of the row row in the Matrix...
Real operator()(Iterator &it) const
Real operator()(Iterator it) const
Provides a class to manipulate numerical vectors.
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
Real operator()(Iterator &it) const
iterator begin()
Returns a read/write iterator that points to the first element in the Vector. Iteration is done in or...
This is a point3d class, a specialized version of Point<CoordType,DIM> with DIM = 3...