algebraic reconstruction method

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2009
Posts: 2
Reputation: caroll is an unknown quantity at this point 
Solved Threads: 0
caroll caroll is offline Offline
Newbie Poster

algebraic reconstruction method

 
0
  #1
Jan 30th, 2009
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 ...
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 2
Reputation: caroll is an unknown quantity at this point 
Solved Threads: 0
caroll caroll is offline Offline
Newbie Poster

Re: algebraic reconstruction method

 
0
  #2
Jan 30th, 2009
[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 ...,,,,,,,,,,,,,,,,,,,
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 148
Reputation: devnar will become famous soon enough devnar will become famous soon enough 
Solved Threads: 16
devnar's Avatar
devnar devnar is offline Offline
Junior Poster

Re: algebraic reconstruction method

 
0
  #3
Jan 30th, 2009
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:
  1. for(i=0; i<rows; i++)
  2. {
  3. if(rowAdd[i] % 3)
  4. {
  5. printf("Matrix cannot be formed.");
  6. break;
  7. }
  8. }
4. If they are all divisible by three, replace the corresponding row in your matrix by the quotient. Using:
  1. if(i==rows)
  2. {
  3. for(i = 0; i<rows; i++)
  4. {
  5. quotient = rowAdd[i]/3;
  6. for(j = 0; j<cols; j++)
  7. {
  8. newMatrix[i][j] = quotient;
  9. }
  10. }
  11. }
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum


Views: 216 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC