function point_num = product_rule_size ( list_filename, list_num ) %% PRODUCT_RULE_SIZE returns the size of a product rule of distinct factors. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 10 May 2007 % % Author: % % John Burkardt % % Parameters: % % Input, string LIST_FILENAME, a file containing a list % of prefixes defining quadrature rules. % % Input, integer LIST_NUM, the number of prefixes in the file. % % Output, integer POINT_NUM, the number of points in the product rule. % point_num = 1; list_unit = fopen ( list_filename, 'rt' ); if ( list_unit < 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'PRODUCT_RULE_SIZE - Fatal error!\n' ); fprintf ( 1, ' Nonzero value of IOS while opening list file.\n' ); error ( 'PRODUCT_RULE_SIZE - Fatal error!' ); end for list = 1 : list_num quad_1d_filename = fgetl ( list_unit ); quad_x_1d_filename = strcat ( quad_1d_filename, '_x.txt' ); [ dim_num_1d, point_num_1d ] = dtable_header_read ( quad_x_1d_filename ); point_num = point_num * point_num_1d; end fclose ( list_unit );