Cpsc 440 Problem Set 3 Question 2

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

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

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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/19/2008 for the course CPSC 440 taught by Professor Vladimirrokhlin during the Spring '08 term at Yale.

### Page1 / 5

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

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

View Full Document
Ask a homework question - tutors are online