Expand the definition of class Matrix to include a transpose member function. Use the matrix product A^t*A to calculate an upper triangular matrix of presentations that should not be scheduled opposite each other based on a data file of employee presentation preferences. The major diagonal represents total participants for each presentation. Up to 3 pairs will be listed - less than 3 pairs

will be shown if one (or more) of the 3 largest numbers is 1.

What will be an ideal response?


```
const int MAX_ROWS = 15;
const int MAX_COLS = 15;
const int PNUM = 3; // Number of presentations to find conflicts for

class Matrix { // Represents a varying-size matrix that
// can be input from a file
public:
Matrix() {}
Matrix( int, int, int ); // Constructor that initializes matrix
// size and sets all valid elements to
// given initial value
void transpose(Matrix&); // Changes passed matrix to transpose
// of current object matrix
void showDiagonal() const; // Displays diagonal of a square matrix
void findPnum (int[PNUM][3]); // finds PNUM largest entries
// and stores value & location
private:
int rows;
int cols;
int mat[MAX_ROWS][MAX_COLS];
friend ostream& operator<< ( ostream&, const Matrix& );
friend istream& operator>> ( istream&, Matrix& );
friend Matrix& operator*= ( Matrix&, const Matrix& );
};

int main()
{
Matrix m;
Matrix t;
string infilename;
int largest[PNUM][3];

cout << endl << "Enter input filename => ";
cin >> infilename;
ifstream infile(infilename.c_str(), ios::in);
infile >> m;
m.transpose(t); // find transpose of m
t *= m; // find m^t * m
cout << "Presentation Attendance:" << endl;
t.showDiagonal();
t.findPnum (largest);
cout << endl << "Presentation Conflicts:" << endl;
for (int i = 0; i < PNUM; ++i)
if (largest[i][0] != 1) // do not list if only 1 conflict
cout << largest[i][1]+1 << " and "
<< largest[i][2]+1 << endl;
cout << endl;

return 0;
}

```

Computer Science & Information Technology

You might also like to view...

State the scope (global namespace scope or block scope) of each of the following elements:

a) The variable x in main. b) The variable y in function cube’s definition. c) The function cube. d) The function main. e) The function prototype for cube.

Computer Science & Information Technology

The embed element is a standard XHTML element supported by Internet Explorer and Netscape

Indicate whether the statement is true or false

Computer Science & Information Technology

___________ programming  is an approach to software development in which programmers anticipate what might go wrong as their programs run, and take steps to smoothly handle those situations.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The two files that are created as a result of publishing a Canvas document are an HTML file and an MP4 file. 

Answer the following statement true (T) or false (F)

Computer Science & Information Technology