#*****************************************************************************80 # ## pwiselinterp_test tests pwiselinterp. # # 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: # # 22 February 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "pwiselinterp_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " pwiselinterp carries out piecewise linear interpolation.\n" ) source ( "/home/burkardt/public_html/r_src/pwiselinterp/pwiselinterp.R" ) cat ( "\n" ) x <- c ( -2, -1, 0, 1 ) y <- c ( -2, -2, -1, 2 ) cat ( "\n" ) cat ( " x data:\n" ) cat ( "\n" ) print ( x ) cat ( "\n" ) cat ( " y data:\n" ) cat ( "\n" ) print ( y ) mb = pwiselinterp ( x, y ) cat ( "\n" ) cat ( " Slopes m:\n" ) cat ( "\n" ) print ( mb$m ) cat ( "\n" ) cat ( " Intercepts b:\n" ) cat ( "\n" ) print ( mb$b ) # # Terminate. # cat ( "\n" ) cat ( "pwiselinterp_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )