public void set(double i, double j, double k, double l, double m, double n, double o, double p, double q) { // v[0] = i; v[1] = j; v[2] = k; // v[4] = l; v[5] = m; v[6] = n; // v[8] = o; v[9] = p; v[10] = q; set00( i ); set01( j ); set02( k ); set10( l ); set11( m ); set12( n ); set20( o ); set21( p ); set22( q ); } /**
public void set(double i, double j, double k, double l, double m, double n, double o, double p, double q) { // v[0] = i; v[1] = j; v[2] = k; // v[4] = l; v[5] = m; v[6] = n; // v[8] = o; v[9] = p; v[10] = q; set00( i ); set01( j ); set02( k ); set10( l ); set11( m ); set12( n ); set20( o ); set21( p ); set22( q ); } /**
/** * For +1/-1 use dSetCrossMatrixPlus(), for -1/+1 use dSetCrossMatrixMinus(). * @param A A * @param a a * @param skip skip * @param plus plus * @param minus minus * @deprecated */ @Deprecated public static void dCROSSMAT(DMatrix3 A, DVector3C a, int skip, int plus, int minus) { A.set01( minus * a.get2() ); A.set02( plus * a.get1() ); A.set10( plus * a.get2() ); A.set12( minus * a.get0() ); A.set20( minus * a.get1() ); A.set21( plus * a.get0() ); }
/** * For +1/-1 use dSetCrossMatrixPlus(), for -1/+1 use dSetCrossMatrixMinus(). * @param A A * @param a a * @param skip skip * @param plus plus * @param minus minus * @deprecated */ @Deprecated public static void dCROSSMAT(DMatrix3 A, DVector3C a, int skip, int plus, int minus) { A.set01( minus * a.get2() ); A.set02( plus * a.get1() ); A.set10( plus * a.get2() ); A.set12( minus * a.get0() ); A.set20( minus * a.get1() ); A.set21( plus * a.get0() ); }
private void transpose3x3 (DMatrix3 A) { double tmp; tmp=A.get10(); A.set10( A.get01() ); A.set01( tmp ); tmp=A.get20(); A.set20( A.get02() ); A.set02( tmp ); tmp=A.get21(); A.set21( A.get12() ); A.set12( tmp ); }
/** * Transpose this matrix. * @return This matrix. */ public final DMatrix3 eqTranspose() { double t; t = get01(); set01( get10() ); set10( t ); t = get02(); set02( get20() ); set20( t ); t = get21(); set21( get12() ); set12( t ); return this; }
/** * Transpose this matrix. * @return This matrix. */ public final DMatrix3 eqTranspose() { double t; t = get01(); set01( get10() ); set10( t ); t = get02(); set02( get20() ); set20( t ); t = get21(); set21( get12() ); set12( t ); return this; }
/** * Set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b. * The matrix is assumed to be already zero, so this does not write zero elements! * A positive version will be written. * @param A A * @param a a */ public static void dSetCrossMatrixPlus(DMatrix3 A, DVector3C a) { A.set01( -a.get2() ); A.set02( +a.get1() ); A.set10( +a.get2() ); A.set12( -a.get0() ); A.set20( -a.get1() ); A.set21( +a.get0() ); }
/** * Set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b. * The matrix is assumed to be already zero, so this does not write zero elements! * A negative version will be written. * @param A A * @param a a */ public static void dSetCrossMatrixMinus(DMatrix3 A, DVector3C a) { A.set01( +a.get2() ); A.set02( -a.get1() ); A.set10( -a.get2() ); A.set12( +a.get0() ); A.set20( +a.get1() ); A.set21( -a.get0() ); } /**
/** * Set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b. * The matrix is assumed to be already zero, so this does not write zero elements! * A positive version will be written. * @param A A * @param a a */ public static void dSetCrossMatrixPlus(DMatrix3 A, DVector3C a) { A.set01( -a.get2() ); A.set02( +a.get1() ); A.set10( +a.get2() ); A.set12( -a.get0() ); A.set20( -a.get1() ); A.set21( +a.get0() ); }
/** * Set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b. * The matrix is assumed to be already zero, so this does not write zero elements! * A negative version will be written. * @param A A * @param a a */ public static void dSetCrossMatrixMinus(DMatrix3 A, DVector3C a) { A.set01( +a.get2() ); A.set02( -a.get1() ); A.set10( -a.get2() ); A.set12( +a.get0() ); A.set20( +a.get1() ); A.set21( -a.get0() ); } /**
private void matrixInvert(final DMatrix3C inMat, DMatrix3 outMat) { // memcpy(outMat, inMat, sizeof(dMatrix3)); outMat.set(inMat); //TZ unused: dMatrix3 dummy = new dMatrix3(); double x; // swap _12 and _21 //myswap(outMat[0 + 4*1], outMat[1 + 4*0]); x = outMat.get10();//v[0 + 4*1]; outMat.set10( outMat.get01() );//v[0 + 4*1] = outMat.v[1 + 4*0]; outMat.set01( x );//v[1 + 4*0] = x; // swap _31 and _13 //myswap(outMat[2 + 4*0], outMat[0 + 4*2]); //x = outMat.v[2 + 4*0]; outMat.v[2 + 4*0] = outMat.v[0 + 4*2]; outMat.v[0 + 4*2] = x; x = outMat.get02(); outMat.set02( outMat.get20() ); outMat.set20( x ); // swap _23 and _32 //myswap(outMat[1 + 4*2], outMat[2 + 4*1]); //x = outMat.v[1 + 4*2]; outMat.v[1 + 4*2] = outMat.v[2 + 4*1]; outMat.v[2 + 4*1] = x; x = outMat.get21(); outMat.set21( outMat.get12() ); outMat.set12( x ); }
private static void dMULTIPLYOP1_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) { A.set00( dCalcVectorDot3_44(B,0,C,0) ); A.set01( dCalcVectorDot3_44(B,0,C,1) ); A.set02( dCalcVectorDot3_44(B,0,C,2) ); A.set10( dCalcVectorDot3_44(B,1,C,0) ); A.set11( dCalcVectorDot3_44(B,1,C,1) ); A.set12( dCalcVectorDot3_44(B,1,C,2) ); A.set20( dCalcVectorDot3_44(B,2,C,0) ); A.set21( dCalcVectorDot3_44(B,2,C,1) ); A.set22( dCalcVectorDot3_44(B,2,C,2) ); } private static void dMULTIPLYOP2_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) {
public DMatrix3 set(DMatrix3C m) { // System.arraycopy(((DMatrix3)m3).v, 0, v, 0, v.length); // //v[0] = v3.v[0]; v[1] = v3.v[1]; v[2] = v3.v[2]; v[3] = v3.v[3]; set00( m.get00() ); set01( m.get01() ); set02( m.get02() ); set10( m.get10() ); set11( m.get11() ); set12( m.get12() ); set20( m.get20() ); set21( m.get21() ); set22( m.get22() ); return this; }
private static void dMULTIPLYOP0_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) { A.set00( B.dotRowCol(0, C, 0) );//(A).v[0] = dDOT14(B.v,0,C.v,0); A.set01( B.dotRowCol(0, C, 1) );//(A).v[1] = dDOT14(B.v,0,C.v,1); A.set02( B.dotRowCol(0, C, 2) );//(A).v[2] = dDOT14(B.v,0,C.v,2); A.set10( B.dotRowCol(1, C, 0) );//(A).v[4] = dDOT14(B.v,4,C.v,0); A.set11( B.dotRowCol(1, C, 1) );//(A).v[5] = dDOT14(B.v,4,C.v,1); A.set12( B.dotRowCol(1, C, 2) );//(A).v[6] = dDOT14(B.v,4,C.v,2); A.set20( B.dotRowCol(2, C, 0) );//(A).v[8] = dDOT14(B.v,8,C.v,0); A.set21( B.dotRowCol(2, C, 1) );//(A).v[9] = dDOT14(B.v,8,C.v,1); A.set22( B.dotRowCol(2, C, 2) );//(A).v[10] = dDOT14(B.v,8,C.v,2); } private static void dMULTIPLYOP1_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) {
private static void dMULTIPLYOP1_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) { A.set00( dCalcVectorDot3_44(B,0,C,0) ); A.set01( dCalcVectorDot3_44(B,0,C,1) ); A.set02( dCalcVectorDot3_44(B,0,C,2) ); A.set10( dCalcVectorDot3_44(B,1,C,0) ); A.set11( dCalcVectorDot3_44(B,1,C,1) ); A.set12( dCalcVectorDot3_44(B,1,C,2) ); A.set20( dCalcVectorDot3_44(B,2,C,0) ); A.set21( dCalcVectorDot3_44(B,2,C,1) ); A.set22( dCalcVectorDot3_44(B,2,C,2) ); } private static void dMULTIPLYOP2_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) {
public DMatrix3 set(DMatrix3C m) { // System.arraycopy(((DMatrix3)m3).v, 0, v, 0, v.length); // //v[0] = v3.v[0]; v[1] = v3.v[1]; v[2] = v3.v[2]; v[3] = v3.v[3]; set00( m.get00() ); set01( m.get01() ); set02( m.get02() ); set10( m.get10() ); set11( m.get11() ); set12( m.get12() ); set20( m.get20() ); set21( m.get21() ); set22( m.get22() ); return this; }
private static void dMULTIPLYOP0_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) { A.set00( B.dotRowCol(0, C, 0) );//(A).v[0] = dDOT14(B.v,0,C.v,0); A.set01( B.dotRowCol(0, C, 1) );//(A).v[1] = dDOT14(B.v,0,C.v,1); A.set02( B.dotRowCol(0, C, 2) );//(A).v[2] = dDOT14(B.v,0,C.v,2); A.set10( B.dotRowCol(1, C, 0) );//(A).v[4] = dDOT14(B.v,4,C.v,0); A.set11( B.dotRowCol(1, C, 1) );//(A).v[5] = dDOT14(B.v,4,C.v,1); A.set12( B.dotRowCol(1, C, 2) );//(A).v[6] = dDOT14(B.v,4,C.v,2); A.set20( B.dotRowCol(2, C, 0) );//(A).v[8] = dDOT14(B.v,8,C.v,0); A.set21( B.dotRowCol(2, C, 1) );//(A).v[9] = dDOT14(B.v,8,C.v,1); A.set22( B.dotRowCol(2, C, 2) );//(A).v[10] = dDOT14(B.v,8,C.v,2); } private static void dMULTIPLYOP1_333(DMatrix3 A, DMatrix3C B, DMatrix3C C) {
public DMatrix3 add(DMatrix3C m) { set00( get00() + m.get00() ); set01( get01() + m.get01() ); set02( get02() + m.get02() ); set10( get10() + m.get10() ); set11( get11() + m.get11() ); set12( get12() + m.get12() ); set20( get20() + m.get20() ); set21( get21() + m.get21() ); set22( get22() + m.get22() ); // DMatrix3 M = (DMatrix3) M2; // for (int i = 0; i < v.length; i++) { // v[i] += M.v[i]; // } return this; }
public DMatrix3 add(DMatrix3C m) { set00( get00() + m.get00() ); set01( get01() + m.get01() ); set02( get02() + m.get02() ); set10( get10() + m.get10() ); set11( get11() + m.get11() ); set12( get12() + m.get12() ); set20( get20() + m.get20() ); set21( get21() + m.get21() ); set22( get22() + m.get22() ); // DMatrix3 M = (DMatrix3) M2; // for (int i = 0; i < v.length; i++) { // v[i] += M.v[i]; // } return this; }