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


Java Field.getZero方法代码示例

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


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

示例1: HighamHall54FieldIntegrator

import org.apache.commons.math3.Field; //导入方法依赖的package包/类
/** Simple constructor.
 * Build a fifth order Higham and Hall integrator with the given step bounds
 * @param field field to which the time and state vector elements belong
 * @param minStep minimal step (sign is irrelevant, regardless of
 * integration direction, forward or backward), the last step can
 * be smaller than this
 * @param maxStep maximal step (sign is irrelevant, regardless of
 * integration direction, forward or backward), the last step can
 * be smaller than this
 * @param scalAbsoluteTolerance allowed absolute error
 * @param scalRelativeTolerance allowed relative error
 */
public HighamHall54FieldIntegrator(final Field<T> field,
                                   final double minStep, final double maxStep,
                                   final double scalAbsoluteTolerance,
                                   final double scalRelativeTolerance) {
    super(field, METHOD_NAME, -1,
          minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);
    e = MathArrays.buildArray(field, 7);
    e[0] = fraction(-1,  20);
    e[1] = field.getZero();
    e[2] = fraction(81, 160);
    e[3] = fraction(-6,   5);
    e[4] = fraction(25,  32);
    e[5] = fraction( 1,  16);
    e[6] = fraction(-1,  10);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:28,代码来源:HighamHall54FieldIntegrator.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

示例4: OpenIntToFieldHashMap

import org.apache.commons.math3.Field; //导入方法依赖的package包/类
/**
 * Build an empty map with default size and using zero for missing entries.
 * @param field field to which the elements belong
 */
public OpenIntToFieldHashMap(final Field<T>field) {
    this(field, DEFAULT_EXPECTED_SIZE, field.getZero());
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:8,代码来源:OpenIntToFieldHashMap.java


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