1. Not finding help here? Sign up for a free 30min 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!

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  {
        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: Mar 1, 2009
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?



Similar Discussions: Due Tomorrow: Linked List in C++
  1. Merging sorted lists (Replies: 0)

  2. Robot w/ 2 links (Replies: 0)

  3. Comparisons in C (Replies: 0)

Loading...