Create a 3*4 matrix A where each entry equals to 1.0:
 smat::Matrix<double> *A=new smat::Matrix<double>(3,4,1.0);

Create a 5*4 matrix B where each entry is a random value between 0 and 1:
 smat::Matrix<double> *B=new smat::Matrix<double>(5,4,"rand");

Read a matrix C from the text file "X.txt", where each line is a row, and entries are separated by comma, or space, or tab:
 smat::Matrix<double> *C=new smat::Matrix<double>("X.txt");

Create a 4*4 Identity matrix I:
 smat::Matrix<double> *I=new smat::Matrix<double>(4,4,"I");

Create a 9*3 matrix RP where each column is a random permutation of integers from 1 to 9:
 smat::Matrix<double> *RP=new smat::Matrix<double>(9,3,"randperm");

Create a 3*4 matrix RI where each entry is a random integral number in the range between 0 and RAND_MAX:
 smat::Matrix<double> *RI=new smat::Matrix<double>(3,4,"rand_int");

Display the contents of matrix A:

Create a matrix A1 which is a copy of matrix A:
 smat::Matrix<double> *A1=A>copy();

Create a matrix A2 which is the transpose of matrix A:
 smat::Matrix<double> *A2=A>transpose();

Create a matrix A3 which is the submatrix of matrix A, containing rows 0 to 3, and columns 2 to 4 of A:
 smat::Matrix<double> *A3=A>sub(0,3,2,4);
Both row index and column index start from 0. 
Create a matrix A4 which contains the absolute values of matrix A:
 smat::Matrix<double> *A4=A>abs();

Get the number of rows and number of columns of matrix A:

Get the value of an entry of matrix A, and add 1 to it:
 value=A>get(row,column);
 A>set(row,column,value+1);
These two methods are used to access the matrix elements. 
Save matrix A to text file "Y.txt":

Get the trace of matrix A:

Get the Frobenius norm of matrix A:

Get the pnorm of matrix A:

Get the maximal element and its location of matrix A:
 maxValue=A>maxEl(row,column);

Get the minimal element and its location of matrix A:
 minValue=A>minEl(row,column);

Get the mean value of matrix A:

Get the sum of all entries of matrix A:

Get the standard deviation of all entries of matrix A:

Add value 1.0 to all entries of matrix A in space:

Multiply value 2.0 to all entries of matrix A in space:
 A>multiplyNumberSelf(2.0);

Add matrix B to matrix A in space:

Dot multiply matrix B to matrix A in space:
 A>dotMultiplyMatrixSelf(B);

Create a matrix S which is the sum of matrix A and B:
 smat::Matrix<double> * S=A>addMatrixNew(B);

Create a matrix P which is the dot product of matrix A and B:
 smat::Matrix<double> * P=A>dotMultiplyMatrixNew(B);

Create a matrix P which is the matrix product of matrix A and B:
 smat::Matrix<double> * P=A>multiplyMatrixNew(B);

Perform Multidimensional Scaling (MDS) on the square distance matrix D without initialization, and save the results in matrix X:
 smat::Matrix<double> * X=MDS_UCF(D,NULL, dim, iter);
 smat::Matrix<double> * X=MDS_SMACOF(D,NULL, dim, iter);
Here dim is the number of dimensions, iter is the number of iterations. Recommended value of iter is 30. UCF and SMACOF are two different algorithms. We recommend UCF. 
Perform Multidimensional Scaling (MDS) on the square distance matrix D with initialization X0, and save the results in matrix X:
 smat::Matrix<double> * X=MDS_UCF(D,X0, dim, iter);
 smat::Matrix<double> * X=MDS_SMACOF(D,X0, dim, iter);
Here dim is the number of dimensions, iter is the number of iterations. Recommended value of iter is 30. UCF and SMACOF are two different algorithms. We recommend UCF. 