#*****************************************************************************80 # ## leastsquares_test tests leastsquares. # # 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: # # 20 February 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "leastsquares_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " leastsquares solves a linear system using the normal equations.\n" ) source ( "/home/burkardt/public_html/r_src/leastsquares/leastsquares.R" ) b <- trees$Volume A <- cbind ( 1, trees$Girth, trees$Height ) cat ( "\n" ) cat ( "The matrix A:\n" ) cat ( "\n" ) A cat ( "\n" ) cat ( "The right hand side b:\n" ) cat ( "\n" ) b x <- leastsquares ( A, b ) cat ( "\n" ) cat ( "The least squares solution x:\n" ) cat ( "\n" ) x # # Terminate. # cat ( "\n" ) cat ( "leastsquares_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )