The following I/O operators are available for the matrix class.
1. istream& operator>> (istream& is, valarray<T>& v);
2. istream& operator>> (istream& is, matrix<T>& m);
3. ostream& operator<< (ostream& os, const valarray<T>& v);
4. ostream& operator<< (ostream& os, const matrix<T>& m);
typedef techsoft::matrix<double> Matrix;
typedef std::valarray<double> Vector;
using std::cin;
using std::cout;
Matrix A(4,4);
Vector V(4);
size_t i=1,j=2;
cin >> A[i][j]; // Read Aij th element from standard input
cin >> A.diag()[1]; // Read the 2nd diagonal element of matrix A
cin >> A[i]; // Read the i th row of matrix A
cin >> A(j); // Read the j th column of matrix A
cin >> A.diag(); // Read the diagonal elements of matrix A
cout << A(i,j); // Write Aij th element to standard output
cout << A.diag()[1]; // Write the 2nd diagonal element of matrix A
cout << A[i]; // Write the i th row of matrix A
cout << A(j); // Write the j th column of matrix A
cout << A.diag(); // Write the diagonal elements of matrix A