mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
add experimental optimo into project
This commit is contained in:
parent
9e4551a7cf
commit
43f41caecd
@ -7,17 +7,23 @@ public class MVResult {
|
|||||||
|
|
||||||
private final double[] vars;
|
private final double[] vars;
|
||||||
private final MVParams params;
|
private final MVParams params;
|
||||||
|
private final double[][] datalog;
|
||||||
|
|
||||||
public MVResult(double[] vars, MVParams params, double[][] datalog) {
|
public MVResult(double[] vars, MVParams params, double[][] datalog) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.vars = vars;
|
this.vars = vars;
|
||||||
|
this.datalog = datalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double[] getVarArray() {
|
public double[] getVarArray() {
|
||||||
return vars;
|
return vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String,Double> getVarMap() {
|
public double[][] getDatalog() {
|
||||||
|
return datalog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Double> getVars() {
|
||||||
Map<String, Double> result = new HashMap<>(params.size());
|
Map<String, Double> result = new HashMap<>(params.size());
|
||||||
for (int i = 0; i < vars.length; i++) {
|
for (int i = 0; i < vars.length; i++) {
|
||||||
result.put(params.get(i).name, vars[i]);
|
result.put(params.get(i).name, vars[i]);
|
||||||
|
@ -13,7 +13,7 @@ public class PolyglotMultivariateObjectScript implements MultivariateFunction {
|
|||||||
|
|
||||||
private final MVParams params;
|
private final MVParams params;
|
||||||
private final Object function;
|
private final Object function;
|
||||||
private Logger logger;
|
private final Logger logger;
|
||||||
|
|
||||||
public PolyglotMultivariateObjectScript(Logger logger, MVParams params, Object function) {
|
public PolyglotMultivariateObjectScript(Logger logger, MVParams params, Object function) {
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
@ -37,6 +37,8 @@ public class PolyglotMultivariateObjectScript implements MultivariateFunction {
|
|||||||
|
|
||||||
if (result instanceof Double) {
|
if (result instanceof Double) {
|
||||||
return (Double) result;
|
return (Double) result;
|
||||||
|
} else if (result instanceof Integer) {
|
||||||
|
return (double) ((Integer) result);
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Unable to case result of polyglot function return value as a double:" +
|
"Unable to case result of polyglot function return value as a double:" +
|
||||||
|
Loading…
Reference in New Issue
Block a user