Package cnuphys.swim
Class DefaultListener
java.lang.Object
cnuphys.swim.DefaultListener
- All Implemented Interfaces:
- IRkListener
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a default listener that simply tracks the total number of steps taken and stores the last step.
- 
Method SummaryModifier and TypeMethodDescriptionintgetCount()Get the number of steps takendoubleGet the independent variable (e.g., path length) for the last step.double[]Get the last state vector entries (e.g., [x,y,z, px.p, py/p, pz/p])voidnextStep(double newS, double[] newY, double h) The integration has advanced one stepvoidreset()Call reset if you are going to use the same object again.
- 
Constructor Details- 
DefaultListenerpublic DefaultListener()Create a default listener that simply tracks the total number of steps taken and stores the last step.
 
- 
- 
Method Details- 
nextSteppublic void nextStep(double newS, double[] newY, double h) The integration has advanced one step- Specified by:
- nextStepin interface- IRkListener
- Parameters:
- newS- the new value of the independent variable (e.g., path length)
- newY- the new value of the dependent variable, e.g. often a vector with six elements (e.g., x, y, z, px/p, py/p, pz/p)
- h- the stepsize used for this advance
 
- 
resetpublic void reset()Call reset if you are going to use the same object again.
- 
getIndependentVariablepublic double getIndependentVariable()Get the independent variable (e.g., path length) for the last step.- Returns:
- the independent variable (e.g., path length) at the last step
 
- 
getLastStateVectorpublic double[] getLastStateVector()Get the last state vector entries (e.g., [x,y,z, px.p, py/p, pz/p])- Returns:
- the last state vector
 
- 
getCountpublic int getCount()Get the number of steps taken- Returns:
- the count, i.e., the number of steps taken
 
 
-