-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetFunction.ts
More file actions
33 lines (32 loc) · 1.19 KB
/
Copy pathgetFunction.ts
File metadata and controls
33 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import BETFunction from '../modelFunctions/BETFunction';
import langmuirDoubleFunction from '../modelFunctions/langmuirDoubleFunction';
import langmuirSingleFunction from '../modelFunctions/langmuirSingleFunction';
import langmuirTripleFunction from '../modelFunctions/langmuirTripleFunction';
import linearFunction from '../modelFunctions/linearFunction';
/**
* Returns the function indicated in the string and the initiation parameters
* @param {string} functionName string containing the name of the function to be used
*/
export default function getFunction(functionName: string) {
switch (functionName) {
case'langmuirSingleFit':
case 'langmuirSingle':
return langmuirSingleFunction;
case 'langmuirDoubleFit':
case 'langmuirDouble':
return langmuirDoubleFunction;
case 'langmuirTripleFit':
case 'langmuirTriple':
return langmuirTripleFunction;
case 'BETFitLinearDoubleWeighted':
case 'BETFitLinearDouble':
case 'BETFitLinearSingle':
case 'BETDirectFit':
case 'BET':
return BETFunction;
case 'linearFunction':
return linearFunction;
default:
throw `getFunction - FUNCTION NAME NOT RECOGNIZED: ${functionName}`;
}
}