本文整理汇总了Java中org.ojalgo.scalar.Quaternion类的典型用法代码示例。如果您正苦于以下问题:Java Quaternion类的具体用法?Java Quaternion怎么用?Java Quaternion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Quaternion类属于org.ojalgo.scalar包,在下文中一共展示了Quaternion类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invoke
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
public final Quaternion invoke(final Quaternion arg) {
Quaternion retVal;
final Quaternion tmpPlus = EXP.invoke(arg);
final Quaternion tmpMinus = EXP.invoke(arg.negate());
final Quaternion tmpDividend = tmpPlus.subtract(tmpMinus);
final Quaternion tmpDivisor = tmpPlus.add(tmpMinus);
if (tmpDividend.equals(tmpDivisor)) {
retVal = Quaternion.ONE;
} else if (tmpDividend.equals(tmpDivisor.negate())) {
retVal = Quaternion.ONE.negate();
} else {
retVal = tmpDividend.divide(tmpDivisor);
}
return retVal;
}
示例2: assertBinary
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
void assertBinary(final BinaryFunction<BigDecimal> big, final BinaryFunction<ComplexNumber> complex, final BinaryFunction<Double> primitive,
final BinaryFunction<Quaternion> quaternion, final BinaryFunction<RationalNumber> rational, final double arg1, final double arg2) {
TestUtils.assertEquals("Big vs Complex", big.invoke(arg1, arg2), complex.invoke(arg1, arg2), CONTEXT);
TestUtils.assertEquals("Complex vs Primitive", complex.invoke(arg1, arg2), primitive.invoke(arg1, arg2), CONTEXT);
TestUtils.assertEquals("Primitive vs Quaternion", primitive.invoke(arg1, arg2), quaternion.invoke(arg1, arg2), CONTEXT);
TestUtils.assertEquals("Quaternion vs Rational", quaternion.invoke(arg1, arg2), rational.invoke(arg1, arg2), CONTEXT);
TestUtils.assertEquals("Rational vs Big", rational.invoke(arg1, arg2), big.invoke(arg1, arg2), CONTEXT);
}
示例3: make
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public InverterTask<Quaternion> make(final MatrixStore<Quaternion> template, final boolean symmetric, final boolean positiveDefinite) {
if (template.isSquare()) {
if (symmetric && positiveDefinite) {
return Cholesky.QUATERNION.make(template);
} else {
return LU.QUATERNION.make(template);
}
} else if (template.isTall()) {
return QR.QUATERNION.make(template);
} else {
return SingularValue.QUATERNION.make(template);
}
}
示例4: make
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public DeterminantTask<Quaternion> make(final MatrixStore<Quaternion> template, final boolean symmetric, final boolean positiveDefinite) {
if (symmetric && positiveDefinite) {
return Cholesky.QUATERNION.make(template);
} else {
return LU.QUATERNION.make(template);
}
}
示例5: assertUnary
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
void assertUnary(final UnaryFunction<BigDecimal> big, final UnaryFunction<ComplexNumber> complex, final UnaryFunction<Double> primitive,
final UnaryFunction<Quaternion> quaternion, final UnaryFunction<RationalNumber> rational, final double arg) {
TestUtils.assertEquals("Big vs Complex", big.invoke(arg), complex.invoke(arg), CONTEXT);
TestUtils.assertEquals("Complex vs Primitive", complex.invoke(arg), primitive.invoke(arg), CONTEXT);
TestUtils.assertEquals("Primitive vs Quaternion", primitive.invoke(arg), quaternion.invoke(arg), CONTEXT);
TestUtils.assertEquals("Quaternion vs Rational", quaternion.invoke(arg), rational.invoke(arg), CONTEXT);
TestUtils.assertEquals("Rational vs Big", rational.invoke(arg), big.invoke(arg), CONTEXT);
}
示例6: assertEquals
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
public static void assertEquals(final Quaternion expected, final Quaternion actual) {
TestUtils.assertEquals(expected, actual, EQUALS);
}
示例7: aggregator
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public AggregatorSet<Quaternion> aggregator() {
return QuaternionAggregator.getSet();
}
示例8: function
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public FunctionSet<Quaternion> function() {
return QuaternionFunction.getSet();
}
示例9: scalar
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public Scalar.Factory<Quaternion> scalar() {
return Quaternion.FACTORY;
}
示例10: make
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
PlainArray<Quaternion> make(final long size) {
return QuaternionArray.make((int) size);
}
示例11: wrap
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
public static final QuaternionArray wrap(final Quaternion[] data) {
return new QuaternionArray(data);
}
示例12: QuaternionArray
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
private QuaternionArray(final Quaternion[] data, final org.ojalgo.scalar.Scalar.Factory<Quaternion> factory) {
super(data, factory);
}
示例13: norm1
import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public AggregatorFunction<Quaternion> norm1() {
return NORM1.get().reset();
}