| | |
algebraic reconstruction method
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 2
Reputation:
Solved Threads: 0
sir, pls help me to write a coding in c for algebraic reconstruction method.....
1 2 3--------->6
4 5 6--------->15
7 8 9--------->24
| | |
| | |
| | |
12 15 18
Its a three dimensional one in dat first row addng threenos get into 6 and like wise 2nd and 3rd row...like wise the column ...
2 2 2-----------6
5 5 5-----------15
8 8 8-----------24
| | |
| | |
15 15 15
first row get de equal amt for each block by dividing 2 to three halves of 2..
like wise repeat for de for the same.....
1st column(12-15)=-3=>(-3/3)=-1
2ndcolumn(15-15)=0=>no change
3rdcolumn(18-15)=3=>(3/3)=1
subtract 1st column by -1 and add first column by +1
1 2 3-----------6
4 5 6-----------15
7 8 9-----------24
| | |
| | |
12 15 18
hence we got de answer .. pls tel me how to write de code for dis method in c.. pls do help me ...
1 2 3--------->6
4 5 6--------->15
7 8 9--------->24
| | |
| | |
| | |
12 15 18
Its a three dimensional one in dat first row addng threenos get into 6 and like wise 2nd and 3rd row...like wise the column ...
2 2 2-----------6
5 5 5-----------15
8 8 8-----------24
| | |
| | |
15 15 15
first row get de equal amt for each block by dividing 2 to three halves of 2..
like wise repeat for de for the same.....
1st column(12-15)=-3=>(-3/3)=-1
2ndcolumn(15-15)=0=>no change
3rdcolumn(18-15)=3=>(3/3)=1
subtract 1st column by -1 and add first column by +1
1 2 3-----------6
4 5 6-----------15
7 8 9-----------24
| | |
| | |
12 15 18
hence we got de answer .. pls tel me how to write de code for dis method in c.. pls do help me ...
•
•
Join Date: Jan 2009
Posts: 2
Reputation:
Solved Threads: 0
[QUOTE=caroll;791725]sir, pls help me to write a coding in c for algebraic reconstruction method.....
1 2 3--------->6
4 5 6--------->15
7 8 9--------->24
| | |
| | |
| | |
12 15 18
Its a three dimensional one in dat first row addng threenos get into 6 and like wise 2nd and 3rd row...like wise the column ...
2 2 2-----------6
5 5 5-----------15
8 8 8-----------24
| | |
| | |
15 15 15
first row get de equal amt for each block by dividing 2 to three halves of 2..
like wise repeat for de for the same.....
1st column(12-15)=-3=>(-3/3)=-1
2ndcolumn(15-15)=0=>no change
3rdcolumn(18-15)=3=>(3/3)=1
subtract 1st column by -1 and add first column by +1
1 2 3-----------6
4 5 6-----------15
7 8 9-----------24
| | |
| | |
12 15 18
hence we got de answer .. pls tel me how to write de code for dis method in c.. pls do help me ...,,,,,,,,,,,,,,,,,,,
1 2 3--------->6
4 5 6--------->15
7 8 9--------->24
| | |
| | |
| | |
12 15 18
Its a three dimensional one in dat first row addng threenos get into 6 and like wise 2nd and 3rd row...like wise the column ...
2 2 2-----------6
5 5 5-----------15
8 8 8-----------24
| | |
| | |
15 15 15
first row get de equal amt for each block by dividing 2 to three halves of 2..
like wise repeat for de for the same.....
1st column(12-15)=-3=>(-3/3)=-1
2ndcolumn(15-15)=0=>no change
3rdcolumn(18-15)=3=>(3/3)=1
subtract 1st column by -1 and add first column by +1
1 2 3-----------6
4 5 6-----------15
7 8 9-----------24
| | |
| | |
12 15 18
hence we got de answer .. pls tel me how to write de code for dis method in c.. pls do help me ...,,,,,,,,,,,,,,,,,,,
1. Construct two matrices.
2. Declare two 1-D arrays called rowAdd and colAdd to hold the values you obtain when you add the row and column elements respectively.
3. Once you find the sum of all the row elements and store it in rowAdd, see if the elements of rowAdd are divisible by three. You can do something like this:
4. If they are all divisible by three, replace the corresponding row in your matrix by the quotient. Using:
5. Now that you have the desired matrix perform row and column additions again and store them in two new arrays and compute the difference between them and rowAdd and colAdd.
2. Declare two 1-D arrays called rowAdd and colAdd to hold the values you obtain when you add the row and column elements respectively.
3. Once you find the sum of all the row elements and store it in rowAdd, see if the elements of rowAdd are divisible by three. You can do something like this:
c Syntax (Toggle Plain Text)
for(i=0; i<rows; i++) { if(rowAdd[i] % 3) { printf("Matrix cannot be formed."); break; } }
c Syntax (Toggle Plain Text)
if(i==rows) { for(i = 0; i<rows; i++) { quotient = rowAdd[i]/3; for(j = 0; j<cols; j++) { newMatrix[i][j] = quotient; } } }
![]() |
Other Threads in the C Forum
- Previous Thread: Segmentation Fault - its jamican me crazy
- Next Thread: redirect stdout to file trouble
Views: 216 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C
#include * .net append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft mqqueue mysql number oddnumber odf opensource overwrite owf pdf performance pointer pointers posix probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi





