Cpsc 440 Problem Set 3 Question 2

Cpsc 440 Problem Set 3 Question 2 - hw3p2.h #ifndef HW3P2_H...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
hw3p2.h 4/7/2008 # ifndef HW3P2_H # define HW3P2_H typedef double ( * fptr )( double ) ; typedef struct trial * trial ; trial newTrial ( fptr f , double I , char * title , char * out_name , FILE * log ) ; void freeTrial ( trial t ) ; void runTrial ( trial t ) ; void runTrialToOut ( trial t , FILE * out ) ; double trapezoidalRule ( double min , double max , int n , fptr f ) ; double fa ( double x ) ; double fb ( double x ) ; double fc ( double x ) ; double fd ( double x ) ; double fe ( double x ) ; # endif 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
hw3p2.c 4/7/2008 # include < math . h > # include < stdio . h > # include < stdlib . h > # include "hw3p2.h" # define PI 3.141592653589793 # define NUM_REFINEMENTS 9 # define NUM_FUNCTIONS 5 struct trial { fptr f ; double I ; char * title ; FILE * out ; FILE * log ; double * T_values ; double * e_values ; double * e_ratios ; } ; trial newTrial ( fptr f , double I , char * title , char * out_name , FILE * log ) { trial t = malloc ( sizeof ( struct trial )) ; t - > f = f ; t - > I = I ; t
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Cpsc 440 Problem Set 3 Question 2 - hw3p2.h #ifndef HW3P2_H...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online