1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Due Tomorrow: Linked List in C++

  1. Mar 1, 2009 #1
    Code (Text):

    #include <iostream>
    #include "recommender.h"
    #include <stdio.h>
    #include "sparsematrix.h"
    using namespace std;

    #ifndef RECOMMENDER_H
    #define RECOMMENDER_H

    class Recommender  {
            SparseMatrix* ratings;  // pointer to sparse matrix containing ratings
            char** movieNames;  // array of strings containing movie names
            int numUsers;
            int numMovies;
            int numRatings;

            // ============= FUNCTIONS TO BE IMPLEMENTED =============
            Recommender(char* filename);

            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);
            // ========================================================


    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: Mar 1, 2009
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted