| 123 | |
| 124 | |
| 125 | AnyType |
| 126 | matrix_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 | |
| 145 | AnyType |
| 146 | matrix_compose_sparse_transition::run(AnyType& args) { |
nothing calls this directly
no test coverage detected