我必须创建一个ModelWeights
使用 Guice 依赖注入的对象。如何double[][]
在运行时使用 Guice 依赖注入绑定数组?
public class MW {
private double[][] weights;
private LogConditionalObjectiveFunction objectiveFunction;
@Inject
public MW(double[][] weights, LogConditionalObjectiveFunction func)
{
this.weights = weights;
this.objectiveFunction = func;
}
public double[][] getWeights()
{
return this.weights;
}
public LogConditionalObjectiveFunction getObjectiveFunction()
{
return this.objectiveFunction;
}
}
我在尝试几种方法时得到了这个:
1) No implementation for double[][] was bound.
while locating double[][]
for parameter 0 at com.data.MW.<init>(MW.java:13)
while locating com.data.MW
for parameter 0 at com.predictor.impl.MEP.<init>(MEP.java:50)
at com.ServletDependencyInjector$1.configureServlets(ServletDependencyInjector.java:72)