148 fprintf ( stderr,
"\n" );
149 fprintf ( stderr,
"I4_MODP - Fatal error!\n" );
150 fprintf ( stderr,
" I4_MODP ( I, J ) called with J = %d\n",
j );
158 value = value + abs (
j );
234 wide = jhi + 1 - jlo;
242 value = jlo +
i4_modp ( ival - jlo, wide );
340 value = s * (
int ) ( fabs ( x ) + 0.5 );
409 for (
i = 0;
i < 2;
i++ )
411 for (
j = 0;
j <
n;
j++ )
413 phy[
i+
j*2] =
t[
i+0*2] * ( 1.0 - ref[0+
j*2] - ref[1+
j*2] )
414 +
t[
i+1*2] * + ref[0+
j*2]
415 +
t[
i+2*2] * + ref[1+
j*2];
514 t[0+0*2] * (
t[1+1*2] -
t[1+2*2] ) +
515 t[0+1*2] * (
t[1+2*2] -
t[1+0*2] ) +
516 t[0+2*2] * (
t[1+0*2] -
t[1+1*2] ) );
559 if ( 1 <= rule && rule <= 9 )
566 fprintf ( stderr,
"\n" );
567 fprintf ( stderr,
"TRIANGLE_NCO_DEGREE - Fatal error!\n" );
568 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
623 order_num = order_num + suborder[
order];
676 double *suborder_xyz;
682 suborder_xyz = (
double * ) malloc ( 3 * suborder_num *
sizeof (
double ) );
683 suborder_w = (
double * ) malloc ( suborder_num *
sizeof (
double ) );
693 for ( s = 0; s < suborder_num; s++ )
695 if ( suborder[s] == 1 )
697 xy[0+o*2] = suborder_xyz[0+s*3];
698 xy[1+o*2] = suborder_xyz[1+s*3];
699 w[o] = suborder_w[s];
702 else if ( suborder[s] == 3 )
704 for (
k = 0;
k < 3;
k++ )
706 xy[0+o*2] = suborder_xyz [
i4_wrap(
k, 0,2) + s*3 ];
707 xy[1+o*2] = suborder_xyz [
i4_wrap(
k+1,0,2) + s*3 ];
708 w[o] = suborder_w[s];
712 else if ( suborder[s] == 6 )
714 for (
k = 0;
k < 3;
k++ )
716 xy[0+o*2] = suborder_xyz [
i4_wrap(
k, 0,2) + s*3 ];
717 xy[1+o*2] = suborder_xyz [
i4_wrap(
k+1,0,2) + s*3 ];
718 w[o] = suborder_w[s];
722 for (
k = 0;
k < 3;
k++ )
724 xy[0+o*2] = suborder_xyz [
i4_wrap(
k+1,0,2) + s*3 ];
725 xy[1+o*2] = suborder_xyz [
i4_wrap(
k, 0,2) + s*3 ];
726 w[o] = suborder_w[s];
732 fprintf ( stderr,
"\n" );
733 fprintf ( stderr,
"TRIANGLE_NCO_RULE - Fatal error!\n" );
734 fprintf ( stderr,
" Illegal SUBORDER(%d) = %d\n", s, suborder[s] );
740 free ( suborder_xyz );
826 suborder = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
832 else if ( rule == 2 )
836 else if ( rule == 3 )
841 else if ( rule == 4 )
847 else if ( rule == 5 )
854 else if ( rule == 6 )
862 else if ( rule == 7 )
872 else if ( rule == 8 )
883 else if ( rule == 9 )
898 fprintf ( stderr,
"\n" );
899 fprintf ( stderr,
"TRIANGLE_NCO_SUBORDER - Fatal error!\n" );
900 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
949 else if ( rule == 2 )
953 else if ( rule == 3 )
957 else if ( rule == 4 )
961 else if ( rule == 5 )
965 else if ( rule == 6 )
969 else if ( rule == 7 )
973 else if ( rule == 8 )
977 else if ( rule == 9 )
984 fprintf ( stderr,
"\n" );
985 fprintf ( stderr,
"TRIANGLE_NCO_SUBORDER_NUM - Fatal error!\n" );
986 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
995 double suborder_w[] )
1039 int *suborder_xyz_n;
1041 suborder_xyz_n = (
int * ) malloc ( 3 * suborder_num *
sizeof (
int ) );
1042 suborder_w_n = (
int * ) malloc ( suborder_num *
sizeof (
int ) );
1047 suborder_w_n, &suborder_w_d );
1049 else if ( rule == 2 )
1052 suborder_w_n, &suborder_w_d );
1054 else if ( rule == 3 )
1057 suborder_w_n, &suborder_w_d );
1059 else if ( rule == 4 )
1062 suborder_w_n, &suborder_w_d );
1064 else if ( rule == 5 )
1067 suborder_w_n, &suborder_w_d );
1069 else if ( rule == 6 )
1072 suborder_w_n, &suborder_w_d );
1074 else if ( rule == 7 )
1077 suborder_w_n, &suborder_w_d );
1079 else if ( rule == 8 )
1082 suborder_w_n, &suborder_w_d );
1084 else if ( rule == 9 )
1087 suborder_w_n, &suborder_w_d );
1091 fprintf ( stderr,
"\n" );
1092 fprintf ( stderr,
"TRIANGLE_NCO_SUBRULE - Fatal error!\n" );
1093 fprintf ( stderr,
" Illegal RULE = %d\n", rule );
1097 for ( s = 0; s < suborder_num; s++ )
1099 for (
i = 0;
i < 3;
i++ )
1101 suborder_xyz[
i+s*3] =
1102 (
double ) ( 1 + suborder_xyz_n[
i+s*3] )
1103 / (
double ) ( 3 + suborder_xyz_d );
1106 for ( s = 0; s < suborder_num; s++ )
1108 suborder_w[s] = (
double ) suborder_w_n[s] / (
double ) suborder_w_d;
1111 free ( suborder_w_n );
1112 free ( suborder_xyz_n );
1119 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1165 int suborder_xyz_n_01[3*1] = {
1168 int suborder_xyz_d_01 = 0;
1169 int suborder_w_n_01[1] = { 1 };
1170 int suborder_w_d_01 = 1;
1172 for ( s = 0; s < suborder_num; s++ )
1174 for (
i = 0;
i < 3;
i++ )
1176 suborder_xyz_n[
i+s*3] = suborder_xyz_n_01[
i+s*3];
1179 *suborder_xyz_d = suborder_xyz_d_01;
1181 for ( s = 0; s < suborder_num; s++ )
1183 suborder_w_n[s] = suborder_w_n_01[s];
1185 *suborder_w_d = suborder_w_d_01;
1192 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1238 int suborder_xyz_n_02[3*1] = {
1241 int suborder_xyz_d_02 = 1;
1242 int suborder_w_n_02[1] = { 1 };
1243 int suborder_w_d_02 = 3;
1245 for ( s = 0; s < suborder_num; s++ )
1247 for (
i = 0;
i < 3;
i++ )
1249 suborder_xyz_n[
i+s*3] = suborder_xyz_n_02[
i+s*3];
1252 *suborder_xyz_d = suborder_xyz_d_02;
1254 for ( s = 0; s < suborder_num; s++ )
1256 suborder_w_n[s] = suborder_w_n_02[s];
1258 *suborder_w_d = suborder_w_d_02;
1265 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1311 int suborder_xyz_n_03[3*2] = {
1315 int suborder_xyz_d_03 = 2;
1316 int suborder_w_n_03[2] = { 7, -3 };
1317 int suborder_w_d_03 = 12;
1319 for ( s = 0; s < suborder_num; s++ )
1321 for (
i = 0;
i < 3;
i++ )
1323 suborder_xyz_n[
i+s*3] = suborder_xyz_n_03[
i+s*3];
1326 *suborder_xyz_d = suborder_xyz_d_03;
1328 for ( s = 0; s < suborder_num; s++ )
1330 suborder_w_n[s] = suborder_w_n_03[s];
1332 *suborder_w_d = suborder_w_d_03;
1339 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1385 int suborder_xyz_n_04[3*3] = {
1390 int suborder_xyz_d_04 = 3;
1391 int suborder_w_n_04[3] = { 8, 3, -12 };
1392 int suborder_w_d_04 = 30;
1394 for ( s = 0; s < suborder_num; s++ )
1396 for (
i = 0;
i < 3;
i++ )
1398 suborder_xyz_n[
i+s*3] = suborder_xyz_n_04[
i+s*3];
1401 *suborder_xyz_d = suborder_xyz_d_04;
1403 for ( s = 0; s < suborder_num; s++ )
1405 suborder_w_n[s] = suborder_w_n_04[s];
1407 *suborder_w_d = suborder_w_d_04;
1414 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1460 int suborder_xyz_n_05[3*4] = {
1466 int suborder_xyz_d_05 = 4;
1467 int suborder_w_n_05[4] = { 307, -316, 629, -64 };
1468 int suborder_w_d_05 = 720;
1470 for ( s = 0; s < suborder_num; s++ )
1472 for (
i = 0;
i < 3;
i++ )
1474 suborder_xyz_n[
i+s*3] = suborder_xyz_n_05[
i+s*3];
1477 *suborder_xyz_d = suborder_xyz_d_05;
1479 for ( s = 0; s < suborder_num; s++ )
1481 suborder_w_n[s] = suborder_w_n_05[s];
1483 *suborder_w_d = suborder_w_d_05;
1490 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1536 int suborder_xyz_n_06[3*5] = {
1543 int suborder_xyz_d_06 = 5;
1544 int suborder_w_n_06[5] = { 71, -13, 57, -167, 113 };
1545 int suborder_w_d_06 = 315;
1547 for ( s = 0; s < suborder_num; s++ )
1549 for (
i = 0;
i < 3;
i++ )
1551 suborder_xyz_n[
i+s*3] = suborder_xyz_n_06[
i+s*3];
1554 *suborder_xyz_d = suborder_xyz_d_06;
1556 for ( s = 0; s < suborder_num; s++ )
1558 suborder_w_n[s] = suborder_w_n_06[s];
1560 *suborder_w_d = suborder_w_d_06;
1567 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1613 int suborder_xyz_n_07[3*7] = {
1622 int suborder_xyz_d_07 = 6;
1623 int suborder_w_n_07[7] = { 767, -1257, 2901, 387, -3035, -915, 3509 };
1624 int suborder_w_d_07 = 2240;
1626 for ( s = 0; s < suborder_num; s++ )
1628 for (
i = 0;
i < 3;
i++ )
1630 suborder_xyz_n[
i+s*3] = suborder_xyz_n_07[
i+s*3];
1633 *suborder_xyz_d = suborder_xyz_d_07;
1635 for ( s = 0; s < suborder_num; s++ )
1637 suborder_w_n[s] = suborder_w_n_07[s];
1639 *suborder_w_d = suborder_w_d_07;
1646 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1692 int suborder_xyz_n_08[3*8] = {
1702 int suborder_xyz_d_08 = 7;
1703 int suborder_w_n_08[8] = { 898, -662, 1573, -2522, -191, 2989, -5726, 1444 };
1704 int suborder_w_d_08 = 4536;
1706 for ( s = 0; s < suborder_num; s++ )
1708 for (
i = 0;
i < 3;
i++ )
1710 suborder_xyz_n[
i+s*3] = suborder_xyz_n_08[
i+s*3];
1713 *suborder_xyz_d = suborder_xyz_d_08;
1715 for ( s = 0; s < suborder_num; s++ )
1717 suborder_w_n[s] = suborder_w_n_08[s];
1719 *suborder_w_d = suborder_w_d_08;
1726 int *suborder_xyz_d,
int suborder_w_n[],
int *suborder_w_d )
1772 int suborder_xyz_n_09[3*10] = {
1784 int suborder_xyz_d_09 = 8;
1785 int suborder_w_n_09[10] = {
1786 1051445, -2366706, 6493915, 1818134, -9986439,-3757007, 12368047,
1787 478257, 10685542, -6437608 };
1788 int suborder_w_d_09 = 3628800;
1790 for ( s = 0; s < suborder_num; s++ )
1792 for (
i = 0;
i < 3;
i++ )
1794 suborder_xyz_n[
i+s*3] = suborder_xyz_n_09[
i+s*3];
1797 *suborder_xyz_d = suborder_xyz_d_09;
1799 for ( s = 0; s < suborder_num; s++ )
1801 suborder_w_n[s] = suborder_w_n_09[s];
1803 *suborder_w_d = suborder_w_d_09;