MCPcopy Create free account
hub / github.com/apache/madlib / initialize

Method initialize

src/modules/stats/robust_variance_coxph.cpp:315–328  ·  view source on GitHub ↗

* @brief Initialize the transition state. Only called for first row. * * @param inAllocator Allocator for the memory transition state. Must fill * the memory block with zeros. * @param inWidthOfX Number of independent variables. The first row of data * determines the size of the transition state. This size is a quadratic * function of inWidthOfX. */

Source from the content-addressed store, hash-verified

313 * function of inWidthOfX.
314 */
315 inline void initialize(const Allocator &inAllocator, uint16_t inWidthOfX,
316 const double * inCoef = 0)
317 {
318 mStorage = inAllocator.allocateArray<double, dbal::AggregateContext,
319 dbal::DoZero, dbal::ThrowBadAlloc>(arraySize(inWidthOfX));
320 rebind(inWidthOfX);
321 widthOfX = inWidthOfX;
322
323 if(inCoef){
324 for(uint16_t i = 0; i < widthOfX; i++)
325 coef[i] = inCoef[i];
326 }
327 this->reset();
328 }
329
330 /**
331 * @brief Reset the inter-iteration fields.

Callers 1

runMethod · 0.45

Calls 2

resetMethod · 0.95
rebindClass · 0.50

Tested by

no test coverage detected