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

Method initialize

src/modules/stats/CoxPHState.hpp:44–54  ·  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

42 * function of inWidthOfX.
43 */
44 inline void initialize(const Allocator &inAllocator, uint16_t inWidthOfX, const double * inCoef = 0) {
45 mStorage = inAllocator.allocateArray<double, dbal::AggregateContext,
46 dbal::DoZero, dbal::ThrowBadAlloc>(arraySize(inWidthOfX));
47 rebind(inWidthOfX);
48 widthOfX = inWidthOfX;
49 if(inCoef){
50 for(uint16_t i = 0; i < widthOfX; i++)
51 coef[i] = inCoef[i];
52 }
53 this->reset();
54 }
55
56 /**
57 * @brief We need to support assigning the previous state

Callers 2

runMethod · 0.45

Calls 2

resetMethod · 0.95
rebindClass · 0.50

Tested by

no test coverage detected