#*****************************************************************************80 # ## gaussint_test tests gaussint. # # 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: # # 06 March 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "gaussint_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " gaussint evaluates a Gauss quadrature rule.\n" ) cat ( "\n" ) source ( "/home/burkardt/public_html/r_src/gaussint/gaussint.R" ) w <- c ( 1.0, 1.0 ) cat ( "\n" ) cat ( " w <- gauss weights\n" ) cat ( "\n" ) print ( w ) x <- c ( -1.0/sqrt(3.0), +1.0/sqrt(3.0) ) cat ( "\n" ) cat ( " x <- gauss abscissas\n" ) cat ( "\n" ) print ( x ) f <- function ( x ) { x^3 + x + 1.0 } cat ( "\n" ) cat ( " f <- function ( x ) { x^3 + x + 1.0 }\n" ) cat ( "\n" ) value = gaussint ( f, x, w ) cat ( " gaussint ( f, x, w ) = ", value, "\n" ) f <- function ( x ) { cos ( x ) } cat ( "\n" ) cat ( " f <- function ( x ) { cos ( x ) }\n" ) cat ( "\n" ) value = gaussint ( f, x, w ) cat ( " gaussint ( f, x, w ) = ", value, "\n" ) # # Terminate. # cat ( "\n" ) cat ( "gaussint_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )