| | |
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
| Thread Tools | Search this Thread |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h





