| 107 | } |
| 108 | |
| 109 | cholmod_sparse SuiteSparse::CreateSparseMatrixTransposeView( |
| 110 | CompressedRowSparseMatrix* A) { |
| 111 | cholmod_sparse m; |
| 112 | m.nrow = A->num_cols(); |
| 113 | m.ncol = A->num_rows(); |
| 114 | m.nzmax = A->num_nonzeros(); |
| 115 | m.nz = nullptr; |
| 116 | m.p = reinterpret_cast<void*>(A->mutable_rows()); |
| 117 | m.i = reinterpret_cast<void*>(A->mutable_cols()); |
| 118 | m.x = reinterpret_cast<void*>(A->mutable_values()); |
| 119 | m.z = nullptr; |
| 120 | |
| 121 | if (A->storage_type() == |
| 122 | CompressedRowSparseMatrix::StorageType::LOWER_TRIANGULAR) { |
| 123 | m.stype = 1; |
| 124 | } else if (A->storage_type() == |
| 125 | CompressedRowSparseMatrix::StorageType::UPPER_TRIANGULAR) { |
| 126 | m.stype = -1; |
| 127 | } else { |
| 128 | m.stype = 0; |
| 129 | } |
| 130 | |
| 131 | m.itype = CHOLMOD_INT; |
| 132 | m.xtype = CHOLMOD_REAL; |
| 133 | m.dtype = CHOLMOD_DOUBLE; |
| 134 | m.sorted = 1; |
| 135 | m.packed = 1; |
| 136 | |
| 137 | return m; |
| 138 | } |
| 139 | |
| 140 | cholmod_dense SuiteSparse::CreateDenseVectorView(const double* x, int size) { |
| 141 | cholmod_dense v; |
no test coverage detected