- #1
subwaybusker
- 51
- 0
Code:
#include <iostream>
#include "recommender.h"
#include <stdio.h>
#include "sparsematrix.h"
using namespace std;
#ifndef RECOMMENDER_H
#define RECOMMENDER_H
class Recommender {
private:
SparseMatrix* ratings; // pointer to sparse matrix containing ratings
char** movieNames; // array of strings containing movie names
int numUsers;
int numMovies;
int numRatings;
public:
// ============= FUNCTIONS TO BE IMPLEMENTED =============
Recommender(char* filename);
~Recommender();
void setNumUsers(int a) { numUsers = a; };
void setNumMovies(int a) { numMovies = a; };
void setNumRatings(int a) { numRatings = a; };
char* getMovieName(int movieID);
int getNumMovies();
void sortMoviesByAvgRating(int order, int** sortedMovieIDs);
float computeMovieSimilarity(int movieID1, int movieID2);
void sortMoviesBySimilarity(int movieID, int order, int** sortedMovieIDs);
// ========================================================
};
#endif
SparseMatrix* ratings = new SparseMatrix(numUsers, numMovies);
I'm also getting an "undefined reference error" to the SparseMatrix class in this Recommender file even though I included the header file for SparseMatrix
Last edited: