we have 2 face a problem in desiging a cell palcement techniqe using force directed algorithm in VLSI.
We have a matrix and want code of that relevant matrix to print that in c language.the matrix is as follow:-

mod 1 2 3 4 5 6 7 8 9 Sum

1 0 0 1 1 1 1 1 2 2 9

2 0 0 0 1 1 1 1 0 1 5

3 1 0 0 1 0 0 1 1 1 5

4 1 1 1 0 1 1 1 1 2 9

5 1 1 0 1 0 2 2 1 2 10

6 1 1 0 1 2 0 2 1 2 10

7 1 1 1 1 2 2 0 1 2 11

8 2 0 1 1 1 1 1 0 2 9

9 2 1 1 2 2 2 2 2 0 14

Here you go...
Just fill up the TODO parts and you're done..

class matrix {
public:
     matrix() {/*TODO*/}
     /*TODO implement operator =()*/

     void print() {/*TODO*/}
};

int main()
{
     matrix m ;
     m =
        {
            {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
            {1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 9},
            {2, 0, 0, 0, 1, 1, 1, 1, 0, 1, 5},
            {3, 1, 0, 0, 1, 0, 0, 1, 1, 1, 5},
            {4, 1, 1, 1, 0, 1, 1, 1, 1, 2, 9},
            {5, 1, 1, 0, 1, 0, 2, 2, 1, 2, 10},
            {6, 1, 1, 0, 1, 2, 0, 2, 1, 2, 10},
            {7, 1, 1, 1, 1, 2, 2, 0, 1, 2, 11},
            {8, 2, 0, 1, 1, 1, 1, 1, 0, 2, 9},
            {9, 2, 1, 1, 2, 2, 2, 2, 2, 0, 14}
        }
     m.print() ;   

     return 0 ;
}
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.