target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void isRunning_actionRunning_returnsTrue() throws Exception { Action action = mock(Action.class); mRunningActions.put(action, mock(ActionContext.class)); Assertions.assertTrue(mActionControl.isActionRunning(action)); }
public boolean isActionRunning(Action action) { return mRunningActions.containsKey(action); }
ActionControl { public boolean isActionRunning(Action action) { return mRunningActions.containsKey(action); } }
ActionControl { public boolean isActionRunning(Action action) { return mRunningActions.containsKey(action); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requirementsCon...
ActionControl { public boolean isActionRunning(Action action) { return mRunningActions.containsKey(action); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requirementsCon...
ActionControl { public boolean isActionRunning(Action action) { return mRunningActions.containsKey(action); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requirementsCon...
@Test public void updateActionsForNextRun_withActionsToRemove_runMarkedFinished() throws Exception { Map<Action, ActionContext> actions = new HashMap<>(); actions.put(mock(Action.class), mock(ActionContext.class)); actions.put(mock(Action.class), mock(ActionContext.class)); mRunningActions.putAll(actions); mActionContr...
public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); }
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } }
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
@Test public void updateActionsForNextRun_withActionsToRemove_requirementsMarkedNoAction() throws Exception { Map<Action, ActionContext> actions = new HashMap<>(); actions.put(mock(Action.class), mock(ActionContext.class)); actions.put(mock(Action.class), mock(ActionContext.class)); mRunningActions.putAll(actions); mAc...
public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); }
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } }
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
ActionControl { public void updateActionsForNextRun(Iterable<Action> actionsToRemove) { actionsToRemove.forEach(this::internalRemove); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, Requirem...
@Test public void startNewActions_withActionsToStart_startsActions() throws Exception { Collection<Action> actions = Arrays.asList( ActionsMock.actionMocker().build(), ActionsMock.actionMocker().build() ); mNextRunActions.addAll(actions); mActionControl.startNewActions(); MatcherAssert.assertThat(mRunningActions.keySet...
public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); }
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } }
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
@Test public void startNewActions_withActionsToStart_updatesRequirements() throws Exception { Collection<Action> actions = Arrays.asList( ActionsMock.actionMocker().build(), ActionsMock.actionMocker().build() ); mNextRunActions.addAll(actions); mActionControl.startNewActions(); ArgumentCaptor<Action> captor = ArgumentC...
public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); }
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } }
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
ActionControl { public void startNewActions() { mNextRunActions.forEach(this::internalAdd); mNextRunActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock clock, RequirementsControl requir...
@Test public void stopAllActions_withRunningActions_runMarkedFinished() throws Exception { Map<Action, ActionContext> actions = new HashMap<>(); actions.put(mock(Action.class), mock(ActionContext.class)); actions.put(mock(Action.class), mock(ActionContext.class)); mRunningActions.putAll(actions); mActionControl.cancelA...
public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); }
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } }
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
@Test public void stopAllActions_withRunningActions_requirementsMarkedNoAction() throws Exception { Map<Action, ActionContext> actions = new HashMap<>(); actions.put(mock(Action.class), mock(ActionContext.class)); actions.put(mock(Action.class), mock(ActionContext.class)); mRunningActions.putAll(actions); mActionContro...
public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); }
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } }
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
ActionControl { public void cancelAllActions() { mNextRunActions.clear(); mRunningActions.forEach(this::onInternalRemove); mRunningActions.clear(); } ActionControl(Clock clock, RequirementsControl requirementsControl, Map<Action, ActionContext> runningActions, Collection<Action> nextRunActions); ActionControl(Clock cl...
@Test public void run_withActions_runsActions() throws Exception { ActionContext actionContext = ActionsMock.contextMocker() .runFinished(false) .build(); mActionControlMock.runningAction(actionContext); mSchedulerIteration.run(SchedulerModeMock.mockNotDisabledMode()); verify(actionContext, times(1)).run(); }
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void after_thisIsNotValidOtherIsNotValid_returnsFalse() throws Exception { final Time THIS = Time.INVALID; final Time OTHER = Time.INVALID; assertFalse(THIS.after(OTHER)); }
public boolean after(Time other) { return largerThan(other); }
Time implements Comparable<Time> { public boolean after(Time other) { return largerThan(other); } }
Time implements Comparable<Time> { public boolean after(Time other) { return largerThan(other); } Time(long value, TimeUnit unit); }
Time implements Comparable<Time> { public boolean after(Time other) { return largerThan(other); } Time(long value, TimeUnit unit); static Time of(long value, TimeUnit unit); static Time milliseconds(long valueMs); static Time seconds(long valueSeconds); static Time seconds(double valueSeconds); static Time minutes(long...
Time implements Comparable<Time> { public boolean after(Time other) { return largerThan(other); } Time(long value, TimeUnit unit); static Time of(long value, TimeUnit unit); static Time milliseconds(long valueMs); static Time seconds(long valueSeconds); static Time seconds(double valueSeconds); static Time minutes(long...
@Test public void run_subsystemsWithDefaults_startsDefaultActions() throws Exception { Subsystem subsystem = mock(Subsystem.class); Action action = mock(Action.class); mSubsystemControlMock.setDefaultAction(subsystem, action); mSchedulerIteration.run(SchedulerModeMock.mockNotDisabledMode()); verify(action, times(1)).st...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void run_actionsIsFinished_removesAction() throws Exception { ActionContext actionContext = ActionsMock.contextMocker() .runFinished(true) .build(); Action action = mActionControlMock.runningAction(actionContext); mSchedulerIteration.run(SchedulerModeMock.mockNotDisabledMode()); mActionControlMock.verify(t...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void run_disabledMode_removesActionsNotAllowedInDisabled() throws Exception { Action action = ActionsMock.actionMocker() .mockRunWhenDisabled(false) .build(); mActionControlMock.runningAction(action); mSchedulerIteration.run(SchedulerModeMock.mockDisabledMode()); mActionControlMock.verify(times(1)).updateA...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void run_disabledMode_doesNotRunNotAllowedInDisabled() throws Exception { Action action = ActionsMock.actionMocker() .mockRunWhenDisabled(false) .build(); ActionContext actionContext = mActionControlMock.runningAction(action); mSchedulerIteration.run(SchedulerModeMock.mockDisabledMode()); verify(actionCont...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void run_userExceptionFromAction_cancelsAction() throws Exception { Action action = ActionsMock.actionMocker() .mockRunWhenDisabled(false) .build(); ActionContext actionContext = mActionControlMock.runningAction(action); when(actionContext.run()).thenThrow(new RuntimeException()); mSchedulerIteration.run(S...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void run_newActionsReady_startsThem() throws Exception { Action action = ActionsMock.actionMocker() .mockRunWhenDisabled(false) .build(); ActionContext actionContext = mActionControlMock.pendingAction(action); mSchedulerIteration.run(SchedulerModeMock.mockNotDisabledMode()); verify(actionContext, times(1))...
public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
SchedulerIteration { public void run(SchedulerMode mode) { mActionsToRemove.clear(); startNewActions(); runActions(mode); startDefaultSubsystemActions(mode); readyForNextRun(); } SchedulerIteration(ActionControl actionControl, RequirementsControl requirementsControl, Logger logger); void run(SchedulerMode mode); }
@Test public void execute_noActionCurrentlyRunning_startsNextAction() throws Exception { List<Action> actions = Collections.singletonList( ActionsMock.actionMocker().build() ); ActionContext context = mock(ActionContext.class); Deque<ActionContext> contexts = new ArrayDeque<>(Collections.singleton( context )); Sequenti...
@Override public final void execute() { if (mCurrentAction == null) { startNextAction(); } handleCurrentAction(); }
SequentialActionGroup extends ActionGroupBase { @Override public final void execute() { if (mCurrentAction == null) { startNextAction(); } handleCurrentAction(); } }
SequentialActionGroup extends ActionGroupBase { @Override public final void execute() { if (mCurrentAction == null) { startNextAction(); } handleCurrentAction(); } SequentialActionGroup(Scheduler scheduler, Clock clock, Collection<Action> actions, Queue<ActionContext> actionQueue); Sequential...
SequentialActionGroup extends ActionGroupBase { @Override public final void execute() { if (mCurrentAction == null) { startNextAction(); } handleCurrentAction(); } SequentialActionGroup(Scheduler scheduler, Clock clock, Collection<Action> actions, Queue<ActionContext> actionQueue); Sequential...
SequentialActionGroup extends ActionGroupBase { @Override public final void execute() { if (mCurrentAction == null) { startNextAction(); } handleCurrentAction(); } SequentialActionGroup(Scheduler scheduler, Clock clock, Collection<Action> actions, Queue<ActionContext> actionQueue); Sequential...
@Test public void execute_notFirstRunTimeHasElapsed_runsRunnable() throws Exception { Runnable runnable = mock(Runnable.class); Time nextRun = Time.seconds(1); when(mClock.currentTime()).thenReturn(nextRun); PeriodicAction action = new PeriodicAction(mClock, runnable, Time.seconds(1), nextRun); action.execute(); verify...
@Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } }
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } }
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
@Test public void execute_notFirstRunTimeNotElapsed_notRunsRunnable() throws Exception { Runnable runnable = mock(Runnable.class); Time nextRun = Time.seconds(2); when(mClock.currentTime()).thenReturn(Time.seconds(1)); PeriodicAction action = new PeriodicAction(mClock, runnable, Time.seconds(1), nextRun); action.execut...
@Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } }
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } }
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
PeriodicAction extends ActionBase { @Override public void execute() { if (!mNextRun.isValid() || mClock.currentTime().largerThanOrEquals(mNextRun)) { mRunnable.run(); mNextRun = mClock.currentTime().add(mPeriod); } } PeriodicAction(Clock clock, Runnable runnable, Time period, Time nextRun); PeriodicAction(Clock clock,...
@Test public void write_ofObject_writesObjectToWriteIndex() throws Exception { final Object VALUE = new Object(); AtomicReferenceArray<Object> innerArray = new AtomicReferenceArray<>(2); DoubleBuffer<Object> doubleBuffer = new DoubleBuffer<>(innerArray, new AtomicInteger(0)); doubleBuffer.write(VALUE); assertEquals(VAL...
public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
@Test public void equals_thisIsNotValidOtherIsNotValid_returnsTrue() throws Exception { final Time THIS = Time.INVALID; final Time OTHER = Time.INVALID; assertTrue(THIS.equals(OTHER)); }
public boolean equals(Time other) { return CompareResult.EQUAL_TO.is(compareTo(other)); }
Time implements Comparable<Time> { public boolean equals(Time other) { return CompareResult.EQUAL_TO.is(compareTo(other)); } }
Time implements Comparable<Time> { public boolean equals(Time other) { return CompareResult.EQUAL_TO.is(compareTo(other)); } Time(long value, TimeUnit unit); }
Time implements Comparable<Time> { public boolean equals(Time other) { return CompareResult.EQUAL_TO.is(compareTo(other)); } Time(long value, TimeUnit unit); static Time of(long value, TimeUnit unit); static Time milliseconds(long valueMs); static Time seconds(long valueSeconds); static Time seconds(double valueSeconds...
Time implements Comparable<Time> { public boolean equals(Time other) { return CompareResult.EQUAL_TO.is(compareTo(other)); } Time(long value, TimeUnit unit); static Time of(long value, TimeUnit unit); static Time milliseconds(long valueMs); static Time seconds(long valueSeconds); static Time seconds(double valueSeconds...
@Test public void write_ofObject_swapsWriteIndex() throws Exception { final Object VALUE = new Object(); AtomicReferenceArray<Object> innerArray = new AtomicReferenceArray<>(2); AtomicInteger readIndex = new AtomicInteger(0); DoubleBuffer<Object> doubleBuffer = new DoubleBuffer<>(innerArray, readIndex); doubleBuffer.wr...
public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
DoubleBuffer { public void write(T value) { int index = mReadIndex.get(); mArray.set(index, value); mReadIndex.updateAndGet(mReadIndexUpdater); } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
@Test public void read_initialValues_throwsNoSuchElementException() throws Exception { assertThrows(NoSuchElementException.class, ()->{ AtomicReferenceArray<Object> innerArray = new AtomicReferenceArray<>(2); DoubleBuffer<Object> doubleBuffer = new DoubleBuffer<>(innerArray, new AtomicInteger(0)); doubleBuffer.read(); ...
public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
@Test public void read_valueExistsInArray_returnsThatValue() throws Exception { final Object VALUE = new Object(); AtomicReferenceArray<Object> innerArray = new AtomicReferenceArray<>(2); innerArray.set(0, VALUE); DoubleBuffer<Object> doubleBuffer = new DoubleBuffer<>(innerArray, new AtomicInteger(0)); Object read = do...
public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
@Test public void read_withIndexOnItem_swapsReadIndex() throws Exception { final Object VALUE = new Object(); AtomicReferenceArray<Object> innerArray = new AtomicReferenceArray<>(2); innerArray.set(0, VALUE); AtomicInteger readIndex = new AtomicInteger(0); DoubleBuffer<Object> doubleBuffer = new DoubleBuffer<>(innerArr...
public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
DoubleBuffer { public T read() { T value = mArray.get(mReadIndex.get()); if (value == null) { throw new NoSuchElementException("nothing to read"); } return value; } DoubleBuffer(AtomicReferenceArray<T> array, AtomicInteger readIndex); DoubleBuffer(); T read(); void write(T value); }
@Test public void process_forInput_passesToAllPipes() throws Exception { final Pipeline[] PIPELINES = { mock(Pipeline.class), mock(Pipeline.class), mock(Pipeline.class) }; final Object INPUT = new Object(); SyncPipeJunction<Object> syncPipeJunction = new SyncPipeJunction<>(PIPELINES); syncPipeJunction.process(INPUT); f...
@Override public void process(T input) throws VisionException { for (Pipeline<? super T> pipeline : mPipelines) { pipeline.process(input); } }
SyncPipeJunction implements Pipeline<T> { @Override public void process(T input) throws VisionException { for (Pipeline<? super T> pipeline : mPipelines) { pipeline.process(input); } } }
SyncPipeJunction implements Pipeline<T> { @Override public void process(T input) throws VisionException { for (Pipeline<? super T> pipeline : mPipelines) { pipeline.process(input); } } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); }
SyncPipeJunction implements Pipeline<T> { @Override public void process(T input) throws VisionException { for (Pipeline<? super T> pipeline : mPipelines) { pipeline.process(input); } } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); @Overrid...
SyncPipeJunction implements Pipeline<T> { @Override public void process(T input) throws VisionException { for (Pipeline<? super T> pipeline : mPipelines) { pipeline.process(input); } } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); @Overrid...
@Test public void divergeTo_forNewPipeline_addsPipelineToJunctionWithPreviousOnes() throws Exception { final Pipeline[] PIPELINES = { mock(Pipeline.class), mock(Pipeline.class), mock(Pipeline.class) }; final Pipeline<? super Object> NEW_PIPELINE = mock(Pipeline.class); Collection<Pipeline> pipelines = new ArrayList<>(A...
@Override public Pipeline<T> divergeTo(Pipeline<? super T> pipeline) { mPipelines.add(pipeline); return this; }
SyncPipeJunction implements Pipeline<T> { @Override public Pipeline<T> divergeTo(Pipeline<? super T> pipeline) { mPipelines.add(pipeline); return this; } }
SyncPipeJunction implements Pipeline<T> { @Override public Pipeline<T> divergeTo(Pipeline<? super T> pipeline) { mPipelines.add(pipeline); return this; } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); }
SyncPipeJunction implements Pipeline<T> { @Override public Pipeline<T> divergeTo(Pipeline<? super T> pipeline) { mPipelines.add(pipeline); return this; } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); @Override void process(T input); @Overr...
SyncPipeJunction implements Pipeline<T> { @Override public Pipeline<T> divergeTo(Pipeline<? super T> pipeline) { mPipelines.add(pipeline); return this; } SyncPipeJunction(Collection<Pipeline<? super T>> pipelines); @SafeVarargs SyncPipeJunction(Pipeline<? super T>... pipelines); @Override void process(T input); @Overr...
@Test public void process_withTwoProcessors_processesInAndPipesToOut() throws Exception { final Object INPUT = new Object(); final Object OUTPUT_IN = new Object(); final Processor<Object, Object> PROCESSOR_IN = mockProcessorWithInputOutput(INPUT, OUTPUT_IN); final Processor<Object, Object> PROCESSOR_OUT = mock(Processo...
@SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
@Test public void process_withMultipleProcessors_processesThroughAll() throws Exception { final Object[] DATA = { new Object(), new Object(), new Object(), new Object() }; final Processor[] PROCESSORS = new Processor[DATA.length - 1]; for (int i = 0; i < PROCESSORS.length; i++) { PROCESSORS[i] = mockProcessorWithInputO...
@SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
@Test public void process_withTypedProcessors_producesCorrectEndResult() throws Exception { final Processor[] PROCESSORS = { (Processor<Object, Integer>) Object::hashCode, (Processor<Integer, String>) String::valueOf, (Processor<String, Character>) input -> input.charAt(0) }; final Object INPUT = new Object(); final Ob...
@SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } }
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
ProcessorChain implements Processor { @SuppressWarnings("unchecked") @Override public Object process(Object input) throws VisionException { Object out = input; for (Processor processor : mProcessors) { out = processor.process(out); } return out; } ProcessorChain(Collection<Processor> processors); ProcessorChain(Proce...
@Test public void process_forInput_processesInAndPipesToOut() throws Exception { final Object INPUT = new Object(); final Object OUTPUT_IN = new Object(); final Processor<Object, Object> PROCESSOR_IN = mock(Processor.class); when(PROCESSOR_IN.process(eq(INPUT))).thenReturn(OUTPUT_IN); final Processor<Object, Object> PR...
@Override public R2 process(T input) throws VisionException { R out = mIn.process(input); return mOut.process(out); }
ProcessorPair implements Processor<T, R2> { @Override public R2 process(T input) throws VisionException { R out = mIn.process(input); return mOut.process(out); } }
ProcessorPair implements Processor<T, R2> { @Override public R2 process(T input) throws VisionException { R out = mIn.process(input); return mOut.process(out); } ProcessorPair(Processor<T, R> in, Processor<? super R, R2> out); }
ProcessorPair implements Processor<T, R2> { @Override public R2 process(T input) throws VisionException { R out = mIn.process(input); return mOut.process(out); } ProcessorPair(Processor<T, R> in, Processor<? super R, R2> out); @Override R2 process(T input); }
ProcessorPair implements Processor<T, R2> { @Override public R2 process(T input) throws VisionException { R out = mIn.process(input); return mOut.process(out); } ProcessorPair(Processor<T, R> in, Processor<? super R, R2> out); @Override R2 process(T input); }
@Test public void updateRequirementsNoCurrentAction_actionUsesAllSubsystems_removesAllSubsystems() throws Exception { Collection<Subsystem> subsystems = Arrays.asList( mock(Subsystem.class), mock(Subsystem.class), mock(Subsystem.class)); Action action = ActionsMock.actionMocker() .mockWithRequirements(subsystems) .buil...
public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } }
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } }
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
@Test public void process_forInput_processesAndPipesInputToPipeline() throws Exception { final Object INPUT = new Object(); final Processor<Object, Object> PROCESSOR = mock(Processor.class); final Pipeline<Object> PIPELINE = mock(Pipeline.class); InProcessorJunction<Object, Object> inProcessorJunction = new InProcessor...
@Override public R process(T input) throws VisionException { mPipeline.process(input); return mProcessor.process(input); }
InProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { mPipeline.process(input); return mProcessor.process(input); } }
InProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { mPipeline.process(input); return mProcessor.process(input); } InProcessorJunction(Processor<T, R> processor, Pipeline<? super T> pipeline); }
InProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { mPipeline.process(input); return mProcessor.process(input); } InProcessorJunction(Processor<T, R> processor, Pipeline<? super T> pipeline); @Override R process(T input); @Override Processor<T, R> divergeIn(Pipe...
InProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { mPipeline.process(input); return mProcessor.process(input); } InProcessorJunction(Processor<T, R> processor, Pipeline<? super T> pipeline); @Override R process(T input); @Override Processor<T, R> divergeIn(Pipe...
@Test public void process_forInput_processesAndPipesOutputToPipeline() throws Exception { final Object INPUT = new Object(); final Object OUTPUT = new Object(); final Processor<Object, Object> PROCESSOR = mock(Processor.class); when(PROCESSOR.process(eq(INPUT))).thenReturn(OUTPUT); final Pipeline<Object> PIPELINE = moc...
@Override public R process(T input) throws VisionException { R out = mProcessor.process(input); mPipeline.process(out); return out; }
OutProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { R out = mProcessor.process(input); mPipeline.process(out); return out; } }
OutProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { R out = mProcessor.process(input); mPipeline.process(out); return out; } OutProcessorJunction(Processor<T, R> processor, Pipeline<? super R> pipeline); }
OutProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { R out = mProcessor.process(input); mPipeline.process(out); return out; } OutProcessorJunction(Processor<T, R> processor, Pipeline<? super R> pipeline); @Override R process(T input); @Override Processor<T, R> d...
OutProcessorJunction implements Processor<T, R> { @Override public R process(T input) throws VisionException { R out = mProcessor.process(input); mPipeline.process(out); return out; } OutProcessorJunction(Processor<T, R> processor, Pipeline<? super R> pipeline); @Override R process(T input); @Override Processor<T, R> d...
@Test public void updateRequirementsNoCurrentAction_actionUsesSome_removesOnlyMatchingSubsystems() throws Exception { Collection<Subsystem> otherSubsystems = Arrays.asList( mock(Subsystem.class), mock(Subsystem.class), mock(Subsystem.class)); Collection<Subsystem> usedSubsystems = Arrays.asList( mock(Subsystem.class), ...
public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } }
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } }
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
RequirementsControl { public void updateRequirementsNoCurrentAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { mActionsOnRequirement.remove(requirement); } } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defau...
@Test public void updateRequirementsWithNewRunningAction_actionWithSomeRequirements_addsRequirementsToMap() throws Exception { Collection<Subsystem> otherSubsystems = Arrays.asList( mock(Subsystem.class), mock(Subsystem.class), mock(Subsystem.class)); Collection<Subsystem> usedSubsystems = Arrays.asList( mock(Subsystem...
public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.warn("Requirements confli...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
@Test public void updateRequirementsWithNewRunningAction_requirementHasAction_cancelsAction() throws Exception { Subsystem subsystem = mock(Subsystem.class); Action action = mock(Action.class); mActionsOnSubsystems.put(subsystem, action); Action newAction = ActionsMock.actionMocker() .mockWithRequirements(Collections.s...
public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.warn("Requirements confli...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
@Test public void updateRequirementsWithNewRunningAction_requirementHasAction_replacesAction() throws Exception { Subsystem subsystem = mock(Subsystem.class); Action action = mock(Action.class); mActionsOnSubsystems.put(subsystem, action); Action newAction = ActionsMock.actionMocker() .mockWithRequirements(Collections....
public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.warn("Requirements confli...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
RequirementsControl { public void updateRequirementsWithNewRunningAction(Action action) { for (Requirement requirement : action.getConfiguration().getRequirements()) { if (mActionsOnRequirement.containsKey(requirement)) { Action currentAction = mActionsOnRequirement.get(requirement); currentAction.cancel(); mLogger.war...
@Test public void getActionOnSubsystem_forSubsystemWithAction_returnsAction() throws Exception { Subsystem subsystem = mock(Subsystem.class); Action action = mock(Action.class); mActionsOnSubsystems.put(subsystem, action); Optional<Action> optionalAction = mRequirementsControl.getActionOnRequirement(subsystem); assertT...
public Optional<Action> getActionOnRequirement(Requirement requirement) { return Optional.ofNullable(mActionsOnRequirement.get(requirement)); }
RequirementsControl { public Optional<Action> getActionOnRequirement(Requirement requirement) { return Optional.ofNullable(mActionsOnRequirement.get(requirement)); } }
RequirementsControl { public Optional<Action> getActionOnRequirement(Requirement requirement) { return Optional.ofNullable(mActionsOnRequirement.get(requirement)); } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defaultActionsOnSubsystems); RequirementsControl...
RequirementsControl { public Optional<Action> getActionOnRequirement(Requirement requirement) { return Optional.ofNullable(mActionsOnRequirement.get(requirement)); } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defaultActionsOnSubsystems); RequirementsControl...
RequirementsControl { public Optional<Action> getActionOnRequirement(Requirement requirement) { return Optional.ofNullable(mActionsOnRequirement.get(requirement)); } RequirementsControl(Logger logger, Map<Requirement, Action> actionsOnRequirement, Map<Subsystem, Action> defaultActionsOnSubsystems); RequirementsControl...
@Test public void testRun() { incFinder.run(); }
@Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume); fireNumberOfConflictsFound(checker.getExplanations().size()); if(checker.terminati...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
@Test public void testGetExplanations() { incFinder.run(); Set<Explanation<OWLAxiom>> explanations = incFinder.getExplanations(); for (Explanation<OWLAxiom> explanation : explanations) { System.out.println(explanation.getAxioms()); } }
@Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume); fireNumberOfConflictsFound(checker.getExplanations().size()); if(checker.terminati...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
SPARQLBasedTrivialInconsistencyFinder extends AbstractTrivialInconsistencyFinder { @Override public void run(boolean resume) { for(AbstractTrivialInconsistencyFinder checker : incFinders){ if(!(checker instanceof InverseFunctionalityBasedInconsistencyFinder) || isApplyUniqueNameAssumption()){ try { checker.run(resume);...
@Test public void testGenerateRandomInstrument() throws Exception { GenerateRandomInstruments ranIns = new GenerateRandomInstruments(); assert (ranIns.createRandomData(50).size() == 50); }
public List<Trade> createRandomData(int number) throws Exception { return null; }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } Trade createTradeData(int number, List<Party> partyList, List<Instrument> instrumentList); List<Trade> createRandomData(int number); }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } Trade createTradeData(int number, List<Party> partyList, List<Instrument> instrumentList); List<Trade> createRandomData(int number); }
@Test public void testGeneratePartyData() throws Exception { GenerateRandomParty ransPty = new GenerateRandomParty(); assert (ransPty.createRandomData(50).size() == 50); }
public List<Trade> createRandomData(int number) throws Exception { return null; }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } Trade createTradeData(int number, List<Party> partyList, List<Instrument> instrumentList); List<Trade> createRandomData(int number); }
GenerateTradeData { public List<Trade> createRandomData(int number) throws Exception { return null; } Trade createTradeData(int number, List<Party> partyList, List<Instrument> instrumentList); List<Trade> createRandomData(int number); }
@Test public void testTruncateSuffix() throws IOException { String raftDataDir = "./data"; SegmentedLog segmentedLog = new SegmentedLog(raftDataDir, 32); Assert.assertTrue(segmentedLog.getFirstLogIndex() == 1); List<RaftProto.LogEntry> entries = new ArrayList<>(); for (int i = 1; i < 10; i++) { RaftProto.LogEntry entry...
public void truncateSuffix(long newEndIndex) { if (newEndIndex >= getLastLogIndex()) { return; } LOG.info("Truncating log from old end index {} to new end index {}", getLastLogIndex(), newEndIndex); while (!startLogIndexSegmentMap.isEmpty()) { Segment segment = startLogIndexSegmentMap.lastEntry().getValue(); try { if (...
SegmentedLog { public void truncateSuffix(long newEndIndex) { if (newEndIndex >= getLastLogIndex()) { return; } LOG.info("Truncating log from old end index {} to new end index {}", getLastLogIndex(), newEndIndex); while (!startLogIndexSegmentMap.isEmpty()) { Segment segment = startLogIndexSegmentMap.lastEntry().getValu...
SegmentedLog { public void truncateSuffix(long newEndIndex) { if (newEndIndex >= getLastLogIndex()) { return; } LOG.info("Truncating log from old end index {} to new end index {}", getLastLogIndex(), newEndIndex); while (!startLogIndexSegmentMap.isEmpty()) { Segment segment = startLogIndexSegmentMap.lastEntry().getValu...
SegmentedLog { public void truncateSuffix(long newEndIndex) { if (newEndIndex >= getLastLogIndex()) { return; } LOG.info("Truncating log from old end index {} to new end index {}", getLastLogIndex(), newEndIndex); while (!startLogIndexSegmentMap.isEmpty()) { Segment segment = startLogIndexSegmentMap.lastEntry().getValu...
SegmentedLog { public void truncateSuffix(long newEndIndex) { if (newEndIndex >= getLastLogIndex()) { return; } LOG.info("Truncating log from old end index {} to new end index {}", getLastLogIndex(), newEndIndex); while (!startLogIndexSegmentMap.isEmpty()) { Segment segment = startLogIndexSegmentMap.lastEntry().getValu...
@Test public void testReadSnapshotDataFiles() throws IOException { String raftDataDir = "./data"; File file = new File("./data/message"); file.mkdirs(); File file1 = new File("./data/message/queue1.txt"); file1.createNewFile(); File file2 = new File("./data/message/queue2.txt"); file2.createNewFile(); File snapshotFile...
public TreeMap<String, SnapshotDataFile> openSnapshotDataFiles() { TreeMap<String, SnapshotDataFile> snapshotDataFileMap = new TreeMap<>(); String snapshotDataDir = snapshotDir + File.separator + "data"; try { Path snapshotDataPath = FileSystems.getDefault().getPath(snapshotDataDir); snapshotDataPath = snapshotDataPath...
Snapshot { public TreeMap<String, SnapshotDataFile> openSnapshotDataFiles() { TreeMap<String, SnapshotDataFile> snapshotDataFileMap = new TreeMap<>(); String snapshotDataDir = snapshotDir + File.separator + "data"; try { Path snapshotDataPath = FileSystems.getDefault().getPath(snapshotDataDir); snapshotDataPath = snaps...
Snapshot { public TreeMap<String, SnapshotDataFile> openSnapshotDataFiles() { TreeMap<String, SnapshotDataFile> snapshotDataFileMap = new TreeMap<>(); String snapshotDataDir = snapshotDir + File.separator + "data"; try { Path snapshotDataPath = FileSystems.getDefault().getPath(snapshotDataDir); snapshotDataPath = snaps...
Snapshot { public TreeMap<String, SnapshotDataFile> openSnapshotDataFiles() { TreeMap<String, SnapshotDataFile> snapshotDataFileMap = new TreeMap<>(); String snapshotDataDir = snapshotDir + File.separator + "data"; try { Path snapshotDataPath = FileSystems.getDefault().getPath(snapshotDataDir); snapshotDataPath = snaps...
Snapshot { public TreeMap<String, SnapshotDataFile> openSnapshotDataFiles() { TreeMap<String, SnapshotDataFile> snapshotDataFileMap = new TreeMap<>(); String snapshotDataDir = snapshotDir + File.separator + "data"; try { Path snapshotDataPath = FileSystems.getDefault().getPath(snapshotDataDir); snapshotDataPath = snaps...
@Test public void testNewInjectedRowBuilder() { MergedItem mergedItem = MergedItem.newInjectedRow(1); assertThat(mergedItem.injected, is(true)); assertThat(mergedItem.type, is(1)); assertThat(mergedItem.id, is(1L)); }
static MergedItem newInjectedRow(int type) { return new MergedItem(type, type, true); }
MergedItem { static MergedItem newInjectedRow(int type) { return new MergedItem(type, type, true); } }
MergedItem { static MergedItem newInjectedRow(int type) { return new MergedItem(type, type, true); } private MergedItem(int type, long id, boolean injected); }
MergedItem { static MergedItem newInjectedRow(int type) { return new MergedItem(type, type, true); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
MergedItem { static MergedItem newInjectedRow(int type) { return new MergedItem(type, type, true); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
@Test public void hidesInjectedItemsOnEmptyChildItemsIfNotAllowed() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); ItemsMerger itemsMerger = new ItemsMerger( createItemsDataProvider(Arrays.asList(Injected_0_1, Injected_5_1), Collections.<Item>emptyList()), createMergeOptio...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void showsInjectedItemsOnCorrectPositionOnNonEmptyChildItems() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); List<Item> childItems = createChildItem(1, 1, 50); ItemsMerger itemsMerger = new ItemsMerger( createItemsDataProvider(Arrays.asList(Injected_0_1, Inje...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void hidesInjectedItemsOnHigherPositionOnNonEmptyChildItemsIfNotAllowed() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); Item Injected_5_2 = createInjectedItem(60, 2); List<Item> childItems = createChildItem(1, 1, 50); ItemsMerger itemsMerger = new ItemsMerger...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void showsInjectedItemsOnHigherPositionOnNonEmptyChildItemsIfAllowed() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); Item Injected_5_2 = createInjectedItem(60, 2); List<Item> childItems = createChildItem(1, 1, 50); ItemsMerger itemsMerger = new ItemsMerger( c...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void testNewRowBuilder() { MergedItem mergedItem = MergedItem.newRow(1, 2L); assertThat(mergedItem.injected, is(false)); assertThat(mergedItem.type, is(1)); assertThat(mergedItem.id, is(2L)); }
static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
@Test public void testMergedItemEqual() { MergedItem mergedItem1 = MergedItem.newRow(1, 2L); MergedItem mergedItem2 = MergedItem.newRow(1, 2L); MergedItem mergedItem3 = MergedItem.newRow(1, 3L); assertThat(mergedItem1, is(mergedItem2)); assertThat(mergedItem1, is(not(mergedItem3))); }
static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
MergedItem { static MergedItem newRow(int type, long id) { return new MergedItem(type, id, false); } private MergedItem(int type, long id, boolean injected); @Override boolean equals(Object o); }
@Test public void calculateFromChildItemPositionTranslationVector() throws Exception { testFromChildVectorValue(Collections.<Integer>emptyList(), new int[]{ 0 }); testFromChildVectorValue(new ArrayList<Integer>() {{ add(0); }}, new int[]{ 1 }); testFromChildVectorValue(new ArrayList<Integer>() {{ add(1); add(2); add(3)...
int[] calculateFromChildItemPositionTranslationVector() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int vectorSize = maxInjectedItemPosition - dataProvider.getInjectedItemCount() + 2; int[] vector = new int[vectorSize]; int accumulator = 0; int vectorIndex...
VectorCalculator { int[] calculateFromChildItemPositionTranslationVector() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int vectorSize = maxInjectedItemPosition - dataProvider.getInjectedItemCount() + 2; int[] vector = new int[vectorSize]; int accumulator =...
VectorCalculator { int[] calculateFromChildItemPositionTranslationVector() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int vectorSize = maxInjectedItemPosition - dataProvider.getInjectedItemCount() + 2; int[] vector = new int[vectorSize]; int accumulator =...
VectorCalculator { int[] calculateFromChildItemPositionTranslationVector() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int vectorSize = maxInjectedItemPosition - dataProvider.getInjectedItemCount() + 2; int[] vector = new int[vectorSize]; int accumulator =...
VectorCalculator { int[] calculateFromChildItemPositionTranslationVector() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int vectorSize = maxInjectedItemPosition - dataProvider.getInjectedItemCount() + 2; int[] vector = new int[vectorSize]; int accumulator =...
@Test public void calculateNumberOfInjectedItemsUpToPosition() throws Exception { testNumberOfInjectedItemsVectorValue(Collections.<Integer>emptyList(), new int[]{ 0 }); testNumberOfInjectedItemsVectorValue(new ArrayList<Integer>() {{ add(0); }}, new int[]{ 1 }); testNumberOfInjectedItemsVectorValue(new ArrayList<Integ...
int[] calculateNumberOfInjectedItemsUpToPosition() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int[] vector = new int[maxInjectedItemPosition + 1]; int previousValue = 0; for (int i = 0; i < vector.length; i++) { vector[i] = previousValue + (dataProvider.i...
VectorCalculator { int[] calculateNumberOfInjectedItemsUpToPosition() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int[] vector = new int[maxInjectedItemPosition + 1]; int previousValue = 0; for (int i = 0; i < vector.length; i++) { vector[i] = previousValu...
VectorCalculator { int[] calculateNumberOfInjectedItemsUpToPosition() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int[] vector = new int[maxInjectedItemPosition + 1]; int previousValue = 0; for (int i = 0; i < vector.length; i++) { vector[i] = previousValu...
VectorCalculator { int[] calculateNumberOfInjectedItemsUpToPosition() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int[] vector = new int[maxInjectedItemPosition + 1]; int previousValue = 0; for (int i = 0; i < vector.length; i++) { vector[i] = previousValu...
VectorCalculator { int[] calculateNumberOfInjectedItemsUpToPosition() { int maxInjectedItemPosition = getMaxInjectedItemPosition(); if (maxInjectedItemPosition != NO_POSITION) { int[] vector = new int[maxInjectedItemPosition + 1]; int previousValue = 0; for (int i = 0; i < vector.length; i++) { vector[i] = previousValu...
@Test public void returnsCorrectSizeOfOldList() { MergedListDiffer mergedListDiffer = new MergedListDiffer(); mergedListDiffer.updateData(new ArrayList<MergedItem>() {{ add(MergedItem.newInjectedRow(2)); add(MergedItem.newInjectedRow(3)); }}, Collections.<MergedItem>emptyList()); }
void updateData(List<MergedItem> oldList, List<MergedItem> newList) { this.oldList = oldList; this.newList = newList; }
MergedListDiffer extends DiffUtil.Callback { void updateData(List<MergedItem> oldList, List<MergedItem> newList) { this.oldList = oldList; this.newList = newList; } }
MergedListDiffer extends DiffUtil.Callback { void updateData(List<MergedItem> oldList, List<MergedItem> newList) { this.oldList = oldList; this.newList = newList; } }
MergedListDiffer extends DiffUtil.Callback { void updateData(List<MergedItem> oldList, List<MergedItem> newList) { this.oldList = oldList; this.newList = newList; } @Override int getOldListSize(); @Override int getNewListSize(); @Override boolean areItemsTheSame(int oldItemPosition, int newItemPosition); @Override boo...
MergedListDiffer extends DiffUtil.Callback { void updateData(List<MergedItem> oldList, List<MergedItem> newList) { this.oldList = oldList; this.newList = newList; } @Override int getOldListSize(); @Override int getNewListSize(); @Override boolean areItemsTheSame(int oldItemPosition, int newItemPosition); @Override boo...
@Test public void testAreItemsTheSame() { MergedListDiffer mergedListDiffer = new MergedListDiffer(); mergedListDiffer.updateData(new ArrayList<MergedItem>() {{ add(MergedItem.newInjectedRow(2)); add(MergedItem.newInjectedRow(3)); }}, new ArrayList<MergedItem>() {{ add(MergedItem.newInjectedRow(2)); add(MergedItem.newI...
@Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { MergedItem oldRow = oldList.get(oldItemPosition); MergedItem newRow = newList.get(newItemPosition); return oldRow.type == newRow.type && oldRow.id == newRow.id; }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { MergedItem oldRow = oldList.get(oldItemPosition); MergedItem newRow = newList.get(newItemPosition); return oldRow.type == newRow.type && oldRow.id == newRow.id; } }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { MergedItem oldRow = oldList.get(oldItemPosition); MergedItem newRow = newList.get(newItemPosition); return oldRow.type == newRow.type && oldRow.id == newRow.id; } }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { MergedItem oldRow = oldList.get(oldItemPosition); MergedItem newRow = newList.get(newItemPosition); return oldRow.type == newRow.type && oldRow.id == newRow.id; } @Override int getOldListSi...
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { MergedItem oldRow = oldList.get(oldItemPosition); MergedItem newRow = newList.get(newItemPosition); return oldRow.type == newRow.type && oldRow.id == newRow.id; } @Override int getOldListSi...
@Test public void areContentsTheSameAlwaysReturnsTrue() { MergedListDiffer mergedListDiffer = new MergedListDiffer(); assertThat(mergedListDiffer.areContentsTheSame(1, 1), is(true)); }
@Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return true; }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return true; } }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return true; } }
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return true; } @Override int getOldListSize(); @Override int getNewListSize(); @Override boolean areItemsTheSame(int oldItemPosition, int newItemPosition); @Override boolean areContentsT...
MergedListDiffer extends DiffUtil.Callback { @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { return true; } @Override int getOldListSize(); @Override int getNewListSize(); @Override boolean areItemsTheSame(int oldItemPosition, int newItemPosition); @Override boolean areContentsT...
@Test public void hidesInjectedItemsWhenNeeded() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); List<Item> childItems = createChildItem(1, 1, 50); ItemsMerger itemsMerger = new ItemsMerger( createItemsDataProvider(Arrays.asList(Injected_0_1, Injected_5_1), childItems), cre...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void showsInjectedItemsOnEmptyChildItemsIfAllowed() { Item Injected_0_1 = createInjectedItem(0, 0); Item Injected_5_1 = createInjectedItem(5, 1); ItemsMerger itemsMerger = new ItemsMerger( createItemsDataProvider(Arrays.asList(Injected_0_1, Injected_5_1), Collections.<Item>emptyList()), createMergeOptions(...
List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
ItemsMerger { List<MergedItem> mergeItems() { MergeStrategy mergeStrategy = getMergeStrategy(); return mergeStrategy.mergeItems(); } ItemsMerger(ItemsDataProvider itemsDataProvider, MergeOptionsProvider mergeOptionsProvider); }
@Test public void testParameter() { Parameter par = new Parameter("fo<o","Hello"); assertEquals("Hello",par.getString()); par.setString("true"); assertTrue(par.getBoolean()); par.setString("3141"); assertEquals(3141,par.getInt()); par.setString("3141.0"); assertEquals(3141.0f,par.getFloat()); par.setString("3.141"); as...
public Parameter(String name) { setNameAndParent(name,null); }
Parameter implements Cloneable { public Parameter(String name) { setNameAndParent(name,null); } }
Parameter implements Cloneable { public Parameter(String name) { setNameAndParent(name,null); } Parameter(String name); Parameter(String name, boolean value); Parameter(String name, int value); Parameter(String name, long value); Parameter(String name, float value); Parameter(String name, double value); Parameter...
Parameter implements Cloneable { public Parameter(String name) { setNameAndParent(name,null); } Parameter(String name); Parameter(String name, boolean value); Parameter(String name, int value); Parameter(String name, long value); Parameter(String name, float value); Parameter(String name, double value); Parameter...
Parameter implements Cloneable { public Parameter(String name) { setNameAndParent(name,null); } Parameter(String name); Parameter(String name, boolean value); Parameter(String name, int value); Parameter(String name, long value); Parameter(String name, float value); Parameter(String name, double value); Parameter...
@Test public void testRank() { DMatrix a = new DMatrix(new double[][]{ {1.0, 3.0}, {7.0, 9.0}, }); DMatrixSvd svda = new DMatrixSvd(a); assertEqualExact(svda.rank(),2); DMatrix b = new DMatrix(new double[][]{ {1.0, 3.0}, {7.0, 9.0}, {0.0, 0.0}, }); DMatrixSvd svdb = new DMatrixSvd(b); assertEqualExact(svdb.rank(),2); D...
public int rank() { double eps = ulp(1.0); double tol = max(_m,_n)*_s[0]*eps; int r = 0; for (int i=0; i<_mn; ++i) { if (_s[i]>tol) ++r; } return r; }
DMatrixSvd { public int rank() { double eps = ulp(1.0); double tol = max(_m,_n)*_s[0]*eps; int r = 0; for (int i=0; i<_mn; ++i) { if (_s[i]>tol) ++r; } return r; } }
DMatrixSvd { public int rank() { double eps = ulp(1.0); double tol = max(_m,_n)*_s[0]*eps; int r = 0; for (int i=0; i<_mn; ++i) { if (_s[i]>tol) ++r; } return r; } DMatrixSvd(DMatrix a); }
DMatrixSvd { public int rank() { double eps = ulp(1.0); double tol = max(_m,_n)*_s[0]*eps; int r = 0; for (int i=0; i<_mn; ++i) { if (_s[i]>tol) ++r; } return r; } DMatrixSvd(DMatrix a); DMatrix getU(); DMatrix getS(); double[] getSingularValues(); DMatrix getV(); DMatrix getVTranspose(); double norm2(); double cond();...
DMatrixSvd { public int rank() { double eps = ulp(1.0); double tol = max(_m,_n)*_s[0]*eps; int r = 0; for (int i=0; i<_mn; ++i) { if (_s[i]>tol) ++r; } return r; } DMatrixSvd(DMatrix a); DMatrix getU(); DMatrix getS(); double[] getSingularValues(); DMatrix getV(); DMatrix getVTranspose(); double norm2(); double cond();...
@Test public void testInCircle() { float xxxx = 3.14159f; float yyyy = 1.00e15f; float pa[] = {xxxx,0.0f}; float pb[] = {0.0f,yyyy}; float pc[] = {0.0f,0.0f}; float pd[] = {xxxx,yyyy}; double ra,rf; trace(""); ra = Geometry.inCircle(pa,pb,pc,pd); rf = Geometry.inCircleFast(pa,pb,pc,pd); trace("0 inCircle: "+String.form...
public static double inCircle( double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; double alift ...
Geometry { public static double inCircle( double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; do...
Geometry { public static double inCircle( double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; do...
Geometry { public static double inCircle( double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; do...
Geometry { public static double inCircle( double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; do...
@Test public void testInSphere() { float xxxx = 1.0f; float yyyy = FLT_PI; float zzzz = 1.0e6f; float pa[] = {xxxx,0.0f,0.0f}; float pb[] = {0.0f,yyyy,0.0f}; float pc[] = {0.0f,0.0f,zzzz}; float pd[] = {0.0f,0.0f,0.0f}; float pe[] = {xxxx,yyyy,zzzz}; double ra,rf; trace(""); ra = Geometry.inSphere(pa,pb,pc,pd,pe); rf =...
public static double inSphere( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd, double xe, double ye, double ze) { double aex = xa - xe; double bex = xb - xe; double cex = xc - xe; double dex = xd - xe; double aey = ya - ye; double bey =...
Geometry { public static double inSphere( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd, double xe, double ye, double ze) { double aex = xa - xe; double bex = xb - xe; double cex = xc - xe; double dex = xd - xe; double aey = ya - ye; d...
Geometry { public static double inSphere( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd, double xe, double ye, double ze) { double aex = xa - xe; double bex = xb - xe; double cex = xc - xe; double dex = xd - xe; double aey = ya - ye; d...
Geometry { public static double inSphere( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd, double xe, double ye, double ze) { double aex = xa - xe; double bex = xb - xe; double cex = xc - xe; double dex = xd - xe; double aey = ya - ye; d...
Geometry { public static double inSphere( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd, double xe, double ye, double ze) { double aex = xa - xe; double bex = xb - xe; double cex = xc - xe; double dex = xd - xe; double aey = ya - ye; d...
@Test public void testLeftOfLine() { float xxxx = 2.0f; float yyyy = 1.0f; float aaaa = 1.0e15f; float pa[] = {1.0f*xxxx,1.0f*yyyy}; float pb[] = {2.0f*xxxx,2.0f*yyyy}; float pc[] = {aaaa*xxxx,aaaa*yyyy}; double ra,rf; trace(""); ra = Geometry.leftOfLine(pa,pb,pc); rf = Geometry.leftOfLineFast(pa,pb,pc); trace("0 leftO...
public static double leftOfLine( double xa, double ya, double xb, double yb, double xc, double yc) { double detleft = (xa-xc)*(yb-yc); double detright = (ya-yc)*(xb-xc); double det = detleft-detright; double detsum; if (detleft>0.0) { if (detright<=0.0) { return det; } else { detsum = detleft+detright; } } else if (det...
Geometry { public static double leftOfLine( double xa, double ya, double xb, double yb, double xc, double yc) { double detleft = (xa-xc)*(yb-yc); double detright = (ya-yc)*(xb-xc); double det = detleft-detright; double detsum; if (detleft>0.0) { if (detright<=0.0) { return det; } else { detsum = detleft+detright; } } e...
Geometry { public static double leftOfLine( double xa, double ya, double xb, double yb, double xc, double yc) { double detleft = (xa-xc)*(yb-yc); double detright = (ya-yc)*(xb-xc); double det = detleft-detright; double detsum; if (detleft>0.0) { if (detright<=0.0) { return det; } else { detsum = detleft+detright; } } e...
Geometry { public static double leftOfLine( double xa, double ya, double xb, double yb, double xc, double yc) { double detleft = (xa-xc)*(yb-yc); double detright = (ya-yc)*(xb-xc); double det = detleft-detright; double detsum; if (detleft>0.0) { if (detright<=0.0) { return det; } else { detsum = detleft+detright; } } e...
Geometry { public static double leftOfLine( double xa, double ya, double xb, double yb, double xc, double yc) { double detleft = (xa-xc)*(yb-yc); double detright = (ya-yc)*(xb-xc); double det = detleft-detright; double detsum; if (detleft>0.0) { if (detright<=0.0) { return det; } else { detsum = detleft+detright; } } e...
@Test public void testLeftOfPlane() { float xxxx = 1.0f; float yyyy = 1.0f; float zzzz = 1.0e15f; float pa[] = {xxxx,0.0f,0.1f}; float pb[] = {0.0f,yyyy,3.3f}; float pc[] = {0.0f,yyyy,6.7f}; float pd[] = {xxxx,0.0f,zzzz}; double ra,rf; trace(""); ra = Geometry.leftOfPlane(pa,pb,pc,pd); rf = Geometry.leftOfPlaneFast(pa,...
public static double leftOfPlane( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double adz = za - zd...
Geometry { public static double leftOfPlane( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double ad...
Geometry { public static double leftOfPlane( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double ad...
Geometry { public static double leftOfPlane( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double ad...
Geometry { public static double leftOfPlane( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double xd, double yd, double zd) { double adx = xa - xd; double bdx = xb - xd; double cdx = xc - xd; double ady = ya - yd; double bdy = yb - yd; double cdy = yc - yd; double ad...
@Test public void testCenterCircle3D() { double[] po = {0.0,0.0,0.0}; Geometry.centerCircle3D(0,1,0, 0,1,1, 0,0,1, po); assertTrue(po[0]==0.0); assertTrue(po[1]==0.5); assertTrue(po[2]==0.5); Geometry.centerCircle3D(0,0,1, 1,0,1, 1,0,0, po); assertTrue(po[0]==0.5); assertTrue(po[1]==0.0); assertTrue(po[2]==0.5); Geomet...
public static void centerCircle3D( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double[] po) { double acx = xa - xc; double acy = ya - yc; double acz = za - zc; double bcx = xb - xc; double bcy = yb - yc; double bcz = zb - zc; double acs = acx*acx+acy*acy+acz*acz; d...
Geometry { public static void centerCircle3D( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double[] po) { double acx = xa - xc; double acy = ya - yc; double acz = za - zc; double bcx = xb - xc; double bcy = yb - yc; double bcz = zb - zc; double acs = acx*acx+acy*acy...
Geometry { public static void centerCircle3D( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double[] po) { double acx = xa - xc; double acy = ya - yc; double acz = za - zc; double bcx = xb - xc; double bcy = yb - yc; double bcz = zb - zc; double acs = acx*acx+acy*acy...
Geometry { public static void centerCircle3D( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double[] po) { double acx = xa - xc; double acy = ya - yc; double acz = za - zc; double bcx = xb - xc; double bcy = yb - yc; double bcz = zb - zc; double acs = acx*acx+acy*acy...
Geometry { public static void centerCircle3D( double xa, double ya, double za, double xb, double yb, double zb, double xc, double yc, double zc, double[] po) { double acx = xa - xc; double acy = ya - yc; double acz = za - zc; double bcx = xb - xc; double bcy = yb - yc; double bcz = zb - zc; double acs = acx*acx+acy*acy...
@Test public void testSolve() { int n = 100; float[] a = randfloat(n); float[] b = randfloat(n); float[] c = randfloat(n); for (int i=0; i<n; ++i) b[i] += a[i]+c[i]; TridiagonalFMatrix t = new TridiagonalFMatrix(n,a,b,c); float[] r = randfloat(n); float[] u = zerofloat(n); t.solve(r,u); float[] s = t.times(u); assertEq...
public void solve(float[] r, float[] u) { if (_w==null) _w = new float[_n]; float t = _b[0]; u[0] = r[0]/t; for (int j=1; j<_n; ++j) { _w[j] = _c[j-1]/t; t = _b[j]-_a[j]*_w[j]; u[j] = (r[j]-_a[j]*u[j-1])/t; } for (int j=_n-1; j>0; --j) u[j-1] -= _w[j]*u[j]; }
TridiagonalFMatrix { public void solve(float[] r, float[] u) { if (_w==null) _w = new float[_n]; float t = _b[0]; u[0] = r[0]/t; for (int j=1; j<_n; ++j) { _w[j] = _c[j-1]/t; t = _b[j]-_a[j]*_w[j]; u[j] = (r[j]-_a[j]*u[j-1])/t; } for (int j=_n-1; j>0; --j) u[j-1] -= _w[j]*u[j]; } }
TridiagonalFMatrix { public void solve(float[] r, float[] u) { if (_w==null) _w = new float[_n]; float t = _b[0]; u[0] = r[0]/t; for (int j=1; j<_n; ++j) { _w[j] = _c[j-1]/t; t = _b[j]-_a[j]*_w[j]; u[j] = (r[j]-_a[j]*u[j-1])/t; } for (int j=_n-1; j>0; --j) u[j-1] -= _w[j]*u[j]; } TridiagonalFMatrix(int n); Tridiagonal...
TridiagonalFMatrix { public void solve(float[] r, float[] u) { if (_w==null) _w = new float[_n]; float t = _b[0]; u[0] = r[0]/t; for (int j=1; j<_n; ++j) { _w[j] = _c[j-1]/t; t = _b[j]-_a[j]*_w[j]; u[j] = (r[j]-_a[j]*u[j-1])/t; } for (int j=_n-1; j>0; --j) u[j-1] -= _w[j]*u[j]; } TridiagonalFMatrix(int n); Tridiagonal...
TridiagonalFMatrix { public void solve(float[] r, float[] u) { if (_w==null) _w = new float[_n]; float t = _b[0]; u[0] = r[0]/t; for (int j=1; j<_n; ++j) { _w[j] = _c[j-1]/t; t = _b[j]-_a[j]*_w[j]; u[j] = (r[j]-_a[j]*u[j-1])/t; } for (int j=_n-1; j>0; --j) u[j-1] -= _w[j]*u[j]; } TridiagonalFMatrix(int n); Tridiagonal...
@Test public void testRankDeficient() { DMatrix a = new DMatrix(new double[][]{ {0.0, 0.0}, {3.0, 4.0}, }); DMatrixQrd qrd = new DMatrixQrd(a); assertFalse(qrd.isFullRank()); }
public boolean isFullRank() { for (int j=0; j<_n; ++j) { if (_rdiag[j]==0.0) return false; } return true; }
DMatrixQrd { public boolean isFullRank() { for (int j=0; j<_n; ++j) { if (_rdiag[j]==0.0) return false; } return true; } }
DMatrixQrd { public boolean isFullRank() { for (int j=0; j<_n; ++j) { if (_rdiag[j]==0.0) return false; } return true; } DMatrixQrd(DMatrix a); }
DMatrixQrd { public boolean isFullRank() { for (int j=0; j<_n; ++j) { if (_rdiag[j]==0.0) return false; } return true; } DMatrixQrd(DMatrix a); boolean isFullRank(); DMatrix getQ(); DMatrix getR(); DMatrix solve(DMatrix b); }
DMatrixQrd { public boolean isFullRank() { for (int j=0; j<_n; ++j) { if (_rdiag[j]==0.0) return false; } return true; } DMatrixQrd(DMatrix a); boolean isFullRank(); DMatrix getQ(); DMatrix getR(); DMatrix solve(DMatrix b); }
@Test public void testRgbToHsl() { float r,g,b; float h,s,l; for (int i=0; i<_rgbhsl.length; ++i) { r = _rgbhsl[i][0]; g = _rgbhsl[i][1]; b = _rgbhsl[i][2]; h = _rgbhsl[i][3]; s = _rgbhsl[i][4]; l = _rgbhsl[i][5]; float[] expected = { h, s, l }; float[] test = ColorMap.rgbToHsl(r,g,b); assertEquals(expected[0],test[0],...
public static float[] rgbToHsl(float r, float g, float b) { float h,s,l; float[] hsl = new float[3]; float min = min(min(r,g),b); float max = max(max(r,g),b); l = (max+min)/2f; if (max==min) h = s = 0.0f; else { float diff = max - min; s = (l>0.5f) ? diff / (2f - max - min) : diff / (max + min); if (max==r) h = (g-b)/d...
ColorMap { public static float[] rgbToHsl(float r, float g, float b) { float h,s,l; float[] hsl = new float[3]; float min = min(min(r,g),b); float max = max(max(r,g),b); l = (max+min)/2f; if (max==min) h = s = 0.0f; else { float diff = max - min; s = (l>0.5f) ? diff / (2f - max - min) : diff / (max + min); if (max==r) ...
ColorMap { public static float[] rgbToHsl(float r, float g, float b) { float h,s,l; float[] hsl = new float[3]; float min = min(min(r,g),b); float max = max(max(r,g),b); l = (max+min)/2f; if (max==min) h = s = 0.0f; else { float diff = max - min; s = (l>0.5f) ? diff / (2f - max - min) : diff / (max + min); if (max==r) ...
ColorMap { public static float[] rgbToHsl(float r, float g, float b) { float h,s,l; float[] hsl = new float[3]; float min = min(min(r,g),b); float max = max(max(r,g),b); l = (max+min)/2f; if (max==min) h = s = 0.0f; else { float diff = max - min; s = (l>0.5f) ? diff / (2f - max - min) : diff / (max + min); if (max==r) ...
ColorMap { public static float[] rgbToHsl(float r, float g, float b) { float h,s,l; float[] hsl = new float[3]; float min = min(min(r,g),b); float max = max(max(r,g),b); l = (max+min)/2f; if (max==min) h = s = 0.0f; else { float diff = max - min; s = (l>0.5f) ? diff / (2f - max - min) : diff / (max + min); if (max==r) ...
@Test public void testHslToRgb() { float r,g,b; float h,s,l; for (int i=0; i<_rgbhsl.length; ++i) { r = _rgbhsl[i][0]; g = _rgbhsl[i][1]; b = _rgbhsl[i][2]; h = _rgbhsl[i][3]; s = _rgbhsl[i][4]; l = _rgbhsl[i][5]; float[] expected = { r, g, b }; float[] test = ColorMap.hslToRgb(h,s,l); assertEquals(expected[0],test[0],...
public static float[] hslToRgb(float h, float s, float l) { float r = 0, g = 0, b = 0; float c = (1 - Math.abs(2*l-1)) * s; float x = c * (1 - Math.abs((h/60.0f)%2-1)); float m = l - c/2.0f; if (h>= 0 && h< 60) { r = c; g = x; b = 0;} else if (h>= 60 && h<120) { r = x; g = c; b = 0;} else if (h>=120 && h<180) { r = 0; ...
ColorMap { public static float[] hslToRgb(float h, float s, float l) { float r = 0, g = 0, b = 0; float c = (1 - Math.abs(2*l-1)) * s; float x = c * (1 - Math.abs((h/60.0f)%2-1)); float m = l - c/2.0f; if (h>= 0 && h< 60) { r = c; g = x; b = 0;} else if (h>= 60 && h<120) { r = x; g = c; b = 0;} else if (h>=120 && h<180...
ColorMap { public static float[] hslToRgb(float h, float s, float l) { float r = 0, g = 0, b = 0; float c = (1 - Math.abs(2*l-1)) * s; float x = c * (1 - Math.abs((h/60.0f)%2-1)); float m = l - c/2.0f; if (h>= 0 && h< 60) { r = c; g = x; b = 0;} else if (h>= 60 && h<120) { r = x; g = c; b = 0;} else if (h>=120 && h<180...
ColorMap { public static float[] hslToRgb(float h, float s, float l) { float r = 0, g = 0, b = 0; float c = (1 - Math.abs(2*l-1)) * s; float x = c * (1 - Math.abs((h/60.0f)%2-1)); float m = l - c/2.0f; if (h>= 0 && h< 60) { r = c; g = x; b = 0;} else if (h>= 60 && h<120) { r = x; g = c; b = 0;} else if (h>=120 && h<180...
ColorMap { public static float[] hslToRgb(float h, float s, float l) { float r = 0, g = 0, b = 0; float c = (1 - Math.abs(2*l-1)) * s; float x = c * (1 - Math.abs((h/60.0f)%2-1)); float m = l - c/2.0f; if (h>= 0 && h< 60) { r = c; g = x; b = 0;} else if (h>= 60 && h<120) { r = x; g = c; b = 0;} else if (h>=120 && h<180...
@Test public void testDefine() { boolean isValid, defined; try { isValid = Units.isValidDefinition("degrees F"); assertTrue(isValid); Units.define("degrees F",false,"degF"); defined = Units.isDefined("degrees F"); assertTrue(defined); isValid = Units.isValidDefinition("degrees C"); assertTrue(isValid); Units.define("de...
public static synchronized boolean define(String name, boolean plural, String definition) throws UnitsFormatException { return addDefinition(name,plural,definition); }
Units implements Cloneable { public static synchronized boolean define(String name, boolean plural, String definition) throws UnitsFormatException { return addDefinition(name,plural,definition); } }
Units implements Cloneable { public static synchronized boolean define(String name, boolean plural, String definition) throws UnitsFormatException { return addDefinition(name,plural,definition); } Units(); Units(String definition); }
Units implements Cloneable { public static synchronized boolean define(String name, boolean plural, String definition) throws UnitsFormatException { return addDefinition(name,plural,definition); } Units(); Units(String definition); Object clone(); boolean equals(Object object); boolean equals(Units units); float toSI(...
Units implements Cloneable { public static synchronized boolean define(String name, boolean plural, String definition) throws UnitsFormatException { return addDefinition(name,plural,definition); } Units(); Units(String definition); Object clone(); boolean equals(Object object); boolean equals(Units units); float toSI(...
@Test public void testRgbToCieLab() { float r,g,b; float Ls,as,bs; for (int i=0; i<_rgbcielab.length; ++i) { r = _rgbcielab[i][0]; g = _rgbcielab[i][1]; b = _rgbcielab[i][2]; Ls = _rgbcielab[i][3]; as = _rgbcielab[i][4]; bs = _rgbcielab[i][5]; float[] expected = { Ls, as, bs }; float[] test = ColorMap.rgbToCieLab(r,g,b...
public static float[] rgbToCieLab(float[] rgb) { float[] xyz = rgbToCieXyz(rgb); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]/=Xn; xyz[1]/=Yn; xyz[2]/=Zn; return cieXyzToCieLab(xyz); }
ColorMap { public static float[] rgbToCieLab(float[] rgb) { float[] xyz = rgbToCieXyz(rgb); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]/=Xn; xyz[1]/=Yn; xyz[2]/=Zn; return cieXyzToCieLab(xyz); } }
ColorMap { public static float[] rgbToCieLab(float[] rgb) { float[] xyz = rgbToCieXyz(rgb); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]/=Xn; xyz[1]/=Yn; xyz[2]/=Zn; return cieXyzToCieLab(xyz); } ColorMap(IndexColorModel colorModel); ColorMap(double vmin, double vmax, IndexColorModel colorModel...
ColorMap { public static float[] rgbToCieLab(float[] rgb) { float[] xyz = rgbToCieXyz(rgb); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]/=Xn; xyz[1]/=Yn; xyz[2]/=Zn; return cieXyzToCieLab(xyz); } ColorMap(IndexColorModel colorModel); ColorMap(double vmin, double vmax, IndexColorModel colorModel...
ColorMap { public static float[] rgbToCieLab(float[] rgb) { float[] xyz = rgbToCieXyz(rgb); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]/=Xn; xyz[1]/=Yn; xyz[2]/=Zn; return cieXyzToCieLab(xyz); } ColorMap(IndexColorModel colorModel); ColorMap(double vmin, double vmax, IndexColorModel colorModel...
@Test public void testCieLabToRgb() { float r,g,b; float Ls,as,bs; for (int i=0; i<_rgbcielab.length; ++i) { r = _rgbcielab[i][0]; g = _rgbcielab[i][1]; b = _rgbcielab[i][2]; Ls = _rgbcielab[i][3]; as = _rgbcielab[i][4]; bs = _rgbcielab[i][5]; float[] expected = { r, g, b }; float[] test = ColorMap.cieLabToRgb(Ls,as,bs...
public static float[] cieLabToRgb(float[] lab) { float[] xyz = cieLabToCieXyz(lab); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]*=Xn; xyz[1]*=Yn; xyz[2]*=Zn; float[] rgb = cieXyzToRgb(xyz); rgb[0] = min(1.0f,max(0.0f,rgb[0])); rgb[1] = min(1.0f,max(0.0f,rgb[1])); rgb[2] = min(1.0f,max(0.0f,rgb[2...
ColorMap { public static float[] cieLabToRgb(float[] lab) { float[] xyz = cieLabToCieXyz(lab); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]*=Xn; xyz[1]*=Yn; xyz[2]*=Zn; float[] rgb = cieXyzToRgb(xyz); rgb[0] = min(1.0f,max(0.0f,rgb[0])); rgb[1] = min(1.0f,max(0.0f,rgb[1])); rgb[2] = min(1.0f,max...
ColorMap { public static float[] cieLabToRgb(float[] lab) { float[] xyz = cieLabToCieXyz(lab); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]*=Xn; xyz[1]*=Yn; xyz[2]*=Zn; float[] rgb = cieXyzToRgb(xyz); rgb[0] = min(1.0f,max(0.0f,rgb[0])); rgb[1] = min(1.0f,max(0.0f,rgb[1])); rgb[2] = min(1.0f,max...
ColorMap { public static float[] cieLabToRgb(float[] lab) { float[] xyz = cieLabToCieXyz(lab); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]*=Xn; xyz[1]*=Yn; xyz[2]*=Zn; float[] rgb = cieXyzToRgb(xyz); rgb[0] = min(1.0f,max(0.0f,rgb[0])); rgb[1] = min(1.0f,max(0.0f,rgb[1])); rgb[2] = min(1.0f,max...
ColorMap { public static float[] cieLabToRgb(float[] lab) { float[] xyz = cieLabToCieXyz(lab); float Xn = 95.047f; float Yn = 100.000f; float Zn = 108.883f; xyz[0]*=Xn; xyz[1]*=Yn; xyz[2]*=Zn; float[] rgb = cieXyzToRgb(xyz); rgb[0] = min(1.0f,max(0.0f,rgb[0])); rgb[1] = min(1.0f,max(0.0f,rgb[1])); rgb[2] = min(1.0f,max...
@Test public void testErrorAndFrequency() { for (double emax:_emaxs) { for (double fmax:_fmaxs) { SincInterpolator si = SincInterpolator.fromErrorAndFrequency(emax,fmax); testInterpolator(si); } } }
public static SincInterpolator fromErrorAndFrequency( double emax, double fmax) { return new SincInterpolator(emax,fmax,0); }
SincInterpolator { public static SincInterpolator fromErrorAndFrequency( double emax, double fmax) { return new SincInterpolator(emax,fmax,0); } }
SincInterpolator { public static SincInterpolator fromErrorAndFrequency( double emax, double fmax) { return new SincInterpolator(emax,fmax,0); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); }
SincInterpolator { public static SincInterpolator fromErrorAndFrequency( double emax, double fmax) { return new SincInterpolator(emax,fmax,0); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolato...
SincInterpolator { public static SincInterpolator fromErrorAndFrequency( double emax, double fmax) { return new SincInterpolator(emax,fmax,0); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolato...
@Test public void testErrorAndLength() { for (double emax:_emaxs) { for (int lmax:_lmaxs) { SincInterpolator si = SincInterpolator.fromErrorAndLength(emax,lmax); testInterpolator(si); } } }
public static SincInterpolator fromErrorAndLength( double emax, int lmax) { return new SincInterpolator(emax,0.0,lmax); }
SincInterpolator { public static SincInterpolator fromErrorAndLength( double emax, int lmax) { return new SincInterpolator(emax,0.0,lmax); } }
SincInterpolator { public static SincInterpolator fromErrorAndLength( double emax, int lmax) { return new SincInterpolator(emax,0.0,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); }
SincInterpolator { public static SincInterpolator fromErrorAndLength( double emax, int lmax) { return new SincInterpolator(emax,0.0,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolator fr...
SincInterpolator { public static SincInterpolator fromErrorAndLength( double emax, int lmax) { return new SincInterpolator(emax,0.0,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolator fr...
@Test public void testFrequencyAndLength() { for (double fmax:_fmaxs) { for (int lmax:_lmaxs) { if ((1.0-2.0*fmax)*lmax>1.0) { SincInterpolator si = SincInterpolator.fromFrequencyAndLength(fmax,lmax); testInterpolator(si); } } } }
public static SincInterpolator fromFrequencyAndLength( double fmax, int lmax) { return new SincInterpolator(0.0,fmax,lmax); }
SincInterpolator { public static SincInterpolator fromFrequencyAndLength( double fmax, int lmax) { return new SincInterpolator(0.0,fmax,lmax); } }
SincInterpolator { public static SincInterpolator fromFrequencyAndLength( double fmax, int lmax) { return new SincInterpolator(0.0,fmax,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); }
SincInterpolator { public static SincInterpolator fromFrequencyAndLength( double fmax, int lmax) { return new SincInterpolator(0.0,fmax,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolato...
SincInterpolator { public static SincInterpolator fromFrequencyAndLength( double fmax, int lmax) { return new SincInterpolator(0.0,fmax,lmax); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax); static SincInterpolator fromErrorAndLength( double emax, int lmax); static SincInterpolato...
@Test public void testAccumulate() { Random random = new Random(123456); for (int repeat=0; repeat<5; ++repeat) { for (SincInterpolator.Extrapolation extrapolation: SincInterpolator.Extrapolation.values()) { int nxu = 201; double fxu = Math.PI; double dxu = Math.E; double exu = fxu + dxu*(nxu-1); float[] yu = new float...
public void accumulate( double xa, float ya, int nxu, double dxu, double fxu, float[] yu) { double xscale = 1.0/dxu; double xshift = _lsinc-fxu*xscale; int nxum = nxu-_lsinc; accumulate(xscale,xshift,nxum,xa,ya,nxu,yu); }
SincInterpolator { public void accumulate( double xa, float ya, int nxu, double dxu, double fxu, float[] yu) { double xscale = 1.0/dxu; double xshift = _lsinc-fxu*xscale; int nxum = nxu-_lsinc; accumulate(xscale,xshift,nxum,xa,ya,nxu,yu); } }
SincInterpolator { public void accumulate( double xa, float ya, int nxu, double dxu, double fxu, float[] yu) { double xscale = 1.0/dxu; double xshift = _lsinc-fxu*xscale; int nxum = nxu-_lsinc; accumulate(xscale,xshift,nxum,xa,ya,nxu,yu); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax)...
SincInterpolator { public void accumulate( double xa, float ya, int nxu, double dxu, double fxu, float[] yu) { double xscale = 1.0/dxu; double xshift = _lsinc-fxu*xscale; int nxum = nxu-_lsinc; accumulate(xscale,xshift,nxum,xa,ya,nxu,yu); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax)...
SincInterpolator { public void accumulate( double xa, float ya, int nxu, double dxu, double fxu, float[] yu) { double xscale = 1.0/dxu; double xshift = _lsinc-fxu*xscale; int nxum = nxu-_lsinc; accumulate(xscale,xshift,nxum,xa,ya,nxu,yu); } SincInterpolator(); private SincInterpolator(double emax,double fmax,int lmax)...
@Test public void testFrequencyResponse() { int n = 501; double sigma = 4.0; float[] x = new float[n]; x[n/2] = 1.0f; float[] ye = new float[n]; float[] yg = new float[n]; RecursiveExponentialFilter ref = new RecursiveExponentialFilter(sigma); RecursiveGaussianFilter rgf = new RecursiveGaussianFilter(sigma); ref.apply(...
public void apply(float[] x, float[] y) { apply1(x,y); }
RecursiveExponentialFilter { public void apply(float[] x, float[] y) { apply1(x,y); } }
RecursiveExponentialFilter { public void apply(float[] x, float[] y) { apply1(x,y); } RecursiveExponentialFilter(double sigma); RecursiveExponentialFilter(double sigma1, double sigma23); RecursiveExponentialFilter( double sigma1, double sigma2, double sigma3); }
RecursiveExponentialFilter { public void apply(float[] x, float[] y) { apply1(x,y); } RecursiveExponentialFilter(double sigma); RecursiveExponentialFilter(double sigma1, double sigma23); RecursiveExponentialFilter( double sigma1, double sigma2, double sigma3); void setEdges(Edges edges); void apply(float[] x, flo...
RecursiveExponentialFilter { public void apply(float[] x, float[] y) { apply1(x,y); } RecursiveExponentialFilter(double sigma); RecursiveExponentialFilter(double sigma1, double sigma23); RecursiveExponentialFilter( double sigma1, double sigma2, double sigma3); void setEdges(Edges edges); void apply(float[] x, flo...
@Test public void testApply() { int[] nmax_test = {NMAX_DEFAULT,100000,100000,100000,100000}; float[] emax_test = {EMAX_DEFAULT,0.010f,0.010f,0.001f,0.001f}; float[] fmin_test = {FMIN_DEFAULT,0.050f,0.025f,0.100f,0.010f}; float[] fmax_test = {FMAX_DEFAULT,0.475f,0.450f,0.400f,0.490f}; int ntest = emax_test.length; for ...
public void apply(int n, float[] x, float[] y) { Conv.conv(_filter.length,-(_filter.length-1)/2,_filter,n,0,x,n,0,y); }
HilbertTransformFilter { public void apply(int n, float[] x, float[] y) { Conv.conv(_filter.length,-(_filter.length-1)/2,_filter,n,0,x,n,0,y); } }
HilbertTransformFilter { public void apply(int n, float[] x, float[] y) { Conv.conv(_filter.length,-(_filter.length-1)/2,_filter,n,0,x,n,0,y); } HilbertTransformFilter(); HilbertTransformFilter(int nmax, float emax, float fmin, float fmax); }
HilbertTransformFilter { public void apply(int n, float[] x, float[] y) { Conv.conv(_filter.length,-(_filter.length-1)/2,_filter,n,0,x,n,0,y); } HilbertTransformFilter(); HilbertTransformFilter(int nmax, float emax, float fmin, float fmax); void apply(int n, float[] x, float[] y); int ...
HilbertTransformFilter { public void apply(int n, float[] x, float[] y) { Conv.conv(_filter.length,-(_filter.length-1)/2,_filter,n,0,x,n,0,y); } HilbertTransformFilter(); HilbertTransformFilter(int nmax, float emax, float fmin, float fmax); void apply(int n, float[] x, float[] y); int ...
@Test public void test1Random() { int ntest = 1000; int nmin = 1; int nmax = 8; for (int itest=0; itest<ntest; ++itest) { int nh = nmin+_random.nextInt(1+nmax-nmin); int nx = nmin+_random.nextInt(1+nmax-nmin); int ny = nx; int nz = nx; int kh = _random.nextInt(nh); float[] h = randfloat(nh); float[] x = randfloat(nx); ...
public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
@Test public void test2Random() { int ntest = 1000; int nmin = 1; int nmax = 8; for (int itest=0; itest<ntest; ++itest) { int nh1 = nmin+_random.nextInt(1+nmax-nmin); int nh2 = nmin+_random.nextInt(1+nmax-nmin); int nx1 = nmin+_random.nextInt(1+nmax-nmin); int nx2 = nmin+_random.nextInt(1+nmax-nmin); int ny1 = nx1; int...
public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
@Test public void testUnsafe() { final Unsafe<Worker> nts = new Unsafe<Worker>(); loop(20,new LoopInt() { public void compute(int i) { Worker w = nts.get(); if (w==null) nts.set(w=new Worker()); w.work(); } }); }
public static void loop(int end, LoopInt body) { loop(0,end,1,1,body); }
Parallel { public static void loop(int end, LoopInt body) { loop(0,end,1,1,body); } }
Parallel { public static void loop(int end, LoopInt body) { loop(0,end,1,1,body); } }
Parallel { public static void loop(int end, LoopInt body) { loop(0,end,1,1,body); } static void loop(int end, LoopInt body); static void loop(int begin, int end, LoopInt body); static void loop(int begin, int end, int step, LoopInt body); static void loop( int begin, int end, int step, int chunk, LoopInt body); st...
Parallel { public static void loop(int end, LoopInt body) { loop(0,end,1,1,body); } static void loop(int end, LoopInt body); static void loop(int begin, int end, LoopInt body); static void loop(int begin, int end, int step, LoopInt body); static void loop( int begin, int end, int step, int chunk, LoopInt body); st...
@Test public void test3Random() { int ntest = 100; int nmin = 1; int nmax = 8; for (int itest=0; itest<ntest; ++itest) { int nh1 = nmin+_random.nextInt(1+nmax-nmin); int nh2 = nmin+_random.nextInt(1+nmax-nmin); int nh3 = nmin+_random.nextInt(1+nmax-nmin); int nx1 = nmin+_random.nextInt(1+nmax-nmin); int nx2 = nmin+_ran...
public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); }
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
FftFilter { public float[] apply(float[] x) { float[] y = new float[x.length]; apply(x,y); return y; } FftFilter(float[] h); FftFilter(int kh, float[] h); FftFilter(float[][] h); FftFilter(int kh1, int kh2, float[][] h); FftFilter(float[][][] h); FftFilter(int kh1, int kh2, int kh3, float[][][] h); void setExtrapo...
@Test public void testSymmetric22() { int nrand = 10000; double[][] v = new double[2][2]; double[] d = new double[2]; for (int irand=0; irand<nrand; ++irand) { double[][] a = randdouble(2,2); a = add(a, transpose(a)); Eigen.solveSymmetric22(a,v,d); check(a,v,d); } }
public static void solveSymmetric22(float[][] a, float[][] v, float[] d) { float a00 = a[0][0]; float a01 = a[0][1], a11 = a[1][1]; float v00 = 1.0f, v01 = 0.0f; float v10 = 0.0f, v11 = 1.0f; if (a01!=0.0f) { float tiny = 0.1f*sqrt(FLT_EPSILON); float c,r,s,t,u,vpr,vqr; u = a11-a00; if (abs(a01)<tiny*abs(u)) { t = a01/...
Eigen { public static void solveSymmetric22(float[][] a, float[][] v, float[] d) { float a00 = a[0][0]; float a01 = a[0][1], a11 = a[1][1]; float v00 = 1.0f, v01 = 0.0f; float v10 = 0.0f, v11 = 1.0f; if (a01!=0.0f) { float tiny = 0.1f*sqrt(FLT_EPSILON); float c,r,s,t,u,vpr,vqr; u = a11-a00; if (abs(a01)<tiny*abs(u)) { ...
Eigen { public static void solveSymmetric22(float[][] a, float[][] v, float[] d) { float a00 = a[0][0]; float a01 = a[0][1], a11 = a[1][1]; float v00 = 1.0f, v01 = 0.0f; float v10 = 0.0f, v11 = 1.0f; if (a01!=0.0f) { float tiny = 0.1f*sqrt(FLT_EPSILON); float c,r,s,t,u,vpr,vqr; u = a11-a00; if (abs(a01)<tiny*abs(u)) { ...
Eigen { public static void solveSymmetric22(float[][] a, float[][] v, float[] d) { float a00 = a[0][0]; float a01 = a[0][1], a11 = a[1][1]; float v00 = 1.0f, v01 = 0.0f; float v10 = 0.0f, v11 = 1.0f; if (a01!=0.0f) { float tiny = 0.1f*sqrt(FLT_EPSILON); float c,r,s,t,u,vpr,vqr; u = a11-a00; if (abs(a01)<tiny*abs(u)) { ...
Eigen { public static void solveSymmetric22(float[][] a, float[][] v, float[] d) { float a00 = a[0][0]; float a01 = a[0][1], a11 = a[1][1]; float v00 = 1.0f, v01 = 0.0f; float v10 = 0.0f, v11 = 1.0f; if (a01!=0.0f) { float tiny = 0.1f*sqrt(FLT_EPSILON); float c,r,s,t,u,vpr,vqr; u = a11-a00; if (abs(a01)<tiny*abs(u)) { ...
@Test public void testSymmetric33() { double[][] v = new double[3][3]; double[] d = new double[3]; int nrand = 10000; for (int irand=0; irand<nrand; ++irand) { double[][] a = makeRandomSymmetric33(); Eigen.solveSymmetric33(a,v,d); check(a,v,d); } }
public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } static void solveSymmetric22(float[][] a, float[][] v, float[] d); static void solveSymmetric22(double[][] a, double[][] v, double[] d); static void solveSymmetric33(double[][] a, double[][] v, double...
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } static void solveSymmetric22(float[][] a, float[][] v, float[] d); static void solveSymmetric22(double[][] a, double[][] v, double[] d); static void solveSymmetric33(double[][] a, double[][] v, double...
@Test public void testSymmetric33Special() { double[][] v = new double[3][3]; double[] d = new double[3]; double[][][] as = {ASMALL,A100,A110,A111,ATEST1}; for (double[][] a:as) { Eigen.solveSymmetric33(a,v,d); check(a,v,d); } }
public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } }
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } static void solveSymmetric22(float[][] a, float[][] v, float[] d); static void solveSymmetric22(double[][] a, double[][] v, double[] d); static void solveSymmetric33(double[][] a, double[][] v, double...
Eigen { public static void solveSymmetric33(double[][] a, double[][] v, double[] d) { solveSymmetric33Jacobi(a,v,d); } static void solveSymmetric22(float[][] a, float[][] v, float[] d); static void solveSymmetric22(double[][] a, double[][] v, double[] d); static void solveSymmetric33(double[][] a, double[][] v, double...
@Test public void test2() { double sigma = 8.0; int n1 = 1+4*(int)(3*sigma); int n2 = n1+2; LocalOrientFilter lof = new LocalOrientFilter(sigma); float pi = FLT_PI; float[] dips = {-0.49f*pi,-0.20f*pi,-0.01f,0.01f,0.20f*pi,0.49f*pi}; for (float dip:dips) { float k = 0.3f; float c = k*cos(dip); float s = k*sin(dip); flo...
public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[nt++] = v1; if (v2!=...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
@Test public void test3Planar() { double sigma = 6.0; int n1 = 1+2*(int)(3*sigma); int n2 = n1+2; int n3 = n2+2; LocalOrientFilter lof = new LocalOrientFilter(sigma); float pi = FLT_PI; float[] azis = {-0.50f*pi,0.25f*pi,0.99f*pi}; float[] dips = { 0.01f*pi,0.20f*pi,0.49f*pi}; for (float azi:azis) { for (float dip:dips...
public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[nt++] = v1; if (v2!=...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
@Test public void test3Linear() { double sigma = 6.0; int n1 = 1+2*(int)(3*sigma); int n2 = n1+2; int n3 = n2+2; LocalOrientFilter lof = new LocalOrientFilter(sigma); float pi = FLT_PI; float[] azis = {-0.50f*pi,0.25f*pi,0.99f*pi}; float[] dips = { 0.01f*pi,0.20f*pi,0.49f*pi}; for (float azi:azis) { for (float dip:dips...
public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[nt++] = v1; if (v2!=...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
LocalOrientFilter { public void apply(float[][] x, float[][] theta, float[][] u1, float[][] u2, float[][] v1, float[][] v2, float[][] eu, float[][] ev, float[][] el) { float[][][] t = new float[8][][]; int nt = 0; if (theta!=null) t[nt++] = theta; if (u1!=null) t[nt++] = u1; if (u2!=null) t[nt++] = u2; if (v1!=null) t[...
@Test public void testMath() { Real1 ra = RAMP1; Real1 rb = RAMP1; Real1 rc = ra.plus(rb); Real1 re = RAMP2; assertRealEquals(re,rc); }
public Real1 plus(Real1 ra) { return add(this,ra); }
Real1 { public Real1 plus(Real1 ra) { return add(this,ra); } }
Real1 { public Real1 plus(Real1 ra) { return add(this,ra); } Real1(Sampling s); Real1(float[] v); Real1(Sampling s, float[] v); Real1(int n, double d, double f); Real1(int n, double d, double f, float[] v); Real1(Real1 r); }
Real1 { public Real1 plus(Real1 ra) { return add(this,ra); } Real1(Sampling s); Real1(float[] v); Real1(Sampling s, float[] v); Real1(int n, double d, double f); Real1(int n, double d, double f, float[] v); Real1(Real1 r); Sampling getSampling(); float[] getValues(); Real1 resample(Sampling s); Real1 plus(Real1 ra...
Real1 { public Real1 plus(Real1 ra) { return add(this,ra); } Real1(Sampling s); Real1(float[] v); Real1(Sampling s, float[] v); Real1(int n, double d, double f); Real1(int n, double d, double f, float[] v); Real1(Real1 r); Sampling getSampling(); float[] getValues(); Real1 resample(Sampling s); Real1 plus(Real1 ra...
@Test public void testResample() { Real1 ra = FILL1; Sampling sa = ra.getSampling(); int n1 = sa.getCount(); double d1 = sa.getDelta(); int m1 = n1/3; Sampling sb = sa.shift(-m1*d1); Real1 rb = ra.resample(sb); float[] vb = rb.getValues(); for (int i1=0; i1<m1; ++i1) assertEquals(0.0,vb[i1],0.0); for (int i1=m1; i1<n1;...
public Real1 resample(Sampling s) { Sampling t = _s; int[] overlap = t.overlapWith(s); if (overlap!=null) { int ni = overlap[0]; int it = overlap[1]; int is = overlap[2]; Real1 rt = this; Real1 rs = new Real1(s); float[] xt = rt.getValues(); float[] xs = rs.getValues(); while (--ni>=0) xs[is++] = xt[it++]; return rs; }...
Real1 { public Real1 resample(Sampling s) { Sampling t = _s; int[] overlap = t.overlapWith(s); if (overlap!=null) { int ni = overlap[0]; int it = overlap[1]; int is = overlap[2]; Real1 rt = this; Real1 rs = new Real1(s); float[] xt = rt.getValues(); float[] xs = rs.getValues(); while (--ni>=0) xs[is++] = xt[it++]; retu...
Real1 { public Real1 resample(Sampling s) { Sampling t = _s; int[] overlap = t.overlapWith(s); if (overlap!=null) { int ni = overlap[0]; int it = overlap[1]; int is = overlap[2]; Real1 rt = this; Real1 rs = new Real1(s); float[] xt = rt.getValues(); float[] xs = rs.getValues(); while (--ni>=0) xs[is++] = xt[it++]; retu...
Real1 { public Real1 resample(Sampling s) { Sampling t = _s; int[] overlap = t.overlapWith(s); if (overlap!=null) { int ni = overlap[0]; int it = overlap[1]; int is = overlap[2]; Real1 rt = this; Real1 rs = new Real1(s); float[] xt = rt.getValues(); float[] xs = rs.getValues(); while (--ni>=0) xs[is++] = xt[it++]; retu...
Real1 { public Real1 resample(Sampling s) { Sampling t = _s; int[] overlap = t.overlapWith(s); if (overlap!=null) { int ni = overlap[0]; int it = overlap[1]; int is = overlap[2]; Real1 rt = this; Real1 rs = new Real1(s); float[] xt = rt.getValues(); float[] xs = rs.getValues(); while (--ni>=0) xs[is++] = xt[it++]; retu...
@Test public void test1() { float sigma = 10.0f; int n = 1+2*(int)(sigma*4.0f); int k = (n-1)/2; float[] x = zerofloat(n); float[] y = zerofloat(n); x[k] = 1.0f; float tolerance = 0.01f*gaussian(sigma,0.0f); RecursiveGaussianFilter rf = new RecursiveGaussianFilter(sigma); rf.apply0(x,y); for (int i=0; i<n; ++i) { float...
public void apply0(float[] x, float[] y) { _filter.applyN(0,x,y); }
RecursiveGaussianFilter { public void apply0(float[] x, float[] y) { _filter.applyN(0,x,y); } }
RecursiveGaussianFilter { public void apply0(float[] x, float[] y) { _filter.applyN(0,x,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); }
RecursiveGaussianFilter { public void apply0(float[] x, float[] y) { _filter.applyN(0,x,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); void apply2(float[] x, float[] y); void apply0X(float[][] x, f...
RecursiveGaussianFilter { public void apply0(float[] x, float[] y) { _filter.applyN(0,x,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); void apply2(float[] x, float[] y); void apply0X(float[][] x, f...
@Test public void testUnweighted() { Random r = new Random(); int ntest = 100; for (int itest=0; itest<ntest; ++itest) { int n = 1+(r.nextBoolean()?r.nextInt(100):r.nextInt(10)); float[] f = randfloat(n); float[] w = fillfloat(1.0f,n); if (r.nextBoolean()) { for (int i=n/4; i<3*n/4; ++i) f[i] = f[0]; } MedianFinder mf ...
public float findMedian(float[] x) { Check.argument(_n==x.length,"length of x is valid"); copy(x,_x); int k = (_n-1)/2; quickPartialSort(k,_x); float xmed = _x[k]; if (_n%2==0) { float xmin = _x[_n-1]; for (int i=_n-2; i>k; --i) if (_x[i]<xmin) xmin = _x[i]; xmed = 0.5f*(xmed+xmin); } return xmed; }
MedianFinder { public float findMedian(float[] x) { Check.argument(_n==x.length,"length of x is valid"); copy(x,_x); int k = (_n-1)/2; quickPartialSort(k,_x); float xmed = _x[k]; if (_n%2==0) { float xmin = _x[_n-1]; for (int i=_n-2; i>k; --i) if (_x[i]<xmin) xmin = _x[i]; xmed = 0.5f*(xmed+xmin); } return xmed; } }
MedianFinder { public float findMedian(float[] x) { Check.argument(_n==x.length,"length of x is valid"); copy(x,_x); int k = (_n-1)/2; quickPartialSort(k,_x); float xmed = _x[k]; if (_n%2==0) { float xmin = _x[_n-1]; for (int i=_n-2; i>k; --i) if (_x[i]<xmin) xmin = _x[i]; xmed = 0.5f*(xmed+xmin); } return xmed; } Medi...
MedianFinder { public float findMedian(float[] x) { Check.argument(_n==x.length,"length of x is valid"); copy(x,_x); int k = (_n-1)/2; quickPartialSort(k,_x); float xmed = _x[k]; if (_n%2==0) { float xmin = _x[_n-1]; for (int i=_n-2; i>k; --i) if (_x[i]<xmin) xmin = _x[i]; xmed = 0.5f*(xmed+xmin); } return xmed; } Medi...
MedianFinder { public float findMedian(float[] x) { Check.argument(_n==x.length,"length of x is valid"); copy(x,_x); int k = (_n-1)/2; quickPartialSort(k,_x); float xmed = _x[k]; if (_n%2==0) { float xmin = _x[_n-1]; for (int i=_n-2; i>k; --i) if (_x[i]<xmin) xmin = _x[i]; xmed = 0.5f*(xmed+xmin); } return xmed; } Medi...
@Test public void test2() { float sigma = 10.0f; int n1 = 1+2*(int)(sigma*4.0f); int n2 = n1+2; int k1 = (n1-1)/2; int k2 = (n2-1)/2; float[][] x = zerofloat(n1,n2); float[][] y = zerofloat(n1,n2); x[k2][k1] = 1.0f; float tolerance = 0.01f*gaussian(sigma,0.0f,0.0f); RecursiveGaussianFilter rf = new RecursiveGaussianFil...
public void apply00(float[][] x, float[][] y) { _filter.applyXN(0,x,y); _filter.applyNX(0,y,y); }
RecursiveGaussianFilter { public void apply00(float[][] x, float[][] y) { _filter.applyXN(0,x,y); _filter.applyNX(0,y,y); } }
RecursiveGaussianFilter { public void apply00(float[][] x, float[][] y) { _filter.applyXN(0,x,y); _filter.applyNX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); }
RecursiveGaussianFilter { public void apply00(float[][] x, float[][] y) { _filter.applyXN(0,x,y); _filter.applyNX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); void apply2(float[] x, float[] y...
RecursiveGaussianFilter { public void apply00(float[][] x, float[][] y) { _filter.applyXN(0,x,y); _filter.applyNX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); void apply2(float[] x, float[] y...
@Test public void test3() { float sigma = 10.0f; int n1 = 1+2*(int)(sigma*4.0f); int n2 = n1+2; int n3 = n2+2; int k1 = (n1-1)/2; int k2 = (n2-1)/2; int k3 = (n3-1)/2; float[][][] x = zerofloat(n1,n2,n3); float[][][] y = zerofloat(n1,n2,n3); x[k3][k2][k1] = 1.0f; float tolerance = 0.01f*gaussian(sigma,0.0f,0.0f); Recur...
public void apply000(float[][][] x, float[][][] y) { _filter.applyXXN(0,x,y); _filter.applyXNX(0,y,y); _filter.applyNXX(0,y,y); }
RecursiveGaussianFilter { public void apply000(float[][][] x, float[][][] y) { _filter.applyXXN(0,x,y); _filter.applyXNX(0,y,y); _filter.applyNXX(0,y,y); } }
RecursiveGaussianFilter { public void apply000(float[][][] x, float[][][] y) { _filter.applyXXN(0,x,y); _filter.applyXNX(0,y,y); _filter.applyNXX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); }
RecursiveGaussianFilter { public void apply000(float[][][] x, float[][][] y) { _filter.applyXXN(0,x,y); _filter.applyXNX(0,y,y); _filter.applyNXX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); ...
RecursiveGaussianFilter { public void apply000(float[][][] x, float[][][] y) { _filter.applyXXN(0,x,y); _filter.applyXNX(0,y,y); _filter.applyNXX(0,y,y); } RecursiveGaussianFilter(double sigma, Method method); RecursiveGaussianFilter(double sigma); void apply0(float[] x, float[] y); void apply1(float[] x, float[] y); ...
@Test private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==true) { if (r.nextBoolean...
private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==true) { if (r.nextBoolean()) { ...
SymmetricTridiagonalFilter { private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==tr...
SymmetricTridiagonalFilter { private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==tr...
SymmetricTridiagonalFilter { private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==tr...
SymmetricTridiagonalFilter { private static SymmetricTridiagonalFilter makeRandomFilter() { java.util.Random r = new java.util.Random(); float af,ai,al,b; boolean aeq2b = r.nextBoolean(); boolean abneg = r.nextBoolean(); boolean afzs = r.nextBoolean(); boolean alzs = r.nextBoolean(); if (aeq2b && afzs==true && alzs==tr...
@Test public void testCosine() { float w = 0.02f*2.0f*FLT_PI; int n1 = 1001; float shift = 10.0f; float sigma = 8.0f*shift; float[] f = cos(rampfloat(w*shift,w,n1)); float[] g = cos(rampfloat(0.0f,w,n1)); float[] u = new float[n1]; float[] c = new float[n1]; float[] d = new float[n1]; int min1 = -2*(int)shift; int max1...
public void find1( int min1, int max1, float[] f, float[] g, float[] u) { findShifts(min1,max1,f,g,u,null,null); }
LocalShiftFinder { public void find1( int min1, int max1, float[] f, float[] g, float[] u) { findShifts(min1,max1,f,g,u,null,null); } }
LocalShiftFinder { public void find1( int min1, int max1, float[] f, float[] g, float[] u) { findShifts(min1,max1,f,g,u,null,null); } LocalShiftFinder(double sigma); LocalShiftFinder(double sigma1, double sigma2); LocalShiftFinder(double sigma1, double sigma2, double sigma3); }
LocalShiftFinder { public void find1( int min1, int max1, float[] f, float[] g, float[] u) { findShifts(min1,max1,f,g,u,null,null); } LocalShiftFinder(double sigma); LocalShiftFinder(double sigma1, double sigma2); LocalShiftFinder(double sigma1, double sigma2, double sigma3); void setInterpolateDisplacements(boolean ...
LocalShiftFinder { public void find1( int min1, int max1, float[] f, float[] g, float[] u) { findShifts(min1,max1,f,g,u,null,null); } LocalShiftFinder(double sigma); LocalShiftFinder(double sigma1, double sigma2); LocalShiftFinder(double sigma1, double sigma2, double sigma3); void setInterpolateDisplacements(boolean ...
@Test public void testArrayValues() { float[][][] xy = sampleTestFunction(11,13); float[] x1 = xy[0][0]; float[] x2 = xy[0][1]; float[][] y = xy[1]; float x1min = min(x1), x1max = max(x1); float x2min = min(x2), x2max = max(x2); BicubicInterpolator2 bi = makeInterpolator(x1,x2,y); int n1i = 101; int n2i = 102; float d1...
public float interpolate(float x1, float x2) { return interpolate00(x1,x2); }
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } }
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
@Test public void testSampleValues() { float[][][] xy = sampleTestFunction(11,13); float[] x1 = xy[0][0]; float[] x2 = xy[0][1]; float[][] y = xy[1]; float x1min = min(x1), x1max = max(x1); float x2min = min(x2), x2max = max(x2); BicubicInterpolator2 bi = makeInterpolator(x1,x2,y); int n1i = 101; int n2i = 102; float d...
public float interpolate(float x1, float x2) { return interpolate00(x1,x2); }
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } }
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
BicubicInterpolator2 { public float interpolate(float x1, float x2) { return interpolate00(x1,x2); } BicubicInterpolator2(float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2, float[] x1, float[] x2, float[][] y); BicubicInterpolator2( Method method1, Method method2,...
@Test public void testArrayValues() { float[][][][] xy = sampleTestFunction(11,12,13); float[] x1 = xy[0][0][0]; float[] x2 = xy[0][0][1]; float[] x3 = xy[0][0][2]; float[][][] y = xy[1]; float x1min = min(x1), x1max = max(x1); float x2min = min(x2), x2max = max(x2); float x3min = min(x3), x3max = max(x3); TrilinearInt...
public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); float interpo...
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); float interpo...
@Test public void testSampleValues() { float[][][][] xy = sampleTestFunction(11,12,13); float[] x1 = xy[0][0][0]; float[] x2 = xy[0][0][1]; float[] x3 = xy[0][0][2]; float[][][] y = xy[1]; float x1min = min(x1), x1max = max(x1); float x2min = min(x2), x2max = max(x2); float x3min = min(x3), x3max = max(x3); TrilinearIn...
public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); }
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); float interpo...
TrilinearInterpolator3 { public float interpolate(float x1, float x2, float x3) { return interpolate000(x1,x2,x3); } TrilinearInterpolator3( float[] x1, float[] x2, float[] x3, float[][][] y); TrilinearInterpolator3( int n1, int n2, int n3, float[] x1, float[] x2, float[] x3, float[][][] y); float interpo...