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

Method run

src/modules/convex/utils_regularization.cpp:79–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77// ------------------------------------------------------------------------
78
79AnyType utils_var_scales_transition::run (AnyType& args)
80{
81 ScalesState<MutableArrayHandle<double> > state = args[0];
82 MappedColumnVector x = args[1].getAs<MappedColumnVector>();
83
84 if (state.numRows == 0)
85 {
86 int dimension = args[2].getAs<int>();
87
88 state.allocate(*this, dimension);
89 state.dimension = dimension;
90 state.numRows = 0;
91 state.mean.setZero();
92 state.std.setZero();
93 }
94
95 for (uint32_t i = 0; i < state.dimension; i++)
96 {
97 state.mean(i) += x(i);
98 state.std(i) += x(i) * x(i);
99 }
100
101 state.numRows++;
102
103 return state;
104}
105
106// ------------------------------------------------------------------------
107

Callers

nothing calls this directly

Calls 3

NullFunction · 0.85
allocateMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected