use of org.tensorics.core.units.Unit in project tensorics-core by tensorics.
the class TensorCalculationsTest method profileQuantifiedRepetitiveTensor.
@Ignore
@Test
public void profileQuantifiedRepetitiveTensor() {
final Unit unit = JScienceUnit.of(SI.METER);
CoordinateRange range = CoordinateRange.fromSize(TensorSize.ofXYZ(100, 1000, 1));
List<ProfileResult> results = profileTensorCreationNTimes(10, range, new ValueFactory<QuantifiedValue<Double>>() {
@Override
public QuantifiedValue<Double> create(int x, int y, int z) {
return Tensorics.quantityOf(valueForBig(x, y, z, 2.0), unit).withError(0.0);
}
});
printProfileResult(results);
}
use of org.tensorics.core.units.Unit in project tensorics-core by tensorics.
the class QuantityMultiplicativeInversion method perform.
@Override
public QuantifiedValue<S> perform(QuantifiedValue<S> scalar) {
S newValue = environment().field().multiplicativeInversion().perform(scalar.value());
QuantificationStrategy<S> quant = environment().quantification();
Unit newUnit = quant.divide(quant.one(), scalar.unit());
/* XXX is the error propagated correctly here? */
return Tensorics.quantityOf(newValue, newUnit).withError(scalar.error()).withValidity(scalar.validity());
}
Aggregations