{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Cpsc 440 Problem Set 4 Question 3

# Cpsc 440 Problem Set 4 Question 3 - hw4p3.h#ifndef...

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

hw4p3.h 5/12/2008 # ifndef HW4P3_H # define HW4P3_H typedef struct HermitePolynomial * HermitePolynomial ; HermitePolynomial newHermitePolynomial ( int degree ) ; void freeHermitePolynomial ( HermitePolynomial h ) ; void printHermitePolynomial ( HermitePolynomial h , FILE * output_stream ) ; double evaluateHermitePolynomial ( HermitePolynomial h , double x ) ; double evaluateHPDerivative ( HermitePolynomial h , double x ) ; double newtonsMethodHP ( HermitePolynomial h , double x0 ) ; double * getHermiteCoefficients ( int degree ) ; double * getHigherOrderHermiteCoefficients ( int degree , double * Hkm1 , double * Hkm2 ) ; void printZeros ( double * zeros , int degree , FILE * output_stream ) ; # endif 1

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

View Full Document
hw4p3.c 5/12/2008 # include < math . h > # include < stdio . h > # include < stdlib . h > # include "hw4p3.h" # define SOLUTION_CONVERGENCE_CRITERION 1e-15 # define SEARCH_BOUND 8 # define SEARCH_INCREMENT 0.01 struct HermitePolynomial { int degree ; double * coefficients ; } ; HermitePolynomial newHermitePolynomial ( int degree ) { HermitePolynomial h = malloc ( sizeof ( struct HermitePolynomial )) ; h - > degree = degree ; h - > coefficients = getHermiteCoefficients ( h - > degree ) ; return ( h ) ; } void freeHermitePolynomial ( HermitePolynomial h ) { free ( h - > coefficients ) ; free
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern