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

Method run

src/modules/linalg/matrix_decomp.cpp:125–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125AnyType
126matrix_compose_dense_transition::run(AnyType& args) {
127 MatrixComposeState<MutableArrayHandle<double> > state = args[0];
128 uint32_t numRows = args[1].getAs<uint32_t>();
129 Index row_id = args[2].getAs<uint32_t>();
130 MappedColumnVector curr_row = args[3].getAs<MappedColumnVector>();
131
132 if (state.numCols == 0)
133 state.initialize(*this, numRows, static_cast<uint32_t>(curr_row.size()));
134 else if (curr_row.size() != state.matrix.cols() ||
135 state.numRows != static_cast<uint32_t>(state.matrix.rows()) ||
136 state.numCols != static_cast<uint32_t>(state.matrix.cols()))
137 throw std::invalid_argument("Invalid arguments: Dimensions of vectors "
138 "not consistent.");
139 if (row_id < 0 || row_id >= numRows)
140 throw std::runtime_error("Invalid row id.");
141 state.matrix.row(row_id) = curr_row;
142 return state;
143}
144
145AnyType
146matrix_compose_sparse_transition::run(AnyType& args) {

Callers

nothing calls this directly

Calls 5

NullFunction · 0.85
IdentityClass · 0.85
initializeMethod · 0.45
sizeMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected