use of org.ojalgo.matrix.store.PrimitiveDenseStore in project ojAlgo by optimatika.
the class GaussianField method getM1.
MatrixStore<Double> getM1(final K[] args) {
final int tmpLength = args.length;
final PrimitiveDenseStore retVal = FACTORY.makeZero(tmpLength, 1);
for (int i = 0; i < tmpLength; i++) {
retVal.set(i, 0, myMeanFunction.invoke(args[i]));
}
return retVal;
}
use of org.ojalgo.matrix.store.PrimitiveDenseStore 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.matrix.store.PrimitiveDenseStore in project ojAlgo by optimatika.
the class ComplexNumber method toMultiplicationMatrix.
public MatrixStore<Double> toMultiplicationMatrix() {
final PrimitiveDenseStore retVal = PrimitiveDenseStore.FACTORY.makeZero(this);
this.supplyTo(retVal);
return retVal;
}
use of org.ojalgo.matrix.store.PrimitiveDenseStore in project ojAlgo by optimatika.
the class ComplexNumber method toRotationMatrix.
public MatrixStore<Double> toRotationMatrix() {
final PrimitiveDenseStore retVal = PrimitiveDenseStore.FACTORY.makeZero(2L, 2L);
final double s = myRealValue;
final double ss = s * s;
final double ii = i * i;
final double invs = 1.0 / (ii + ss);
final double r00 = (ii + ss) * invs;
final double r11 = (ss - ii) * invs;
retVal.set(0L, r00);
retVal.set(3L, r11);
return retVal;
}
use of org.ojalgo.matrix.store.PrimitiveDenseStore in project ojAlgo by optimatika.
the class ComplexNumber method toMultiplicationVector.
public MatrixStore<Double> toMultiplicationVector() {
final PrimitiveDenseStore retVal = PrimitiveDenseStore.FACTORY.makeZero(2L, 1L);
retVal.set(0L, myRealValue);
retVal.set(1L, i);
return retVal;
}
Aggregations