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


Java Field.getOne方法代码示例

本文整理汇总了Java中org.apache.commons.math3.Field.getOne方法的典型用法代码示例。如果您正苦于以下问题:Java Field.getOne方法的具体用法?Java Field.getOne怎么用?Java Field.getOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.Field的用法示例。


在下文中一共展示了Field.getOne方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DormandPrince54FieldStepInterpolator

import org.apache.commons.math3.Field; //导入方法依赖的package包/类
/** Simple constructor.
 * @param field field to which the time and state vector elements belong
 * @param forward integration direction indicator
 * @param yDotK slopes at the intermediate points
 * @param globalPreviousState start of the global step
 * @param globalCurrentState end of the global step
 * @param softPreviousState start of the restricted step
 * @param softCurrentState end of the restricted step
 * @param mapper equations mapper for the all equations
 */
DormandPrince54FieldStepInterpolator(final Field<T> field, final boolean forward,
                                     final T[][] yDotK,
                                     final FieldODEStateAndDerivative<T> globalPreviousState,
                                     final FieldODEStateAndDerivative<T> globalCurrentState,
                                     final FieldODEStateAndDerivative<T> softPreviousState,
                                     final FieldODEStateAndDerivative<T> softCurrentState,
                                     final FieldEquationsMapper<T> mapper) {
    super(field, forward, yDotK,
          globalPreviousState, globalCurrentState, softPreviousState, softCurrentState,
          mapper);
    final T one = field.getOne();
    a70 = one.multiply(   35.0).divide( 384.0);
    a72 = one.multiply(  500.0).divide(1113.0);
    a73 = one.multiply(  125.0).divide( 192.0);
    a74 = one.multiply(-2187.0).divide(6784.0);
    a75 = one.multiply(   11.0).divide(  84.0);
    d0  = one.multiply(-12715105075.0).divide( 11282082432.0);
    d2  = one.multiply( 87487479700.0).divide( 32700410799.0);
    d3  = one.multiply(-10690763975.0).divide(  1880347072.0);
    d4  = one.multiply(701980252875.0).divide(199316789632.0);
    d5  = one.multiply( -1453857185.0).divide(   822651844.0);
    d6  = one.multiply(    69997945.0).divide(    29380423.0);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:34,代码来源:DormandPrince54FieldStepInterpolator.java

示例2: createFieldIdentityMatrix

import org.apache.commons.math3.Field; //导入方法依赖的package包/类
/**
 * Returns <code>dimension x dimension</code> identity matrix.
 *
 * @param <T> the type of the field elements
 * @param field field to which the elements belong
 * @param dimension dimension of identity matrix to generate
 * @return identity matrix
 * @throws IllegalArgumentException if dimension is not positive
 * @since 2.0
 */
public static <T extends FieldElement<T>> FieldMatrix<T>
    createFieldIdentityMatrix(final Field<T> field, final int dimension) {
    final T zero = field.getZero();
    final T one  = field.getOne();
    final T[][] d = MathArrays.buildArray(field, dimension, dimension);
    for (int row = 0; row < dimension; row++) {
        final T[] dRow = d[row];
        Arrays.fill(dRow, zero);
        dRow[row] = one;
    }
    return new Array2DRowFieldMatrix<T>(field, d, false);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:23,代码来源:MatrixUtils.java

示例3: createFieldIdentityMatrix

import org.apache.commons.math3.Field; //导入方法依赖的package包/类
/**
 * Returns <code>dimension x dimension</code> identity matrix.
 *
 * @param <T> the type of the field elements
 * @param field field to which the elements belong
 * @param dimension dimension of identity matrix to generate
 * @return identity matrix
 * @throws IllegalArgumentException if dimension is not positive
 * @since 2.0
 */
public static <T extends FieldElement<T>> FieldMatrix<T>
    createFieldIdentityMatrix(final Field<T> field, final int dimension) {
    final T zero = field.getZero();
    final T one  = field.getOne();
    @SuppressWarnings("unchecked")
    final T[][] d = (T[][]) Array.newInstance(field.getRuntimeClass(), new int[] { dimension, dimension });
    for (int row = 0; row < dimension; row++) {
        final T[] dRow = d[row];
        Arrays.fill(dRow, zero);
        dRow[row] = one;
    }
    return new Array2DRowFieldMatrix<T>(field, d, false);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:24,代码来源:MatrixUtils.java


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