Learn R Programming

FedIRT (version 0.1.0)

memoize: Memoization Function for Speed Optimization

Description

A simple memoization function that stores the results of expensive function calls and reuses those results when the same inputs occur again. This technique greatly speeds up the computation of fedirt function by caching previously computed values.

Usage

memoize(f)

Value

Returns a memoized version of function f that will cache its previously computed results for faster subsequent evaluations, especially beneficial when applied to fedirt.

Arguments

f

Function to be memoized.

Examples

Run this code
# To memoize a function, simply wrap it with `memoize`:
memoize(function(a,b){return(a+b)})

Run the code above in your browser using DataLab