Functions | Variables

sparse_test.m File Reference

Go to the source code of this file.

Functions

 disp ("\n----------- Tests on Sparse Matrix ------------")
 disp ("\nThe input sparse matrix is:")
 disp (mati)
 disp ("\nCalling sparse_double_matrix_test...")
 disp ("Finishing the call...")
 disp ("\nThe result sparse matrix (non-zero elements) is:")
 disp (mato)
 if (mato==expected) disp("\nSparse double matrix test passed.\n")
else disp ("\nSparse double matrix test failed.\n")
end disp ("---------------- Tests Done ----------------\n")

Variables

 fname = "sparse_double_matrix_test"
 m = 3
 n = 3
 mati = sprand(m, n, 0.2) * 100
 expected = mati + spones(mati)
 nnzi = nnz(mati)
 nnzo = nnzi

Function Documentation

disp ( "\n----------- Tests on Sparse Matrix ------------"   ) 
end disp ( "---------------- Tests Done ----------------\n"   ) 
else disp ( "\nSparse double matrix test failed.\n"   ) 
disp ( "\nThe input sparse matrix is:"   ) 
disp ( mato   ) 
disp ( "\nThe result sparse matrix (non-zero elements) is:"   ) 
disp ( "Finishing the call..."   ) 
disp ( "\nCalling sparse_double_matrix_test..."   ) 
disp ( mati   ) 
if ( mato  = =expected  ) 

Variable Documentation

expected = mati + spones(mati)

Definition at line 6 of file sparse_test.m.

fname = "sparse_double_matrix_test"

Definition at line 2 of file sparse_test.m.

m = 3

Definition at line 3 of file sparse_test.m.

mati = sprand(m, n, 0.2) * 100

Definition at line 5 of file sparse_test.m.

n = 3

Definition at line 4 of file sparse_test.m.

nnzi = nnz(mati)

Definition at line 7 of file sparse_test.m.

Definition at line 8 of file sparse_test.m.