mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
[qfcc] Flip the 2d PGA layout
The makes 2d PGA and 3d VGA layouts consistent.
This commit is contained in:
parent
be4405485d
commit
2967b97c18
3 changed files with 83 additions and 80 deletions
|
@ -103,9 +103,9 @@ static const char *mvec_2d_names[] = {
|
||||||
|
|
||||||
static const char *mvec_3d_names[] = {
|
static const char *mvec_3d_names[] = {
|
||||||
"vec",
|
"vec",
|
||||||
"scalar"
|
|
||||||
"bvec",
|
|
||||||
"tvec",
|
"tvec",
|
||||||
|
"bvec",
|
||||||
|
"scalar",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -339,11 +339,11 @@ algebra_init (algebra_t *a)
|
||||||
basis_layout_init (&a->layout, 4, a->groups);
|
basis_layout_init (&a->layout, 4, a->groups);
|
||||||
} else if (p == 2 && m == 0 && z == 1) {
|
} else if (p == 2 && m == 0 && z == 1) {
|
||||||
// 2d PGA (w squares to 0, x y square to +1):
|
// 2d PGA (w squares to 0, x y square to +1):
|
||||||
// : yw xw xy 1
|
|
||||||
// : x y w wxy
|
// : x y w wxy
|
||||||
|
// : yw wx xy 1
|
||||||
basis_blade_t pga_blades[8] = {
|
basis_blade_t pga_blades[8] = {
|
||||||
blades[5], blades[4], blades[6], blades[0],
|
|
||||||
blades[2], blades[3], blades[1], blades[7],
|
blades[2], blades[3], blades[1], blades[7],
|
||||||
|
blades[5], blades[4], blades[6], blades[0],
|
||||||
};
|
};
|
||||||
a->groups = malloc (sizeof (basis_group_t[4]));
|
a->groups = malloc (sizeof (basis_group_t[4]));
|
||||||
a->mvec_types = alloc_mvec_types (4);
|
a->mvec_types = alloc_mvec_types (4);
|
||||||
|
|
|
@ -816,7 +816,7 @@ pga2_yw_wx_xy_dot_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
|
|
||||||
c[1] = neg_expr (scale_expr (stype, sa, sb));
|
c[3] = neg_expr (scale_expr (stype, sa, sb));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -825,7 +825,7 @@ pga2_yw_wx_xy_dot_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto wtype = vector_type (stype, 2);
|
auto wtype = vector_type (stype, 2);
|
||||||
auto vtype = vector_type (stype, 3);
|
auto vtype = vector_type (stype, 3);
|
||||||
auto dot_type = algebra_mvec_type (alg, 0x04);
|
auto dot_type = algebra_mvec_type (alg, 0x01);
|
||||||
auto va = offset_cast (wtype, a, 0);
|
auto va = offset_cast (wtype, a, 0);
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto vb = offset_cast (wtype, b, 0);
|
auto vb = offset_cast (wtype, b, 0);
|
||||||
|
@ -833,7 +833,7 @@ pga2_yw_wx_xy_dot_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto cs = wedge_expr (stype, vb, va);
|
auto cs = wedge_expr (stype, vb, va);
|
||||||
cv = ext_expr (scale_expr (wtype, cv, sa), vtype, 0, false);
|
cv = ext_expr (scale_expr (wtype, cv, sa), vtype, 0, false);
|
||||||
cs = ext_expr (cs, dot_type, 0, true);
|
cs = ext_expr (cs, dot_type, 0, true);
|
||||||
c[2] = sum_expr (dot_type, cv, cs);
|
c[0] = sum_expr (dot_type, cv, cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -843,7 +843,7 @@ pga2_yw_wx_xy_dot_wxy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto sb = offset_cast (stype, b, 0);
|
auto sb = offset_cast (stype, b, 0);
|
||||||
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
||||||
c[0] = ext_expr (cs, algebra_mvec_type (alg, 0x01), 0, true);
|
c[2] = ext_expr (cs, algebra_mvec_type (alg, 0x04), 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -851,7 +851,7 @@ pga2_x_y_w_dot_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto wtype = vector_type (stype, 2);
|
auto wtype = vector_type (stype, 2);
|
||||||
auto dot_type = algebra_mvec_type (alg, 0x04);
|
auto dot_type = algebra_mvec_type (alg, 0x01);
|
||||||
auto va = offset_cast (wtype, a, 0);
|
auto va = offset_cast (wtype, a, 0);
|
||||||
auto vb = offset_cast (wtype, b, 0);
|
auto vb = offset_cast (wtype, b, 0);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
|
@ -859,7 +859,7 @@ pga2_x_y_w_dot_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto cs = wedge_expr (stype, vb, va);
|
auto cs = wedge_expr (stype, vb, va);
|
||||||
cv = ext_expr (cv, dot_type, 0, false);
|
cv = ext_expr (cv, dot_type, 0, false);
|
||||||
cs = ext_expr (cs, dot_type, 0, true);
|
cs = ext_expr (cs, dot_type, 0, true);
|
||||||
c[2] = sum_expr (dot_type, cs, cv);
|
c[0] = sum_expr (dot_type, cs, cv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -870,7 +870,7 @@ pga2_x_y_w_dot_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto va = offset_cast (vtype, a, 0);
|
auto va = offset_cast (vtype, a, 0);
|
||||||
auto vb = offset_cast (vtype, b, 0);
|
auto vb = offset_cast (vtype, b, 0);
|
||||||
auto cs = dot_expr (stype, va, vb);
|
auto cs = dot_expr (stype, va, vb);
|
||||||
c[1] = cs;
|
c[3] = cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -878,11 +878,11 @@ pga2_x_y_w_dot_wxy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 2);
|
auto vtype = vector_type (stype, 2);
|
||||||
auto dot_type = algebra_mvec_type (alg, 0x01);
|
auto dot_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto va = offset_cast (vtype, a, 0);
|
auto va = offset_cast (vtype, a, 0);
|
||||||
auto cv = scale_expr (vtype, va, b);
|
auto cv = scale_expr (vtype, va, b);
|
||||||
|
|
||||||
c[0] = ext_expr (cv, dot_type, 0, false);
|
c[2] = ext_expr (cv, dot_type, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -892,7 +892,7 @@ pga2_wxy_dot_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto sa = offset_cast (stype, a, 0);
|
auto sa = offset_cast (stype, a, 0);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
||||||
c[0] = ext_expr (cs, algebra_mvec_type (alg, 0x01), 0, true);
|
c[2] = ext_expr (cs, algebra_mvec_type (alg, 0x04), 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -900,34 +900,37 @@ pga2_wxy_dot_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 2);
|
auto vtype = vector_type (stype, 2);
|
||||||
auto dot_type = algebra_mvec_type (alg, 0x01);
|
auto dot_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto sa = offset_cast (stype, a, 0);
|
auto sa = offset_cast (stype, a, 0);
|
||||||
auto vb = offset_cast (vtype, b, 0);
|
auto vb = offset_cast (vtype, b, 0);
|
||||||
auto cv = scale_expr (vtype, vb, sa);
|
auto cv = scale_expr (vtype, vb, sa);
|
||||||
c[0] = ext_expr (cv, dot_type, 0, false);
|
c[2] = ext_expr (cv, dot_type, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pga_func pga2_dot_funcs[4][4] = {
|
static pga_func pga2_dot_funcs[4][4] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
[0] = pga2_yw_wx_xy_dot_yw_wx_xy,
|
[0] = pga2_x_y_w_dot_x_y_w,
|
||||||
[2] = pga2_yw_wx_xy_dot_x_y_w,
|
[1] = pga2_x_y_w_dot_wxy,
|
||||||
[3] = pga2_yw_wx_xy_dot_wxy,
|
[2] = pga2_x_y_w_dot_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
|
[0] = pga2_wxy_dot_x_y_w,
|
||||||
|
[2] = pga2_wxy_dot_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
[0] = pga2_yw_wx_xy_dot_x_y_w,
|
||||||
|
[1] = pga2_yw_wx_xy_dot_wxy,
|
||||||
|
[2] = pga2_yw_wx_xy_dot_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
[0] = scale_component,
|
[0] = scale_component,
|
||||||
[1] = scale_component,
|
[1] = scale_component,
|
||||||
[2] = scale_component,
|
[2] = scale_component,
|
||||||
[3] = scale_component,
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[2] = {
|
|
||||||
[0] = pga2_x_y_w_dot_yw_wx_xy,
|
|
||||||
[2] = pga2_x_y_w_dot_x_y_w,
|
|
||||||
[3] = pga2_x_y_w_dot_wxy,
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
[0] = pga2_wxy_dot_yw_wx_xy,
|
|
||||||
[2] = pga2_wxy_dot_x_y_w,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1204,35 +1207,35 @@ static pga_func pga3_wedge_funcs[6][6] = {
|
||||||
static void
|
static void
|
||||||
pga2_yw_wx_xy_wedge_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
pga2_yw_wx_xy_wedge_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
c[3] = dot_expr (algebra_mvec_type (alg, 0x08), a, b);
|
c[1] = dot_expr (algebra_mvec_type (alg, 0x02), a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pga2_x_y_w_wedge_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
pga2_x_y_w_wedge_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto wedge_type = algebra_mvec_type (alg, 0x01);
|
auto wedge_type = algebra_mvec_type (alg, 0x04);
|
||||||
c[0] = cross_expr (wedge_type, a, b);
|
c[2] = cross_expr (wedge_type, a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pga_func pga2_wedge_funcs[4][4] = {
|
static pga_func pga2_wedge_funcs[4][4] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
[1] = scale_component,
|
[0] = pga2_x_y_w_wedge_x_y_w,
|
||||||
[2] = pga2_yw_wx_xy_wedge_x_y_w,
|
[2] = pga2_x_y_w_wedge_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
[0] = pga2_yw_wx_xy_wedge_x_y_w,
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
[0] = scale_component,
|
[0] = scale_component,
|
||||||
[1] = scale_component,
|
[1] = scale_component,
|
||||||
[2] = scale_component,
|
[2] = scale_component,
|
||||||
[3] = scale_component,
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[2] = {
|
|
||||||
[0] = pga2_x_y_w_wedge_yw_wx_xy,
|
|
||||||
[1] = scale_component,
|
|
||||||
[2] = pga2_x_y_w_wedge_x_y_w,
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
[1] = scale_component,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1654,13 +1657,13 @@ pga2_yw_wx_xy_geom_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 3);
|
auto vtype = vector_type (stype, 3);
|
||||||
auto ctype = vector_type (stype, 2);
|
auto ctype = vector_type (stype, 2);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x01);
|
auto geom_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
auto cv = alias_expr (ctype, cross_expr (vtype, b, a), 0);
|
auto cv = alias_expr (ctype, cross_expr (vtype, b, a), 0);
|
||||||
|
|
||||||
c[0] = ext_expr (cv, geom_type, 0, false);
|
c[2] = ext_expr (cv, geom_type, 0, false);
|
||||||
c[1] = neg_expr (scale_expr (algebra_mvec_type (alg, 0x02), sa, sb));
|
c[3] = neg_expr (scale_expr (algebra_mvec_type (alg, 0x08), sa, sb));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1669,7 +1672,7 @@ pga2_yw_wx_xy_geom_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto wtype = vector_type (stype, 2);
|
auto wtype = vector_type (stype, 2);
|
||||||
auto vtype = vector_type (stype, 3);
|
auto vtype = vector_type (stype, 3);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x04);
|
auto geom_type = algebra_mvec_type (alg, 0x01);
|
||||||
auto va = offset_cast (wtype, a, 0);
|
auto va = offset_cast (wtype, a, 0);
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto vb = offset_cast (wtype, b, 0);
|
auto vb = offset_cast (wtype, b, 0);
|
||||||
|
@ -1677,8 +1680,8 @@ pga2_yw_wx_xy_geom_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto cs = wedge_expr (stype, vb, va);
|
auto cs = wedge_expr (stype, vb, va);
|
||||||
cs = ext_expr (cs, geom_type, 0, true);
|
cs = ext_expr (cs, geom_type, 0, true);
|
||||||
cv = ext_expr (scale_expr (wtype, cv, sa), vtype, 0, false);
|
cv = ext_expr (scale_expr (wtype, cv, sa), vtype, 0, false);
|
||||||
c[2] = sum_expr (geom_type, cv, cs);
|
c[0] = sum_expr (geom_type, cv, cs);
|
||||||
c[3] = dot_expr (algebra_mvec_type (alg, 0x08), a, b);
|
c[1] = dot_expr (algebra_mvec_type (alg, 0x02), a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1688,7 +1691,7 @@ pga2_yw_wx_xy_geom_wxy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto sa = offset_cast (stype, a, 2);
|
auto sa = offset_cast (stype, a, 2);
|
||||||
auto sb = offset_cast (stype, b, 0);
|
auto sb = offset_cast (stype, b, 0);
|
||||||
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
||||||
c[0] = ext_expr (cs, algebra_mvec_type (alg, 0x01), 0, true);
|
c[2] = ext_expr (cs, algebra_mvec_type (alg, 0x04), 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1697,7 +1700,7 @@ pga2_x_y_w_geom_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto wtype = vector_type (stype, 2);
|
auto wtype = vector_type (stype, 2);
|
||||||
auto vtype = vector_type (stype, 3);
|
auto vtype = vector_type (stype, 3);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x04);
|
auto geom_type = algebra_mvec_type (alg, 0x01);
|
||||||
auto va = offset_cast (wtype, a, 0);
|
auto va = offset_cast (wtype, a, 0);
|
||||||
auto vb = offset_cast (wtype, b, 0);
|
auto vb = offset_cast (wtype, b, 0);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
|
@ -1705,8 +1708,8 @@ pga2_x_y_w_geom_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto cs = wedge_expr (stype, vb, va);
|
auto cs = wedge_expr (stype, vb, va);
|
||||||
cs = ext_expr (cs, geom_type, 0, true);
|
cs = ext_expr (cs, geom_type, 0, true);
|
||||||
cv = ext_expr (scale_expr (wtype, cv, sb), vtype, 0, false);
|
cv = ext_expr (scale_expr (wtype, cv, sb), vtype, 0, false);
|
||||||
c[2] = sum_expr (geom_type, cv, cs);
|
c[0] = sum_expr (geom_type, cv, cs);
|
||||||
c[3] = dot_expr (algebra_mvec_type (alg, 0x08), a, b);
|
c[1] = dot_expr (algebra_mvec_type (alg, 0x02), a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1714,11 +1717,11 @@ pga2_x_y_w_geom_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 2);
|
auto vtype = vector_type (stype, 2);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x01);
|
auto geom_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto va = offset_cast (vtype, a, 0);
|
auto va = offset_cast (vtype, a, 0);
|
||||||
auto vb = offset_cast (vtype, b, 0);
|
auto vb = offset_cast (vtype, b, 0);
|
||||||
c[1] = dot_expr (stype, va, vb);
|
c[3] = dot_expr (stype, va, vb);
|
||||||
c[0] = cross_expr (geom_type, a, b);
|
c[2] = cross_expr (geom_type, a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1726,11 +1729,11 @@ pga2_x_y_w_geom_wxy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 2);
|
auto vtype = vector_type (stype, 2);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x01);
|
auto geom_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto va = offset_cast (vtype, a, 0);
|
auto va = offset_cast (vtype, a, 0);
|
||||||
auto cv = scale_expr (vtype, va, b);
|
auto cv = scale_expr (vtype, va, b);
|
||||||
|
|
||||||
c[0] = ext_expr (cv, geom_type, 0, false);
|
c[2] = ext_expr (cv, geom_type, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1740,7 +1743,7 @@ pga2_wxy_geom_yw_wx_xy (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
auto sa = offset_cast (stype, a, 0);
|
auto sa = offset_cast (stype, a, 0);
|
||||||
auto sb = offset_cast (stype, b, 2);
|
auto sb = offset_cast (stype, b, 2);
|
||||||
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
auto cs = neg_expr (scale_expr (stype, sa, sb));
|
||||||
c[0] = ext_expr (cs, algebra_mvec_type (alg, 0x01), 0, true);
|
c[2] = ext_expr (cs, algebra_mvec_type (alg, 0x04), 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1748,37 +1751,37 @@ pga2_wxy_geom_x_y_w (expr_t **c, expr_t *a, expr_t *b, algebra_t *alg)
|
||||||
{
|
{
|
||||||
auto stype = alg->type;
|
auto stype = alg->type;
|
||||||
auto vtype = vector_type (stype, 2);
|
auto vtype = vector_type (stype, 2);
|
||||||
auto geom_type = algebra_mvec_type (alg, 0x01);
|
auto geom_type = algebra_mvec_type (alg, 0x04);
|
||||||
auto vb = offset_cast (vtype, b, 0);
|
auto vb = offset_cast (vtype, b, 0);
|
||||||
auto cv = scale_expr (vtype, vb, a);
|
auto cv = scale_expr (vtype, vb, a);
|
||||||
|
|
||||||
c[0] = ext_expr (cv, geom_type, 0, false);
|
c[2] = ext_expr (cv, geom_type, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pga_func pga2_geometric_funcs[6][6] = {
|
static pga_func pga2_geometric_funcs[6][6] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
[0] = pga2_yw_wx_xy_geom_yw_wx_xy,
|
[0] = pga2_x_y_w_geom_x_y_w,
|
||||||
[1] = scale_component,
|
[1] = pga2_x_y_w_geom_wxy,
|
||||||
[2] = pga2_yw_wx_xy_geom_x_y_w,
|
[2] = pga2_x_y_w_geom_yw_wx_xy,
|
||||||
[3] = pga2_yw_wx_xy_geom_wxy,
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
|
[0] = pga2_wxy_geom_x_y_w,
|
||||||
|
[2] = pga2_wxy_geom_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
[0] = pga2_yw_wx_xy_geom_x_y_w,
|
||||||
|
[1] = pga2_yw_wx_xy_geom_wxy,
|
||||||
|
[2] = pga2_yw_wx_xy_geom_yw_wx_xy,
|
||||||
|
[3] = scale_component,
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
[0] = scale_component,
|
[0] = scale_component,
|
||||||
[1] = scale_component,
|
[1] = scale_component,
|
||||||
[2] = scale_component,
|
[2] = scale_component,
|
||||||
[3] = scale_component,
|
[3] = scale_component,
|
||||||
},
|
},
|
||||||
[2] = {
|
|
||||||
[0] = pga2_x_y_w_geom_yw_wx_xy,
|
|
||||||
[1] = scale_component,
|
|
||||||
[2] = pga2_x_y_w_geom_x_y_w,
|
|
||||||
[3] = pga2_x_y_w_geom_wxy,
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
[0] = pga2_wxy_geom_yw_wx_xy,
|
|
||||||
[1] = scale_component,
|
|
||||||
[2] = pga2_wxy_geom_x_y_w,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#include "test-harness.h"
|
#include "test-harness.h"
|
||||||
#pragma warn no-vararg-integer
|
#pragma warn no-vararg-integer
|
||||||
typedef @algebra(double(2,0,1)) PGA;
|
typedef @algebra(double(2,0,1)) PGA;
|
||||||
typedef PGA.group_mask(0x02) scalar_t;
|
typedef PGA.group_mask(0x08) scalar_t;
|
||||||
typedef PGA.group_mask(0x04) vector_t;
|
typedef PGA.group_mask(0x01) vector_t;
|
||||||
typedef PGA.group_mask(0x01) bivector_t;
|
typedef PGA.group_mask(0x04) bivector_t;
|
||||||
typedef PGA.group_mask(0x08) trivector_t;
|
typedef PGA.group_mask(0x02) trivector_t;
|
||||||
typedef union {
|
typedef union {
|
||||||
PGA.group_mask(0x03) mvec;
|
PGA.group_mask(0x0c) mvec;
|
||||||
struct {
|
struct {
|
||||||
bivector_t bvec;
|
bivector_t bvec;
|
||||||
scalar_t scalar;
|
scalar_t scalar;
|
||||||
};
|
};
|
||||||
} evengrades_t;
|
} evengrades_t;
|
||||||
typedef union {
|
typedef union {
|
||||||
PGA.group_mask(0x0c) mvec;
|
PGA.group_mask(0x03) mvec;
|
||||||
struct {
|
struct {
|
||||||
vector_t vec;
|
vector_t vec;
|
||||||
trivector_t tvec;
|
trivector_t tvec;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue