asymptoticMemoryComplexityClass: Asymptotic Memory Complexity Classifying function

View source: R/asymptoticMemoryComplexityClass.R

asymptoticMemoryComplexityClassR Documentation

Asymptotic Memory Complexity Classifying function

Description

Function to classify the memory complexity of the expression passed onto asymptoticMemoryUsage (which outputs a data frame to be used here)

Usage

asymptoticMemoryComplexityClass(model.df)

Arguments

model.df

A data frame composed of columns 'Memory usage' and 'Data sizes', which can be obtained by asymptoticMemoryUsage()

Details

For more information regarding its implementation or functionality/usage, please check https://anirban166.github.io//Complexity-classifiers/

Value

A string specifying the resultant complexity class. (Eg: 'Linear', 'Log-linear', 'Quadratic')

Examples

# Memory profiling must be available in the running system:
if(capabilities("profmem")) {
# Allocating a square matrix of N*N dimensions against a set of increasing input data sizes:
input.sizes = 10^seq(1, 3, by = 0.1)
memory.usage.data <- asymptoticMemoryUsage(matrix(data = N:N, nrow = N, ncol = N), input.sizes)
# Computing its memory complexity class based on the benchmarked data obtained above:
asymptoticMemoryComplexityClass(memory.usage.data)
# For allocating a square matrix, the quadratic space/memory complexity class is expected.
}

Anirban166/testComplexity documentation built on April 21, 2023, 6:15 p.m.