Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double convergance = 1;
- //Preset first term of equation
- double damp = dampener;
- double firstTerm = (1 - damp)/npages;
- //Set all initial scores
- double fScore = 1.0 / (double) npages;
- double* scores;
- scores = (double*)calloc(npages, sizeof(pageScore));
- double* prevScores;
- prevScores = (double*)calloc(npages, sizeof(pageScore));
- int i;
- for (i = 0; i < npages; i++) {
- scores[i]->score = fScore;
- prevScores[i]->score = fScore;
- }
- list* pages = plist;
- //formula
- while (convergance > 0.05) {
- //Set Pn-1 scores to Pn
- for (i = 0; i < npages; i++) {
- prevScores[i] = scores[i];
- }
- //Calculate new values
- for (i = 0; i < npages; i++) {
- }
- //Calculate convergence value
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement