IFS matrix implementation. Write a version of IFS that uses the static method multiply() from Matrix (see Exercise 2.2.12) instead of the equations that compute the new values of x0 and y0.
EXERCISE 2.2.12
Write a library Matrix that implements the following API:
(See SECTION 1.4.) As a test client, use the following code, which performs the same calculation as Markov (PROGRAM 1.6.3):
public static void main(String[] args){ int trials = Integer.parseInt(args[0]); double[][] p = StdArrayIO.readDouble2D(); double[] ranks = new double[p.length]; rank[0] = 1.0; for (int t = 0; t < trials; t++) ranks = Matrix.multiply(ranks, p); StdArrayIO.print(ranks);}
Mathematicians and scientists use mature libraries or special-purpose matrix-processing languages for such tasks. See the booksite for details on using such libraries.
Program 1.6.3 Mixing a Markov chain
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.