protected static void constructM ( List < Point2D_F64 > obsPts , DMatrixRMaj alphas , DMatrixRMaj M ) { int N = obsPts . size ( ) ; M . reshape ( 3 * alphas . numCols , 2 * N , false ) ; for ( int i = 0 ; i < N ; i ++ ) { Point2D_F64 p2 = obsPts . get ( i ) ; int row = i * 2 ; for ( int j = 0 ; j < alphas . numCols ; j ++ ) { int col = j * 3 ; double alpha = alphas . unsafe_get ( i , j ) ; M . unsafe_set ( col , row , alpha ) ; M . unsafe_set ( col + 1 , row , 0 ) ; M . unsafe_set ( col + 2 , row , - alpha * p2 . x ) ; M . unsafe_set ( col , row + 1 , 0 ) ; M . unsafe_set ( col + 1 , row + 1 , alpha ) ; M . unsafe_set ( col + 2 , row + 1 , - alpha * p2 . y ) ; } } }
Constructs the linear system which is to be solved .