MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / CreateSparseMatrix

Method CreateSparseMatrix

linalg/special_matrix.cpp:112–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 shared_ptr<BaseSparseMatrix> Embedding :: CreateSparseMatrix() const
113 {
114 Array<int> ai(range.Size()), aj(range.Size());
115
116 for (int i = 0; i < range.Size(); i++)
117 {
118 ai[i] = range.First()+i;
119 aj[i] = i;
120 }
121
122 if (IsComplex())
123 {
124 Array<Complex> vals(range.Size());
125 vals = 1.;
126 return SparseMatrix<Complex>::CreateFromCOO (ai, aj, vals, Height(), Width());
127 }
128 else
129 {
130 Array<double> vals(range.Size());
131 vals = 1.;
132 return SparseMatrix<double>::CreateFromCOO (ai, aj, vals, Height(), Width());
133 }
134 }
135
136
137

Callers

nothing calls this directly

Calls 8

EmbeddingTransposeClass · 0.85
MatMultFunction · 0.85
IsComplexFunction · 0.70
HeightFunction · 0.70
WidthFunction · 0.70
SizeMethod · 0.45
FirstMethod · 0.45
CreateSparseMatrixMethod · 0.45

Tested by

no test coverage detected