protected double kernelHelperLP(int n,char[] s,int endIndexS,char[] t,int endIndexT,int remainingMatchLength){
  if (n == 0) {
    return getReturnValue(n);
  }
  if (Math.min(endIndexS + 1,endIndexT + 1) < n) {
    ;
    return getReturnValue(n);
  }
  if (remainingMatchLength < 2 * n) {
    return getReturnValue(n);
  }
  int adr=0;
  if (m_useRecursionCache) {
    adr=m_multX * n + m_multY * endIndexS + m_multZ * endIndexT + m_multZZ * remainingMatchLength;
    if (cachekh2K[adr % maxCache] == adr + 1) {
      return cachekh2[adr % maxCache];
    }
  }
  int rml=0;
  double result=0;
  for (int iS=(endIndexS - remainingMatchLength); iS <= endIndexS; iS++) {
    result*=m_lambda;
    result+=kernelHelper2LP(n,s,iS,t,endIndexT,rml++);
  }
  if (m_useRecursionCache && endIndexS >= 0 && endIndexT >= 0 && n >= 0) {
    cachekhK[adr % maxCache]=adr + 1;
    cachekh[adr % maxCache]=result;
  }
  return result;
}

protected double kernelHelperLP ( int n , char [ ] s , int endIndexS , char [ ] t , int endIndexT , int remainingMatchLength ) { if ( n == 0 ) { return getReturnValue ( n ) ; } if ( Math . min ( endIndexS + 1 , endIndexT + 1 ) < n ) { ; return getReturnValue ( n ) ; } if ( remainingMatchLength < 2 * n ) { return getReturnValue ( n ) ; } int adr = 0 ; if ( m_useRecursionCache ) { adr = m_multX * n + m_multY * endIndexS + m_multZ * endIndexT + m_multZZ * remainingMatchLength ; if ( cachekh2K [ adr % maxCache ] == adr + 1 ) { return cachekh2 [ adr % maxCache ] ; } } int rml = 0 ; double result = 0 ; for ( int iS = ( endIndexS - remainingMatchLength ) ; iS <= endIndexS ; iS ++ ) { result *= m_lambda ; result += kernelHelper2LP ( n , s , iS , t , endIndexT , rml ++ ) ; } if ( m_useRecursionCache && endIndexS >= 0 && endIndexT >= 0 && n >= 0 ) { cachekhK [ adr % maxCache ] = adr + 1 ; cachekh [ adr % maxCache ] = result ; } return result ; }
helper function for the evaluation of the kernel ( k ' n ) using lambda pruning
