#! /usr/bin/env python # def p00_data_num ( prob ): #*****************************************************************************80 # ## P00_DATA_NUM returns the number of data points for any problem. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Input, integer PROB, the problem index. # # Output, integer DATA_NUM, the number of data points. # from sys import exit if ( prob == 1 ): data_num = p01_data_num ( ) elif ( prob == 2 ): data_num = p02_data_num ( ) elif ( prob == 3 ): data_num = p03_data_num ( ) elif ( prob == 4 ): data_num = p04_data_num ( ) elif ( prob == 5 ): data_num = p05_data_num ( ) elif ( prob == 6 ): data_num = p06_data_num ( ) elif ( prob == 7 ): data_num = p07_data_num ( ) elif ( prob == 8 ): data_num = p08_data_num ( ) else: print ( '' ) print ( 'P00_DATA_NUM - Fatal error!' ) print ( ' Unexpected input value of PROB.' ) exit ( 'P00_DATA_NUM - Fatal error!' ) return data_num def p01_data_num ( ): #*****************************************************************************80 # ## P01_DATA_NUM returns the number of data points for problem p01. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 18 return data_num def p02_data_num ( ): #*****************************************************************************80 # ## P02_DATA_NUM returns the number of data points for problem p02. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 18 return data_num def p03_data_num ( ): #*****************************************************************************80 # ## P03_DATA_NUM returns the number of data points for problem p03. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 11 return data_num def p04_data_num ( ): #*****************************************************************************80 # ## P04_DATA_NUM returns the number of data points for problem p04. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 8 return data_num def p05_data_num ( ): #*****************************************************************************80 # ## P05_DATA_NUM returns the number of data points for problem p05. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 9 return data_num def p06_data_num ( ): #*****************************************************************************80 # ## P06_DATA_NUM returns the number of data points for problem p06. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 49 return data_num def p07_data_num ( ): #*****************************************************************************80 # ## P07_DATA_NUM returns the number of data points for problem p07. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 4 return data_num def p08_data_num ( ): #*****************************************************************************80 # ## P08_DATA_NUM returns the number of data points for problem p08. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DATA_NUM, the number of data points. # data_num = 12 return data_num def p00_data_num_test ( ): #*****************************************************************************80 # ## P00_DATA_NUM_TEST tests P00_DATA_NUM. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 29 June 2015 # # Author: # # John Burkardt # import platform from p00_prob_num import p00_prob_num print ( '' ) print ( 'P00_DATA_NUM_TEST' ) print ( ' Python version: %s' % ( platform.python_version ( ) ) ) print ( ' P00_DATA_NUM returns the number of data points for any problem.' ) print ( '' ) print ( ' Problem Data Num' ) print ( '' ) prob_num = p00_prob_num ( ) for prob in range ( 1, prob_num + 1 ): data_num = p00_data_num ( prob ) print ( ' %7d %9d' % ( prob, data_num ) ) # # Terminate. # print ( '' ) print ( 'P00_DATA_NUM_TEST:' ) print ( ' Normal end of execution.' ) return if ( __name__ == '__main__' ): from timestamp import timestamp timestamp ( ) p00_data_num_test ( ) timestamp ( )