Closed lukehutch closed 3 years ago
This would be the code...
double Axx = A.m00 * x.x + A.m10 * x.y + A.m20 * x.z;
double Axy = A.m01 * x.x + A.m11 * x.y + A.m21 * x.z;
double Axz = A.m02 * x.x + A.m12 * x.y + A.m22 * x.z;
double xTAx = x.x * Axx + x.y * Axy + x.z * Axz;
I have been trying to figure out what x^T A x
is actually called -- maybe the "quadratic form product", since it is used in quadratic forms?
It doesn't hurt to create a PR, It would make reviewing the code easier. this doesn't seem too bad.
@pollend I just spent an hour trying to build JOML in Eclipse, unsuccessfully. After inserting <?m2e execute?>
directives after the <execution>
tags of all plugins that do not support lifecycle management in m2e, I get numerous errors about unsupported classes, because the build was defaulting to JDK 1.6 or similar. I manually upgraded the <maven.compiler.source>
and <maven.compiler.target>
versions to 14
(so that, for example, Math.fma
was available). However, classes that use new modularized packages, e.g. java.io.Externalizable
, break with the error, The package java.io is accessible from more than one module: <unnamed>, java.base
. This seems to indicate that JOML is being built in an unnamed module, so the module descriptor is not being found.
Any tips on building this in Eclipse, please?
hmm, I've found the maven setup to be kind of fiddly. I am using intellij and it seems to work find just importing the project as is. It doesn't quite like intellij either. I don't think I did anything particularly drastic though. can you build it using ./mvnw at least just to verify.
And that's it. JOML is NOT a Jigsaw Module-enabled project!
@lukehutch @httpdigest what the status on this and is it still relevant to add to JOML?
Yes, it's very relevant, this computation is the basis for quadratic forms. However I am extremely busy on my own project right now, and haven't had time to work on this.
Hey @lukehutch I've added the method quadraticFormProduct
with your implementation to the Matrix3 classes.
Thank you!
I can't find a method for calculating (x^T A x) given vector x and matrix A (e.g. for computing a quadratic form).
I think the code for this should be the following -- is this correct?
however this could be computed more efficiently in a single method call.
Related issue: I think I mentioned this once before, but
x.mul(A)
looks backwards -- I would have preferred this to be calledx.premul(A)
or something. Even better, it would be great if there were a methodA.mul(x)
to preserve the order.