MCPcopy Create free account
hub / github.com/ceres-solver/ceres-solver / CreateSparseMatrixTransposeView

Method CreateSparseMatrixTransposeView

internal/ceres/suitesparse.cc:109–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109cholmod_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
140cholmod_dense SuiteSparse::CreateDenseVectorView(const double* x, int size) {
141 cholmod_dense v;

Callers 2

FactorizeMethod · 0.45

Calls 4

mutable_valuesMethod · 0.80
num_colsMethod · 0.45
num_rowsMethod · 0.45
num_nonzerosMethod · 0.45

Tested by

no test coverage detected