29package com.jogamp.opengl.test.junit.math;
31import org.junit.Assert;
33import org.junit.FixMethodOrder;
34import org.junit.runners.MethodSorters;
36import com.jogamp.junit.util.JunitTracer;
37import com.jogamp.math.Matrix4f;
39@FixMethodOrder(MethodSorters.NAME_ASCENDING)
59 71, 386, 5370, 2954 });
63 12557, 893, 748, 1182,
66 1182, 113, 104, 131 });
69 for (
int i = 0; i < 4; i++) {
70 final float ai0=a.
get(i*4+0), ai1=a.
get(i*4+1), ai2=a.
get(i*4+2), ai3=a.
get(i*4+3);
71 d.
set(i*4+0, ai0 * b.
get(0*4+0) + ai1 * b.
get(1*4+0) + ai2 * b.
get(2*4+0) + ai3 * b.
get(3*4+0) );
72 d.
set(i*4+1, ai0 * b.
get(0*4+1) + ai1 * b.
get(1*4+1) + ai2 * b.
get(2*4+1) + ai3 * b.
get(3*4+1) );
73 d.
set(i*4+2, ai0 * b.
get(0*4+2) + ai1 * b.
get(1*4+2) + ai2 * b.
get(2*4+2) + ai3 * b.
get(3*4+2) );
74 d.
set(i*4+3, ai0 * b.
get(0*4+3) + ai1 * b.
get(1*4+3) + ai2 * b.
get(2*4+3) + ai3 * b.
get(3*4+3) );
82 Assert.assertEquals(m1xm2, r);
89 Assert.assertEquals(m2xm1, r);
96 multMatrixf_RM(m1, m2, r1);
97 Assert.assertEquals(m2xm1, r1);
100 Assert.assertEquals(m2xm1, r1);
107 multMatrixf_RM(m2, m1, r1);
108 Assert.assertEquals(m1xm2, r1);
111 Assert.assertEquals(m1xm2, r1);
114 public static void main(
final String args[]) {
Basic 4x4 float matrix implementation using fields for intensive use-cases (host operations).
final Matrix4f mul(final Matrix4f b)
Multiply matrix: [this] = [this] x [b].
final Matrix4f transpose()
Transpose this matrix.
float get(final int i)
Gets the ith component, 0 <= i < 16.
void set(final int i, final float v)
Sets the ith component with float v 0 <= i < 16.
static void main(final String args[])
static final void multMatrixf_RM(final Matrix4f a, final Matrix4f b, final Matrix4f d)