* @brief Initialize the marginal variance calculation state. * * This function is only called for the first iteration, for the first row. */
| 69 | * This function is only called for the first iteration, for the first row. |
| 70 | */ |
| 71 | inline void initialize(const Allocator &inAllocator, |
| 72 | const uint16_t inWidthOfX, |
| 73 | const uint16_t inNumBasis, |
| 74 | const uint16_t inNumCategoricals) { |
| 75 | mStorage = inAllocator.allocateArray<double, dbal::AggregateContext, |
| 76 | dbal::DoZero, dbal::ThrowBadAlloc>( |
| 77 | arraySize(inWidthOfX, inNumBasis, inNumCategoricals)); |
| 78 | rebind(inWidthOfX, inNumBasis, inNumCategoricals); |
| 79 | widthOfX = inWidthOfX; |
| 80 | numBasis = inNumBasis; |
| 81 | numCategoricalVarsInSubset = inNumCategoricals; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @brief We need to support assigning the previous state |