1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
else if(option == 6)
{
cout << "Enter elements for 1st sparse matrix: ";
cin >> size;
cout << "Enter elements for 2nd sparse matrix: ";
cin >> size2;
constructMatrix(sparseA, size);
constructMatrix(sparseB, size2);
cout << "\nArray information 1 - Row Major Order\n" << endl;
printMatrix(sparseA, size);
cout << "\nArray information 2 - Row Major Order\n" << endl;
printMatrix(sparseB, size2);
int sizeSum = addTwoMatrix(sparseA, sparseB, sparseC, size, size2);
//nth to do with combined. should be add matrix error
combineMatrix(sparseC, sizeSum);
cout << "\nSum Array information 2 - Row Major Order\n" << endl;
printMatrix(sparseC, (sizeSum));
}
else if(option == 7)
{
cout << "Enter elements for 1st sparse matrix: ";
cin >> size;
cout << "Enter elements for 2nd sparse matrix: ";
cin >> size2;
constructMatrix(sparseA, size);
constructMatrix(sparseB, size2);
cout << "\nArray information 1 - Row Major Order\n" << endl;
printMatrix(sparseA, size);
cout << "\nArray information 2 - Row Major Order\n" << endl;
printMatrix(sparseB, size2);
int sizeSub = subtractTwoMatrix(sparseA, sparseB, sparseC, size, size2);
//nth to do with combined. should be sub matrix error
combineMatrix(sparseC, sizeSub);
cout << "\nDifference Array information 2 - Row Major Order\n" << endl;
printMatrix(sparseC, (sizeSub));
}
|