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 ...

Recommended Answers

All 2 Replies

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. 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:

for(i=0; i<rows; i++)
{
    if(rowAdd[i] % 3)
    {
        printf("Matrix cannot be formed.");
        break;
    }
}

4. If they are all divisible by three, replace the corresponding row in your matrix by the quotient. Using:

if(i==rows)
{
    for(i = 0; i<rows; i++)
    {
        quotient = rowAdd[i]/3;
        for(j = 0; j<cols; j++)
        {
            newMatrix[i][j] = quotient;
        }
    }
}

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.