use of org.ojalgo.type.keyvalue.ComparableToDouble in project ojAlgo by optimatika.
the class GaussianField method getC12.
MatrixStore<Double> getC12(final K[] args) {
final List<ComparableToDouble<K>> tmpObservations = this.getObservations();
final int tmpRowDim = args.length;
final int tmpColDim = tmpObservations.size();
final PrimitiveDenseStore retVal = FACTORY.makeZero(tmpRowDim, tmpColDim);
for (int j = 0; j < tmpColDim; j++) {
for (int i = 0; i < tmpRowDim; i++) {
retVal.set(i, j, myCovarianceFunction.invoke(args[i], tmpObservations.get(j).key));
}
}
return retVal;
}
use of org.ojalgo.type.keyvalue.ComparableToDouble in project ojAlgo by optimatika.
the class GaussianField method getC22.
MatrixDecomposition.Solver<Double> getC22() {
final List<ComparableToDouble<K>> tmpObservations = this.getObservations();
final int tmpSize = tmpObservations.size();
final PrimitiveDenseStore tmpMatrix = FACTORY.makeZero(tmpSize, tmpSize);
for (int j = 0; j < tmpSize; j++) {
final K tmpColumnKey = tmpObservations.get(j).key;
for (int i = 0; i < tmpSize; i++) {
tmpMatrix.set(i, j, myCovarianceFunction.invoke(tmpObservations.get(i).key, tmpColumnKey));
}
}
final SingularValue<Double> retVal = SingularValue.PRIMITIVE.make();
retVal.decompose(tmpMatrix);
return retVal;
}
use of org.ojalgo.type.keyvalue.ComparableToDouble in project ojAlgo by optimatika.
the class GaussianField method getM2differenses.
MatrixStore<Double> getM2differenses() {
final List<ComparableToDouble<K>> tmpObservations = this.getObservations();
final int tmpSize = tmpObservations.size();
final PrimitiveDenseStore retVal = FACTORY.makeZero(tmpSize, 1);
ComparableToDouble<K> tmpObservation;
double tmpDiff;
for (int i = 0; i < tmpSize; i++) {
tmpObservation = tmpObservations.get(i);
tmpDiff = tmpObservation.value - myMeanFunction.invoke(tmpObservation.key);
retVal.set(i, 0, tmpDiff);
}
return retVal;
}
use of org.ojalgo.type.keyvalue.ComparableToDouble in project ojAlgo by optimatika.
the class GaussianField method getC21.
MatrixStore<Double> getC21(final K[] args) {
final List<ComparableToDouble<K>> tmpObservations = this.getObservations();
final int tmpRowDim = tmpObservations.size();
final int tmpColDim = args.length;
final PrimitiveDenseStore retVal = FACTORY.makeZero(tmpRowDim, tmpColDim);
for (int j = 0; j < tmpColDim; j++) {
for (int i = 0; i < tmpRowDim; i++) {
retVal.set(i, j, myCovarianceFunction.invoke(tmpObservations.get(i).key, args[j]));
}
}
return retVal;
}
use of org.ojalgo.type.keyvalue.ComparableToDouble in project ojAlgo by optimatika.
the class GaussianField method getM2.
MatrixStore<Double> getM2() {
final List<ComparableToDouble<K>> tmpObservations = this.getObservations();
final int tmpSize = tmpObservations.size();
final PrimitiveDenseStore retVal = FACTORY.makeZero(tmpSize, 1);
for (int i = 0; i < tmpSize; i++) {
retVal.set(i, 0, myMeanFunction.invoke(tmpObservations.get(i).key));
}
return retVal;
}
Aggregations