943,884 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 872
  • C RSS
Jan 30th, 2009
0

algebraic reconstruction method

Expand Post »
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 ...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
caroll is offline Offline
6 posts
since Jan 2009
Jan 30th, 2009
0

Re: algebraic reconstruction method

[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 ...,,,,,,,,,,,,,,,,,,,
Reputation Points: 10
Solved Threads: 0
Newbie Poster
caroll is offline Offline
6 posts
since Jan 2009
Jan 30th, 2009
0

Re: algebraic reconstruction method

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.
Reputation Points: 124
Solved Threads: 18
Junior Poster
devnar is offline Offline
148 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Segmentation Fault - its jamican me crazy
Next Thread in C Forum Timeline: redirect stdout to file trouble





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC