MCPcopy Create free account
hub / github.com/MolinDeng/Princeton-algs4 / toEnergyMatrix

Method toEnergyMatrix

LabEnv/07Lab/SCUtility.java:34–41  ·  view source on GitHub ↗
(SeamCarver sc)

Source from the content-addressed store, hash-verified

32
33
34 public static double[][] toEnergyMatrix(SeamCarver sc) {
35 double[][] returnDouble = new double[sc.width()][sc.height()];
36 for (int col = 0; col < sc.width(); col++)
37 for (int row = 0; row < sc.height(); row++)
38 returnDouble[col][row] = sc.energy(col, row);
39
40 return returnDouble;
41 }
42
43 // displays grayvalues as energy (converts to picture, calls show)
44 public static void showEnergy(SeamCarver sc) {

Callers 2

showEnergyMethod · 0.95
toEnergyPictureMethod · 0.95

Calls 3

widthMethod · 0.45
heightMethod · 0.45
energyMethod · 0.45

Tested by

no test coverage detected