mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 12:31:10 +00:00
[qfcc] Implement the regressive product
That went surprisingly well (but it is built up from other ops, so pretty easy, really).
This commit is contained in:
parent
e2d812ab6a
commit
58a1758363
3 changed files with 10 additions and 2 deletions
|
@ -1342,8 +1342,10 @@ geometric_product (expr_t *e1, expr_t *e2)
|
|||
static expr_t *
|
||||
regressive_product (expr_t *e1, expr_t *e2)
|
||||
{
|
||||
notice (e1, "not implemented");
|
||||
return 0;
|
||||
auto a = algebra_dual (e1);
|
||||
auto b = algebra_dual (e2);
|
||||
auto c = outer_product (a, b);
|
||||
return algebra_dual (c);
|
||||
}
|
||||
|
||||
static expr_t *
|
||||
|
|
|
@ -1773,6 +1773,7 @@ expr
|
|||
| expr CROSS expr { $$ = binary_expr (CROSS, $1, $3); }
|
||||
| expr DOT expr { $$ = binary_expr (DOT, $1, $3); }
|
||||
| expr WEDGE expr { $$ = binary_expr (WEDGE, $1, $3); }
|
||||
| expr REGRESSIVE expr { $$ = binary_expr (REGRESSIVE, $1, $3); }
|
||||
;
|
||||
|
||||
texpr
|
||||
|
|
|
@ -265,5 +265,10 @@ main (void)
|
|||
s.scalar, s.bvec);
|
||||
return 1;
|
||||
}
|
||||
auto line = bvec ∨ bvecb;
|
||||
if ((dvec3)line != '-11 8 34'd) {
|
||||
printf ("bvec ∨ bvecb != '-11 8 34': %lv\n", line);
|
||||
return 1;
|
||||
}
|
||||
return 0; // to survive and prevail :)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue