mmf
Class MMF_RunningProduct

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by mmf:MMF_RunningProduct

class 
UserTransform:MMF_RunningProduct

Returns the product of pz and all previous values of pz.
Fudges used when pz is zero.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_RunningProduct(common.ulb:UserTransform) {
 ; Returns the product of pz and all previous values of pz.<br>
 ; Fudges used when pz is zero.<br>
 public:
   import "common.ulb"
   
   ; @param pparent the parent, generally "this" for the parent, or zero
   func MMF_RunningProduct(Generic pparent)
     UserTransform.UserTransform(pparent)
   endfunc
 
   func Init(complex pz)
 ;    m_Iterations = 0 not used in this transform
     m_Solid = false
     m_Product = (1,0)
   endfunc
 
   complex func Iterate(complex pz)
 ;    m_Iterations = m_Iterations + 1 not used in this transform
     if pz!=(0,0)
       return m_Product = m_Product*pz
     elseif @p_method=="Alternative"
       return m_Product
     else;if @p_method=="Original"
       return pz
     endif
   endfunc
 
   func IterateSilent()
 ;    m_Iterations = m_Iterations + 1 not used in this transform
     if @p_restart
       m_Product = (1,0)
     endif
   endfunc
 
 protected:
   complex m_Product
 
 default:
   title = "Running Product"
   int param p_method
     caption = "Method"
     enum = "Original" "Alternative"
     default = 0
     hint = "The original method matches 'Iterate the Product' as used in \
             various older mmf formulas."
   endparam
   bool param p_restart
     caption = "Reset the Product"
     default = false
     hint = "This is only for when the transform is used in a situation \
             where there may be iteration skipping, for example in a \
             colouring formula. If you enable this option then the product \
             is reset to one each time iteration skipping occurs."
   endparam
 }
 


Constructor Summary
MMF_RunningProduct()
           
MMF_RunningProduct(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
          Set up for a sequence of values
 complex Iterate(complex pz)
          Transform a single point within a sequence
 void IterateSilent()
          Update internal counters without transforming a point
 
Methods inherited from class common:Transform
IsSolid
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_RunningProduct

public MMF_RunningProduct(Generic pparent)
Parameters:
pparent - the parent, generally "this" for the parent, or zero

MMF_RunningProduct

public MMF_RunningProduct()
Method Detail

Init

public void Init(complex pz)
Description copied from class: Transform
Set up for a sequence of values

This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit). It will be called even if only one value is being transformed (e.g. a normal transformation formula). Use this to perform any setup that is exactly the same for each value in the sequence being transformed.

Overrides:
Init in class Transform
Parameters:
pz - the value representing the sequence; for a normal transformation formula use, this will be #pixel. In some cases this may differ from the first value passed to Iterate() if the calling code applies some other transformations.

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value

IterateSilent

public void IterateSilent()
Description copied from class: Transform
Update internal counters without transforming a point

For some Transform classes, the actual transformation being performed changes for each value in the sequence (e.g. TrapTransform, which can rotate each iteration by a different amount). In some cases the calling code may determine in advance that a particular point does not need to be transformed (perhaps because it is not being used) but it still needs to be accounted for. This function is used in place of Iterate() for those situations; the Transform should update any internal state that changes between iterations within a sequence. Since no value is being transformed, no parameters are passed and no return value is provided.

Overrides:
IterateSilent in class Transform