# Thread: simple C programming... but i need help PLZ

1. ## simple C programming... but i need help PLZ

Hello there,

i have done Delphi programming before and we have done many programming this semester. But now i have a multitask project to write and a part of it SHOULD be in C! will you please help me how to deal with a small part of this part ) (i am just learning C and this should be ready by this Friday!)

I should use a LAPACK library. i found "dpotrf" that i think matches...
I had attached the description. i don't need to be worry about reading data, i can just plug them inside the code (they are only 10 points).

But can some one please tell me how to write the normal equations in matrix form? what does that mean at all!?

this is what i should do:
i have to write a program that computes a 4th order polynomial fit to a given data set that i can enter inside the code.
1- write the problem in terms of a least squares (LS) problem in matrix form
2- write the normal equations in matrix form
3-solve the normal equations by Cholesky decomposition followed by the solution of a triangular system of equations. Use LAPACK library.
4-print the coefficients of the polynomial
5-print the value of the interpolating polunomial at a set of regularly spaced points covering the interval in which the data is defined

this is what i wrote...and i think i am confused by the concept of what i should do!

Code:
```***************************

typedef struct seq_ls {

double * w;  /* solution of A*w = b */

/*********
Appends line u at bottom of X and bn at bottom of b, and consenquently

**********/
int (*append_line) (struct seq_ls *self, double * u, double bn);

int (*remove_line) (struct seq_ls *self, int i);

int (*mul_Av) (struct seq_ls *self, double * v, double *dst);
int (*mul_vX) (struct seq_ls *self, double * v, double *dst);

int (*delete) (struct seq_ls *self);

void *private;

} *seq_ls_t;

seq_ls_t new_seq_ls (int X_width, int X_max_height);```

2. ok.....i am done with this....!!! no worries!

Popular pages Recent additions