|
26 | 26 | import org.apache.log4j.Level; |
27 | 27 | import org.apache.log4j.Logger; |
28 | 28 | import org.apache.sysds.api.DMLScript; |
| 29 | +import org.apache.sysds.common.Types.DataType; |
29 | 30 | import org.apache.sysds.common.Types.ExecMode; |
30 | 31 | import org.apache.sysds.common.Types.ExecType; |
31 | 32 | import org.apache.sysds.common.Types.FileFormat; |
|
63 | 64 | import org.apache.sysds.runtime.meta.MatrixCharacteristics; |
64 | 65 | import org.apache.sysds.runtime.util.IndexRange; |
65 | 66 | import org.apache.sysds.runtime.util.UtilFunctions; |
66 | | -import org.apache.sysds.utils.stats.InfrastructureAnalyzer; |
67 | 67 | import org.apache.sysds.utils.MemoryEstimates; |
| 68 | +import org.apache.sysds.utils.stats.InfrastructureAnalyzer; |
68 | 69 |
|
69 | 70 | public class OptimizerUtils |
70 | 71 | { |
@@ -822,6 +823,13 @@ public static long estimateSizeExactSparsity(long nrows, long ncols, double sp) |
822 | 823 | return MatrixBlock.estimateSizeInMemory(nrows,ncols,sp); |
823 | 824 | } |
824 | 825 |
|
| 826 | + public static long estimateSizeExactSparsity(long nrows, long ncols, double sp, DataType dt){ |
| 827 | + if(dt == DataType.FRAME) |
| 828 | + return estimateSizeExactFrame(nrows, ncols); |
| 829 | + else |
| 830 | + return estimateSizeExactSparsity(nrows, ncols, sp); |
| 831 | + } |
| 832 | + |
825 | 833 | /** |
826 | 834 | * Estimates the footprint (in bytes) for a partitioned in-memory representation of a |
827 | 835 | * matrix with the given matrix characteristics |
|
0 commit comments