当前位置: 首页>>代码示例>>Java>>正文


Java Quaternion类代码示例

本文整理汇总了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;
        }
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:21,代码来源:QuaternionFunction.java

示例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);
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:10,代码来源:CompareImplementations.java

示例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);
    }
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:15,代码来源:InverterTask.java

示例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);
    }
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:9,代码来源:DeterminantTask.java

示例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);
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:10,代码来源:CompareImplementations.java

示例6: assertEquals

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
public static void assertEquals(final Quaternion expected, final Quaternion actual) {
    TestUtils.assertEquals(expected, actual, EQUALS);
}
 
开发者ID:optimatika,项目名称:ojAlgo-finance,代码行数:4,代码来源:TestUtils.java

示例7: aggregator

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public AggregatorSet<Quaternion> aggregator() {
    return QuaternionAggregator.getSet();
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:5,代码来源:QuaternionArray.java

示例8: function

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public FunctionSet<Quaternion> function() {
    return QuaternionFunction.getSet();
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:5,代码来源:QuaternionArray.java

示例9: scalar

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public Scalar.Factory<Quaternion> scalar() {
    return Quaternion.FACTORY;
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:5,代码来源:QuaternionArray.java

示例10: make

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
PlainArray<Quaternion> make(final long size) {
    return QuaternionArray.make((int) size);
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:5,代码来源:QuaternionArray.java

示例11: wrap

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
public static final QuaternionArray wrap(final Quaternion[] data) {
    return new QuaternionArray(data);
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:4,代码来源:QuaternionArray.java

示例12: QuaternionArray

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
private QuaternionArray(final Quaternion[] data, final org.ojalgo.scalar.Scalar.Factory<Quaternion> factory) {
    super(data, factory);
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:4,代码来源:QuaternionArray.java

示例13: norm1

import org.ojalgo.scalar.Quaternion; //导入依赖的package包/类
@Override
public AggregatorFunction<Quaternion> norm1() {
    return NORM1.get().reset();
}
 
开发者ID:optimatika,项目名称:ojAlgo,代码行数:5,代码来源:QuaternionAggregator.java


注:本文中的org.ojalgo.scalar.Quaternion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。