void constructMatrix(DMatrixRMaj L) {
		L.reshape(cameras.size*eqs,10);

		// Known aspect ratio constraint makes more sense as a square
		double RR = this.aspectRatio *this.aspectRatio;

		// F = P*Q*P'
		// F is an arbitrary variable name and not fundamental matrix
		int index = 0;
		for (int i = 0; i < cameras.size; i++) {
			Projective P = cameras.get(i);
			DMatrix3x3 A = P.A;
			DMatrix3 B = P.a;

			// hard to tell if this helped or hurt. Keeping commented out for future investigation on proper scaling
//			double scale = NormOps_DDF3.normF(P.A);
//			CommonOps_DDF3.divide(P.A,scale);
//			CommonOps_DDF3.divide(P.a,scale);

			// constraint for a zero principle point

			// row for F[0,2] == 0
			L.data[index++] = A.a11*A.a31;
			L.data[index++] = (A.a12*A.a31 + A.a11*A.a32);
			L.data[index++] = (A.a13*A.a31 + A.a11*A.a33);
			L.data[index++] = (B.a1*A.a31 + A.a11*B.a3);
			L.data[index++] = A.a12*A.a32;
			L.data[index++] = (A.a13*A.a32 + A.a12*A.a33);
			L.data[index++] = (B.a1*A.a32 + A.a12*B.a3);
			L.data[index++] = A.a13*A.a33;
			L.data[index++] = (B.a1*A.a33 + A.a13*B.a3);
			L.data[index++] = B.a1*B.a3;

			// row for F[1,2] == 0
			L.data[index++] = A.a21*A.a31;
			L.data[index++] = (A.a22*A.a31 + A.a21*A.a32);
			L.data[index++] = (A.a23*A.a31 + A.a21*A.a33);
			L.data[index++] = (B.a2*A.a31 + A.a21*B.a3);
			L.data[index++] = A.a22*A.a32;
			L.data[index++] = (A.a23*A.a32 + A.a22*A.a33);
			L.data[index++] = (B.a2*A.a32 + A.a22*B.a3);
			L.data[index++] = A.a23*A.a33;
			L.data[index++] = (B.a2*A.a33 + A.a23*B.a3);
			L.data[index++] = B.a2*B.a3;

			if( zeroSkew ) {
				// row for F[0,1] == 0
				L.data[index++] = A.a11*A.a21;
				L.data[index++] = (A.a12*A.a21 + A.a11*A.a22);
				L.data[index++] = (A.a13*A.a21 + A.a11*A.a23);
				L.data[index++] = (B.a1*A.a21 + A.a11*B.a2);
				L.data[index++] = A.a12*A.a22;
				L.data[index++] = (A.a13*A.a22 + A.a12*A.a23);
				L.data[index++] = (B.a1*A.a22 + A.a12*B.a2);
				L.data[index++] = A.a13*A.a23;
				L.data[index++] = (B.a1*A.a23 + A.a13*B.a2);
				L.data[index++] = B.a1*B.a2;
			}

			if( knownAspect ) {
				// aspect^2*F[0,0]-F[1,1]
				L.data[index++] = A.a11*A.a11*RR - A.a21*A.a21;
				L.data[index++] = 2*(A.a11*A.a12*RR - A.a21*A.a22);
				L.data[index++] = 2*(A.a11*A.a13*RR - A.a21*A.a23);
				L.data[index++] = 2*(A.a11*B.a1*RR - A.a21*B.a2);
				L.data[index++] = A.a12*A.a12*RR - A.a22*A.a22;
				L.data[index++] = 2*(A.a12*A.a13*RR - A.a22*A.a23);
				L.data[index++] = 2*(A.a12*B.a1*RR - A.a22*B.a2);
				L.data[index++] = A.a13*A.a13*RR - A.a23*A.a23;
				L.data[index++] = 2*(A.a13*B.a1*RR - A.a23*B.a2);
				L.data[index++] = B.a1*B.a1*RR - B.a2*B.a2;
			}
		}
	}
void constructMatrix ( DMatrixRMaj L ) { L . reshape ( cameras . size * eqs , 10 ) ; double RR = this . aspectRatio * this . aspectRatio ; int index = 0 ; for ( int i = 0 ; i < cameras . size ; i ++ ) { Projective P = cameras . get ( i ) ; DMatrix3x3 A = P . A ; DMatrix3 B = P . a ; L . data [ index ++ ] = A . a11 * A . a31 ; L . data [ index ++ ] = ( A . a12 * A . a31 + A . a11 * A . a32 ) ; L . data [ index ++ ] = ( A . a13 * A . a31 + A . a11 * A . a33 ) ; L . data [ index ++ ] = ( B . a1 * A . a31 + A . a11 * B . a3 ) ; L . data [ index ++ ] = A . a12 * A . a32 ; L . data [ index ++ ] = ( A . a13 * A . a32 + A . a12 * A . a33 ) ; L . data [ index ++ ] = ( B . a1 * A . a32 + A . a12 * B . a3 ) ; L . data [ index ++ ] = A . a13 * A . a33 ; L . data [ index ++ ] = ( B . a1 * A . a33 + A . a13 * B . a3 ) ; L . data [ index ++ ] = B . a1 * B . a3 ; L . data [ index ++ ] = A . a21 * A . a31 ; L . data [ index ++ ] = ( A . a22 * A . a31 + A . a21 * A . a32 ) ; L . data [ index ++ ] = ( A . a23 * A . a31 + A . a21 * A . a33 ) ; L . data [ index ++ ] = ( B . a2 * A . a31 + A . a21 * B . a3 ) ; L . data [ index ++ ] = A . a22 * A . a32 ; L . data [ index ++ ] = ( A . a23 * A . a32 + A . a22 * A . a33 ) ; L . data [ index ++ ] = ( B . a2 * A . a32 + A . a22 * B . a3 ) ; L . data [ index ++ ] = A . a23 * A . a33 ; L . data [ index ++ ] = ( B . a2 * A . a33 + A . a23 * B . a3 ) ; L . data [ index ++ ] = B . a2 * B . a3 ; if ( zeroSkew ) { L . data [ index ++ ] = A . a11 * A . a21 ; L . data [ index ++ ] = ( A . a12 * A . a21 + A . a11 * A . a22 ) ; L . data [ index ++ ] = ( A . a13 * A . a21 + A . a11 * A . a23 ) ; L . data [ index ++ ] = ( B . a1 * A . a21 + A . a11 * B . a2 ) ; L . data [ index ++ ] = A . a12 * A . a22 ; L . data [ index ++ ] = ( A . a13 * A . a22 + A . a12 * A . a23 ) ; L . data [ index ++ ] = ( B . a1 * A . a22 + A . a12 * B . a2 ) ; L . data [ index ++ ] = A . a13 * A . a23 ; L . data [ index ++ ] = ( B . a1 * A . a23 + A . a13 * B . a2 ) ; L . data [ index ++ ] = B . a1 * B . a2 ; } if ( knownAspect ) { L . data [ index ++ ] = A . a11 * A . a11 * RR - A . a21 * A . a21 ; L . data [ index ++ ] = 2 * ( A . a11 * A . a12 * RR - A . a21 * A . a22 ) ; L . data [ index ++ ] = 2 * ( A . a11 * A . a13 * RR - A . a21 * A . a23 ) ; L . data [ index ++ ] = 2 * ( A . a11 * B . a1 * RR - A . a21 * B . a2 ) ; L . data [ index ++ ] = A . a12 * A . a12 * RR - A . a22 * A . a22 ; L . data [ index ++ ] = 2 * ( A . a12 * A . a13 * RR - A . a22 * A . a23 ) ; L . data [ index ++ ] = 2 * ( A . a12 * B . a1 * RR - A . a22 * B . a2 ) ; L . data [ index ++ ] = A . a13 * A . a13 * RR - A . a23 * A . a23 ; L . data [ index ++ ] = 2 * ( A . a13 * B . a1 * RR - A . a23 * B . a2 ) ; L . data [ index ++ ] = B . a1 * B . a1 * RR - B . a2 * B . a2 ; } } }
Constructs the linear system by applying specified constraints