#*****************************************************************************80 # ## lumatrix_test tests lumatrix. # # Licensing: # # Copyright 2016 James P. Howard, II # # The computer code and data files on this web page are distributed under # https://opensource.org/licenses/BSD-2-Clause, the BSD-2-Clause license. # # Modified: # # 14 February 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "lumatrix_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " lumatrix(A) computes the Lower-Upper (LU) factorization of a matrix.\n" ) source ( "/home/burkardt/public_html/r_src/lumatrix/lumatrix.R" ) cat ( "\n" ) A <- matrix ( c ( 0, 1, 7, 1, 5, -1, -2, 9, -5 ), 3 ) cat ( "\n" ) cat ( "The matrix A:\n" ) cat ( "\n" ) A decomp <- lumatrix ( A ) P <- decomp$P L <- decomp$L U <- decomp$U cat ( "\n" ) cat ( "The P factor of A:\n" ) cat ( "\n" ) P cat ( "\n" ) cat ( "The L factor of A:\n" ) cat ( "\n" ) L cat ( "\n" ) cat ( "The U factor of A:\n" ) cat ( "\n" ) U PLU <- P %*% L %*% U cat ( "\n" ) cat ( "The product P*L*U:\n" ) cat ( "\n" ) PLU # # Terminate. # cat ( "\n" ) cat ( "lumatrix_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )