(i, observation_index, landmarks, weight)
| 32 | |
| 33 | |
| 34 | def process_observation_old(i, observation_index, landmarks, weight): |
| 35 | # Get indices for observation i |
| 36 | ind = observation_index.getrow(i) |
| 37 | ind_l = ind.indices |
| 38 | ind = ind.data - 1 # Adjust for zero-based indexing |
| 39 | |
| 40 | # Compute weighted landmarks |
| 41 | v = landmarks[ind, :] * weight[ind][:, None] |
| 42 | |
| 43 | # Calculate blocks to update the sparse matrices |
| 44 | Q1_block = v.T @ landmarks[ind, :] |
| 45 | V1_block = v.sum(axis=0)[:, None] |
| 46 | V2_block = v.T |
| 47 | |
| 48 | # Return the computed blocks with their indices |
| 49 | return i, Q1_block, V1_block, V2_block, ind_l |
| 50 | |
| 51 | # create matrix function |
| 52 | def create_matrix(weight, edges, landmarks, output_path): |
nothing calls this directly
no outgoing calls
no test coverage detected