/** * Compute the raw matrix for an instance run set * * @param data the data the instance runs * @return the raw matrix */ private final IMatrix __computeInstanceRuns(final IInstanceRuns data) { final _List list; final DimensionTransformation xIn, yIn; final Transformation yOut; final IDimension timeDim, goalDim; xIn = this.getXAxisTransformation(); try (final TransformationFunction xInFunc = xIn.use(data)) { yIn = this.getYAxisInputTransformation(); try (final TransformationFunction yInFunc = yIn.use(data)) { yOut = this.getYAxisOutputTransformation(); try (final TransformationFunction yOutFunc = yOut.use(data)) { timeDim = xIn.getDimension(); goalDim = yIn.getDimension(); if (goalDim.getDataType().isInteger() && yInFunc.isLongArithmeticAccurate()) { if (timeDim.getDataType().isInteger()) { list = new _LongTimeLongGoal( timeDim, goalDim, this.m_criterion, yInFunc, this.m_goalValueLong); } else { list = new _DoubleTimeLongGoal( timeDim, goalDim, this.m_criterion, yInFunc, this.m_goalValueLong); } } else { if (timeDim.getDataType().isInteger()) { list = new _LongTimeDoubleGoal( timeDim, goalDim, this.m_criterion, yInFunc, this.m_goalValueDouble); } else { list = new _DoubleTimeDoubleGoal( timeDim, goalDim, this.m_criterion, yInFunc, this.m_goalValueDouble); } } for (final IRun run : data.getData()) { list._addRun(run); } return list._toMatrix(xInFunc, yOutFunc); } } } }
/** * create the list * * @param timeDim the time dimension * @param goalDim the goal dimension * @param criterion the goal criterion * @param goalTransform the goal transformation */ _List( final IDimension timeDim, final IDimension goalDim, final EComparison criterion, final TransformationFunction goalTransform) { super(); this.m_timeIndex = timeDim.getIndex(); this.m_goalIndex = goalDim.getIndex(); this.m_timeDim = timeDim; this.m_isTimeIncreasing = timeDim.getDirection().isIncreasing(); setTransform: { if (goalTransform.isIdentityTransformation()) { setNoTransform: { switcher: switch (criterion) { case LESS_OR_EQUAL: { if (goalDim.getDirection().isIncreasing()) { break setNoTransform; } break switcher; } case GREATER_OR_EQUAL: { if (goalDim.getDirection().isIncreasing()) { break switcher; } break setNoTransform; } default: { break setNoTransform; } } this.m_useGoalTransformAndCriterion = false; this.m_goalTransform = null; this.m_criterion = null; break setTransform; } } this.m_useGoalTransformAndCriterion = true; this.m_goalTransform = goalTransform; this.m_criterion = criterion; } }