| 53 | } |
| 54 | |
| 55 | void CRSToMatrix(const ceres::CRSMatrix &CRSMat, Matrix &Mat) |
| 56 | { |
| 57 | /** construct empty matrix */ |
| 58 | Mat.resize(CRSMat.num_rows, CRSMat.num_cols); |
| 59 | Mat.setZero(); |
| 60 | |
| 61 | /** fill with sparse matrix */ |
| 62 | for (int Row = 0; Row < CRSMat.num_rows; Row++) |
| 63 | { |
| 64 | int Start = CRSMat.rows[Row]; |
| 65 | int End = CRSMat.rows[Row + 1]; |
| 66 | |
| 67 | for (int n = Start; n < End; n++) |
| 68 | { |
| 69 | int Col = CRSMat.cols[n]; |
| 70 | |
| 71 | Mat(Row, Col) = CRSMat.values[n]; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | } |
no outgoing calls
no test coverage detected