Skip to content

Commit df9a065

Browse files
authored
readme edit prog 1
1 parent 22aecbe commit df9a065

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
1) Work flow :
3+
4+
Step 1 :
5+
First output, *For CSC * CSR , press 1 otherwise 0..*
6+
For matrix multiplication, enter 1
7+
For rest of operations press 0
8+
9+
Step 2 :
10+
On pressing 1
11+
For matrix multiplication, am generating two random matrices and multiplying them.
12+
First matrix dimensions, non zero density and -ve numbers density needs to be entered.
13+
Similarly, for 2nd matrix.
14+
15+
After input details for matrices, am outputting the matrices using ; for row breaker, So that the same matrix can be copied and pasted into matlab/octave , for verification purpose.
16+
17+
After multiplication am outputting the result into COO Row sorted format, and providing additional option if you want to print matrix as m x n structure. Press 1, to print in m x n format.
18+
19+
Step 3 :
20+
On pressing 0
21+
To genrate COO, CSR, CSC and CSC trnsform
22+
Matrix dimensions, non zero density and -ve numbers density needs to be entered.
23+
24+
Again am outputting the matrix using ; for row breaker.
25+
After this, am directly converting the input matrix into CSR and CSC format, and outputting the CSR format and CSC format only.
26+
27+
Step 4 :
28+
In this step, am giving options to print the input matrix in form of CSR, CSC or COO as matrix structure of m x n.
29+
Also, am givng option to perform Row operations.
30+
*Print options <20x20 COO-1, CSR-2, CSC-3
31+
CSC transform-4*
32+
Using options 1,2 and 3 matrix can be printed into structure of m x n by sendind respective CSR or Format's data to printmatrix().
33+
34+
Step 5 :
35+
For Performing row transfomations on CSC format :
36+
*Enter r1, k1, r2, k2*
37+
A[r2] = k1*A[r1] + k2*A[r2]
38+
Input r1,k1,r2,k2 for performing row operation on CSC format.
39+
40+
After input, am outputting the transformed row, and later printing the matrix in COO Column CSC sorted format, and also outputting the CSC Format.
41+
42+
43+
44+
2) Function description :
45+
46+
* Range of values : -10 to 10
47+
48+
* main()
49+
main() is taking input that whether you want to multiply matrices or perform rest of operations.
50+
51+
* struct node{..}
52+
Defining the structure for linked list storing position and position data, with next pointer.
53+
54+
* void push(..)
55+
push() function is taking input as start pointer address, position, position data, and adding it to linked list.
56+
57+
* coogenerate()
58+
for generating random matrix in COO Format, and also converting into CSR and CSC, with the option to print matrix.
59+
60+
* input()
61+
generates COO matrix.
62+
63+
* cootocsr()
64+
generates CSR and prints it.
65+
66+
* cootocsc()
67+
generates CSC and prints it.
68+
69+
* sort()
70+
Using selection sort for sorting on the basis of first array input.
71+
72+
* generate2()
73+
generating 2 matrices for multiplication.
74+
75+
* multiply()
76+
Multiplies 2 matrices.
77+
78+
* csctrans()
79+
For performing row operations on CSC matrix.
80+
81+
* printmatrix()
82+
Prints matrix in m X n structure, having inputs as any one of CSR, CSC, COO.
83+
84+
85+
86+
87+
88+

0 commit comments

Comments
 (0)