Write a function to transpose a sparse matrix as represented in Section 12.2. 12.2 Matrix Representations Some
Question:
Write a function to transpose a sparse matrix as represented in Section 12.2.
Transcribed Image Text:
12.2 Matrix Representations Some applications must represent a large, two-dimensional matrix where many of the elements have a value of zero. One example is the lower triangular matrix that results from solving systems of simultaneous equations. A lower triangular matrix stores zero values at positions [r, c] such that r < c, as shown in Figure 12.6(a). Thus, the upper-right triangle of the matrix is always zero. Another example is the representation of undirected graphs in an adjacency matrix (see Project 11.2). Because all edges between Vertices i and j go in both directions, there is no need to store both. Instead we can just store one edge going from the higher-indexed vertex to the lower-indexed vertex. In this case, only the lower triangle of the matrix can have non-zero values. We can take advantage of this fact to save space. Instead of storing n(n+1)/2 pieces of information in an n x n array, it would save space to use a list of length n(n+1)/2. This is only practical if some means can be found to locate within the list the element that would correspond to position [r, c] in the original matrix. To derive an equation to do this computation, note that row 0 of the matrix has one non-zero value, row 1 has two non-zero values, and so on. Thus, row r is preceded by r rows with a total of 1 k = (r + r)/2 non-zero elements. Adding c to reach the cth position in the rth row yields the following equation to convert position [r, c] in the original matrix to the correct position in the list. matrix[r, c] = list [(r +r)/2+c]. A similar equation can be used to store an upper triangular matrix, that is, a matrix with zero values at positions [r, c] such that r>c, as shown in Figure 12.6(b). For an n x n upper triangular matrix, the equation would be matrix[r, c] = list[rn - (r +r)/2+c].
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 25% (4 reviews)
The text in the image discusses efficient representations of sparse matrices particularly focusing on lower and upper triangular matrices To transpose a sparse matrix that is stored in this efficient ...View the full answer
Answered By
Utsab mitra
I have the expertise to deliver these subjects to college and higher-level students. The services would involve only solving assignments, homework help, and others.
I have experience in delivering these subjects for the last 6 years on a freelancing basis in different companies around the globe. I am CMA certified and CGMA UK. I have professional experience of 18 years in the industry involved in the manufacturing company and IT implementation experience of over 12 years.
I have delivered this help to students effortlessly, which is essential to give the students a good grade in their studies.
3.50+
2+ Reviews
10+ Question Solved
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Question Posted:
Students also viewed these Computer science questions
-
Write a function to add two sparse matrices as represented in Section 12.2. 12.2 Matrix Representations Some applications must represent a large, two-dimensional matrix where many of the elements...
-
s Alyeska Services Company, a division of a major oil company, provides various services to the operators of the North Slope oil field in Alaska. Data concerning the most recent year appear below:...
-
Matlab You will write a function to calculate the determinant of amatrix. It should work for any size matrix. Remember that thedeterminant can be calculated by multiplying the diagonal elementsof an...
-
Calculate the binding energy per nucleon for a 14/7N nucleus.
-
A cylinder/piston contains air at ambient conditions, 100 kPa and 20C with a volume of 0.3 m3. The air is compressed to 800 kPa in a reversible polytropic process with exponent, n...
-
What is the probability of observing at least 29 hepatomas among the 84 alcoholics with cirrhosis of the liver under the assumptions in Problem 5.50? Hepatic Disease Suppose we observe 84 alcoholics...
-
Compare environmental stocks and flows with financial stocks and flows.When tracking and recording these stocks and flows, what are the similarities and differences in processes used?
-
Marty, Nathan, and Oliver form MNO Mechanics, LLC. They make no elections so the LLC will default to a partnership. They agree that Oliver will operate the business and receive a guaranteed payment...
-
3. Global Bike International (GBI) has the following organisational structure within SAP: US00 US Company GBI Enterprise DE00 German Company DL00 SD00 San Diego MI00 Dallas plant plant Miami plant...
-
Write memory manager allocation and deallocation routines for the situation where all requests and releases follow a last-requested, first-released (stack) order.
-
Write a function to delete an element from a given position in the sparse matrix representation of Section 12.2. 12.2 Matrix Representations Some applications must represent a large, two-dimensional...
-
1. A semielliptical archway is formed over the entrance to an estate. The arch is set on pillars that are 10 feet apart and has a height (atop the pillars) of 4 feet (see figure). Describe the...
-
Provide an assessment of the potential competitive advantage afforded to DHL's proximity to seaport cities such as Durban and Cape Town. Your assessment must take into account the logistics...
-
Assume that SJM will bid on job 1 0 1 that has the following requirements: Mining Processing Machine hours 2 0 0 1 5 0 Labor hours 1 0 0 2 2 5 Assume further that job 1 0 1 has prime costs of $ 3 , 0...
-
Pension plan assets were $ 4 6 0 million at the beginning of the year and $ 4 8 7 million at the end of the year. The return on plan assets was 5 % . At the end of the year, cash invested in the...
-
You need $ 7 0 0 0 per year for four years to go to college. Your father invested $ 1 0 0 0 0 in an account at 7 % , compounded annually, for your education when you were born. If you withdraw the $...
-
A country can produce semiconductors cheaper and faster than other nations. Does this mean that the country has achieved what status in producing semiconductors? Explain.
-
James Hardy recently rejected a $20,000,000, five-year contract with the Vancouver Seals. The contract offer called for an immediate signing bonus of $5,000,000 and annual payments of $3,000,000. To...
-
Use multiplication or division of power series to find the first three nonzero terms in the Maclaurin series for each function. y = e x2 cos x
-
UDP and TCP use Is complement for their check sums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. What is the Is complement of the sum of these 8-bit bytes? (That...
-
a. Suppose you have the following 2 bytes: 01011100 and 01100101 What is the is complement of the sum of these 2 bytes? b. Suppose you have the following 2 bytes: 11011010 and 01100101. What is the...
-
Why is it that voice and video traffic is often sent over TCP rather than UDP in todays Internet?
-
Talk about which one is more susceptible to AI How did Artificial Intelligence(AI) start? Are there leadership styles that work better with AI? How AI relates, what can AI do enhance specific...
-
Summaries models and methods of communications management in context of project life cycle and other project management functions. How would i include a real life example in to this answer?
-
Hewlett-Packard (Canada) Co., established in Montreal in 1961, is a wholly owned subsidiary of California-based Hewlett-Packard Co., a technology solutions provider to consumers, businesses, and...
Study smarter with the SolutionInn App