|
| Restricted Growth function |
 |
Fri, 30 Mar 2007 18:41:25 +020 |
Please find attached the class (see below for more info).
See also thread in dbase.programming.
Roland
/*
------------------------------------------------------------------
Name:........:RGrowth.cc
Programmer..: Roland Wingerter
Date........: March 2007
Notes.......: Restricted Growth Function.
Auxiliary function for generating set partitions.
Written for.: dBase Plus
Rev. History: None
Calls.......: None
Usage.......: set proc to RGrowth.cc additive
oRef = new RGrowth(nSize)
Example.....: oRG = new RGrowth(4)
oRG.CreateAll()
? oRG.aRows.size // 15
? oRG.aRows[1].size // 4
// First row values are all the same, always 1
? oRG.aRows[1][1] // 1
? oRG.aRows[1][2] // 1
? oRG.aRows[1][3] // 1
? oRG.aRows[1][4] // 1
// Last row values are all different, from 1..nSize
? oRG.aRows[15][1] // 1
? oRG.aRows[15][2] // 2
? oRG.aRows[15][3] // 3
? oRG.aRows[15][4] // 4
Returns.....: Object reference
Parameter...: nSize - size of the RestrictedGrowth array
------------------------------------------------------------------
*/
|
| Post Reply
|
 |
|
|
|
|
|
|
|
|
|