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...
-
From a retailer's perspective discuss the advantages and disadvantages of consumer-driven personal technologies?
-
Learn how organizations are legally structured and classified. (pp. 294296)
-
Specialized Bicycle Components, Inc. (SBC) caters to the experienced cyclist. In this video, SBC's brand manager explains the company's segmentation and pricing strategy. 1. Review the tactical...
-
Bradburn Corporation was formed 5 years ago through a public subscription of common stock. Daniel Brown, who owns 1 5 % of the common stock, was one of the organizers of Bradburn and is the current...
-
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...
-
Reimer Company and Lingo Company are two proprietorships that are similar in many respects. One difference is that Reimer Company uses the straight-line method and Lingo Company uses the...
-
Task 2 In addition to the report produced for Task 1, the SMT have asked that you produce a short presentation, (minimum of 2 slides per bullet point), to help ensure that employees handle, store and...
-
Real solutions for x 2 = 5 ( x + 3 6 0 ) ?
-
1) Two-stage compressor with irreversibilities = You need to build a two-stage compression system with intercooling to increase the pressure of Argon (monatomic gas, constant specific heat) from pi...
-
A tightrope is connected at each end to a vertical tree trunk at a height of 1.57 meter above the ground. The two trees are located a distance 5.00 meters apart. At the midpoint of the tightrope, a...
-
A missing order occurs when a maximum of the two-slit diffraction pattern lines up with the minimum of the single slit diffraction pattern. Adjust the parameters of the simulation to create a...
-
Air enters an adiabatic nozzle at 60 psia, 540F, and 200 ft/s and exits at 12 psia. Assuming air to be an ideal gas with variable specific heats and disregarding any irreversibilities, determine the...
-
A condenser (heat exchanger) brings 1 kg/s water flow at 10 kPa quality 95% to saturated liquid at 10 kPa, as shown in Fig. P4.91. The cooling is done by lake water at 20C that returns to the lake at...
-
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?
-
Suppose Universal Forests current stock price is $59.00 and it is likely to pay a $0.57 dividend next year. Since analysts estimate Universal Forest will have a 13.8 percent growth rate, what is its...
-
ABC Company engaged in the following transaction in October 2 0 1 7 Oct 7 Sold Merchandise on credit to L Barrett $ 6 0 0 0 8 Purchased merchandise on credit from Bennett Company $ 1 2 , 0 0 0 . 9...
-
1. Use the Excel file Asset Allocation Data to determine the following: a.Variances for the individual assets b. Standard deviations for the individual assets c.Covariances between each pair of...
Study smarter with the SolutionInn App