ngsolve 6.2.2506.post216.dev0__cp314-cp314-manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvcc +22 -0
  2. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvlink +17 -0
  3. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngscxx +15 -0
  4. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsld +11 -0
  5. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsolve.tcl +648 -0
  6. ngsolve-6.2.2506.post216.dev0.data/data/bin/ngspy +2 -0
  7. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/analytic_integrals.hpp +10 -0
  8. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/arnoldi.hpp +55 -0
  9. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bandmatrix.hpp +334 -0
  10. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basematrix.hpp +963 -0
  11. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basevector.hpp +1268 -0
  12. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbequations.hpp +2807 -0
  13. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbintegrator.hpp +1660 -0
  14. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bem_diffops.hpp +475 -0
  15. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bessel.hpp +1064 -0
  16. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bilinearform.hpp +966 -0
  17. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bla.hpp +29 -0
  18. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockalloc.hpp +95 -0
  19. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockjacobi.hpp +328 -0
  20. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bspline.hpp +116 -0
  21. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/calcinverse.hpp +141 -0
  22. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cg.hpp +368 -0
  23. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/chebyshev.hpp +44 -0
  24. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cholesky.hpp +720 -0
  25. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/clapack.h +7254 -0
  26. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/code_generation.hpp +296 -0
  27. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient.hpp +2033 -0
  28. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_impl.hpp +19 -0
  29. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_stdmath.hpp +167 -0
  30. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/commutingAMG.hpp +106 -0
  31. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/comp.hpp +79 -0
  32. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compatibility.hpp +41 -0
  33. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/complex_wrapper.hpp +101 -0
  34. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compressedfespace.hpp +110 -0
  35. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/contact.hpp +239 -0
  36. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_core.hpp +216 -0
  37. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_linalg.hpp +185 -0
  38. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngbla.hpp +317 -0
  39. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngstd.hpp +414 -0
  40. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_profiler.hpp +240 -0
  41. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diagonalmatrix.hpp +160 -0
  42. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/differentialoperator.hpp +276 -0
  43. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop.hpp +1286 -0
  44. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop_impl.hpp +328 -0
  45. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffopwithfactor.hpp +123 -0
  46. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/discontinuous.hpp +84 -0
  47. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/dump.hpp +949 -0
  48. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ectypes.hpp +121 -0
  49. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigen.hpp +60 -0
  50. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigensystem.hpp +18 -0
  51. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elasticity_equations.hpp +595 -0
  52. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementbyelement.hpp +201 -0
  53. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtopology.hpp +1760 -0
  54. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtransformation.hpp +339 -0
  55. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/evalfunc.hpp +405 -0
  56. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/expr.hpp +1693 -0
  57. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfe.hpp +175 -0
  58. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfespace.hpp +180 -0
  59. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facethofe.hpp +111 -0
  60. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetsurffespace.hpp +112 -0
  61. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fe_interfaces.hpp +32 -0
  62. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fem.hpp +87 -0
  63. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fesconvert.hpp +14 -0
  64. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fespace.hpp +1454 -0
  65. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/finiteelement.hpp +286 -0
  66. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalinterfacespace.hpp +77 -0
  67. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalspace.hpp +115 -0
  68. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/gridfunction.hpp +525 -0
  69. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1amg.hpp +124 -0
  70. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe.hpp +188 -0
  71. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe_impl.hpp +1262 -0
  72. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo.hpp +148 -0
  73. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo_impl.hpp +185 -0
  74. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofespace.hpp +167 -0
  75. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lofe.hpp +1240 -0
  76. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lumping.hpp +41 -0
  77. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurl_equations.hpp +1381 -0
  78. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfe.hpp +2241 -0
  79. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfespace.hpp +78 -0
  80. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe.hpp +259 -0
  81. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe_utils.hpp +107 -0
  82. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdiv_dshape.hpp +857 -0
  83. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdivfes.hpp +308 -0
  84. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe.hpp +175 -0
  85. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe_impl.hpp +1871 -0
  86. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofespace.hpp +193 -0
  87. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurllofe.hpp +1146 -0
  88. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdiv_equations.hpp +880 -0
  89. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivfe.hpp +2923 -0
  90. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivsurfacespace.hpp +76 -0
  91. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe.hpp +206 -0
  92. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe_utils.hpp +717 -0
  93. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfes.hpp +75 -0
  94. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe.hpp +447 -0
  95. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe_impl.hpp +1107 -0
  96. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofefo.hpp +229 -0
  97. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofespace.hpp +177 -0
  98. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhosurfacefespace.hpp +106 -0
  99. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivlofe.hpp +773 -0
  100. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hidden.hpp +74 -0
  101. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/householder.hpp +181 -0
  102. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_ams_precond.hpp +123 -0
  103. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_precond.hpp +73 -0
  104. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integrator.hpp +2012 -0
  105. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integratorcf.hpp +253 -0
  106. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/interpolate.hpp +49 -0
  107. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrule.hpp +2542 -0
  108. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrules_SauterSchwab.hpp +25 -0
  109. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/irspace.hpp +49 -0
  110. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/jacobi.hpp +153 -0
  111. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/kernels.hpp +724 -0
  112. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe.hpp +194 -0
  113. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe_impl.hpp +564 -0
  114. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofefo.hpp +542 -0
  115. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofespace.hpp +344 -0
  116. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/la.hpp +38 -0
  117. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linalg_kernels.hpp +70 -0
  118. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linearform.hpp +266 -0
  119. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/matrix.hpp +2145 -0
  120. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/memusage.hpp +41 -0
  121. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/meshaccess.hpp +1359 -0
  122. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mgpre.hpp +204 -0
  123. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mp_coefficient.hpp +145 -0
  124. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mptools.hpp +2281 -0
  125. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multigrid.hpp +42 -0
  126. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multivector.hpp +447 -0
  127. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mumpsinverse.hpp +187 -0
  128. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mycomplex.hpp +361 -0
  129. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ng_lapack.hpp +1661 -0
  130. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngblas.hpp +1232 -0
  131. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_defines.hpp +30 -0
  132. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_stdcpp_include.hpp +106 -0
  133. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_utils.hpp +121 -0
  134. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsobject.hpp +1019 -0
  135. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsstream.hpp +113 -0
  136. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngstd.hpp +72 -0
  137. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe.hpp +96 -0
  138. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe_impl.hpp +141 -0
  139. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfe.hpp +223 -0
  140. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfespace.hpp +98 -0
  141. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetsurfacefespace.hpp +84 -0
  142. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/order.hpp +251 -0
  143. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallel_matrices.hpp +222 -0
  144. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/paralleldofs.hpp +340 -0
  145. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelngs.hpp +23 -0
  146. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelvector.hpp +269 -0
  147. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pardisoinverse.hpp +200 -0
  148. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/periodic.hpp +129 -0
  149. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/plateaufespace.hpp +25 -0
  150. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pml.hpp +275 -0
  151. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pmltrafo.hpp +631 -0
  152. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/postproc.hpp +142 -0
  153. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/potentialtools.hpp +22 -0
  154. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/precomp.hpp +60 -0
  155. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/preconditioner.hpp +602 -0
  156. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/prolongation.hpp +380 -0
  157. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_comp.hpp +107 -0
  158. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_fem.hpp +89 -0
  159. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_linalg.hpp +58 -0
  160. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_ngstd.hpp +386 -0
  161. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol.hpp +4896 -0
  162. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_tet.hpp +395 -0
  163. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_trig.hpp +492 -0
  164. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/reorderedfespace.hpp +81 -0
  165. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sample_sort.hpp +105 -0
  166. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/scalarfe.hpp +335 -0
  167. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/shapefunction_utils.hpp +113 -0
  168. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/simd_complex.hpp +329 -0
  169. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/smoother.hpp +253 -0
  170. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/solve.hpp +89 -0
  171. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsecholesky.hpp +317 -0
  172. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsefactorization_interface.hpp +159 -0
  173. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix.hpp +1052 -0
  174. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_dyn.hpp +90 -0
  175. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_impl.hpp +1055 -0
  176. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/special_matrix.hpp +463 -0
  177. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/specialelement.hpp +125 -0
  178. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/statushandler.hpp +33 -0
  179. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/stringops.hpp +12 -0
  180. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/superluinverse.hpp +136 -0
  181. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symbolicintegrator.hpp +850 -0
  182. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symmetricmatrix.hpp +144 -0
  183. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfe.hpp +224 -0
  184. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfespace.hpp +91 -0
  185. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensor.hpp +522 -0
  186. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorcoefficient.hpp +446 -0
  187. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorproductintegrator.hpp +113 -0
  188. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe.hpp +128 -0
  189. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe_impl.hpp +380 -0
  190. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe.hpp +80 -0
  191. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe_impl.hpp +492 -0
  192. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpdiffop.hpp +461 -0
  193. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpfes.hpp +133 -0
  194. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpintrule.hpp +224 -0
  195. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/triangular.hpp +465 -0
  196. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe.hpp +245 -0
  197. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe_impl.hpp +1029 -0
  198. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/umfpackinverse.hpp +148 -0
  199. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/unifiedvector.hpp +103 -0
  200. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vector.hpp +1452 -0
  201. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/voxelcoefficientfunction.hpp +41 -0
  202. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vtkoutput.hpp +198 -0
  203. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vvector.hpp +208 -0
  204. ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/webgui.hpp +92 -0
  205. ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/NGSolveConfig.cmake +102 -0
  206. ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets-release.cmake +89 -0
  207. ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets.cmake +180 -0
  208. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngbla.so +0 -0
  209. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngcomp.so +0 -0
  210. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngfem.so +0 -0
  211. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngla.so +0 -0
  212. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsbem.so +0 -0
  213. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngscudalib.so +0 -0
  214. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsolve.so +0 -0
  215. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngstd.so +0 -0
  216. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/TensorProductTools.py +210 -0
  217. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__console.py +94 -0
  218. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__expr.py +181 -0
  219. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__init__.py +148 -0
  220. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/_scikit_build_core_dependencies.py +30 -0
  221. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/bvp.py +78 -0
  222. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__init__.py +1 -0
  223. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__main__.py +4 -0
  224. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/config.py +60 -0
  225. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/__init__.py +0 -0
  226. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
  227. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
  228. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
  229. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
  230. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/__init__.py +0 -0
  231. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/__init__.py +0 -0
  232. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hhj.py +44 -0
  233. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hybrid_dg.py +53 -0
  234. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/mixed.py +30 -0
  235. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/nonlin.py +29 -0
  236. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pickling.py +26 -0
  237. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pml.py +31 -0
  238. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/taskmanager.py +20 -0
  239. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/tdnns.py +47 -0
  240. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG-skeleton.py +45 -0
  241. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG.py +38 -0
  242. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGlap.py +42 -0
  243. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGwave.py +61 -0
  244. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/__init__.py +0 -0
  245. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/adaptive.py +123 -0
  246. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/cmagnet.py +59 -0
  247. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/elasticity.py +76 -0
  248. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/navierstokes.py +74 -0
  249. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.ipynb +170 -0
  250. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.py +41 -0
  251. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/__init__.py +0 -0
  252. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
  253. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
  254. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_poisson.py +89 -0
  255. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_timeDG.py +82 -0
  256. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/directsolvers.py +14 -0
  257. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/eigenvalues.py +364 -0
  258. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/internal.py +89 -0
  259. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/krylovspace.py +1182 -0
  260. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/meshes.py +748 -0
  261. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngs2petsc.py +310 -0
  262. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscuda.so +0 -0
  263. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscxx.py +42 -0
  264. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngslib.so +0 -0
  265. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/nonlinearsolvers.py +203 -0
  266. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/preconditioners.py +11 -0
  267. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solve_implementation.py +168 -0
  268. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/__init__.py +7 -0
  269. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/cudss.py +112 -0
  270. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timestepping.py +185 -0
  271. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timing.py +108 -0
  272. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/utils.py +167 -0
  273. ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/webgui.py +671 -0
  274. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.geo +17 -0
  275. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.vol +240 -0
  276. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.in2d +41 -0
  277. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.vol +614 -0
  278. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.geo +12 -0
  279. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.vol +2560 -0
  280. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.geo +24 -0
  281. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.vol +3179 -0
  282. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.geo +19 -0
  283. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.vol +1832 -0
  284. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d10_DGdoubleglazing.pde +50 -0
  285. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d11_chip_nitsche.pde +40 -0
  286. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d1_square.pde +43 -0
  287. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d2_chip.pde +35 -0
  288. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d3_helmholtz.pde +22 -0
  289. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d4_cube.pde +46 -0
  290. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d5_beam.pde +74 -0
  291. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d6_shaft.pde +73 -0
  292. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d7_coil.pde +50 -0
  293. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d8_coilshield.pde +49 -0
  294. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d9_hybridDG.pde +72 -0
  295. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.in2d +27 -0
  296. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.vol +737 -0
  297. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
  298. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.geo +73 -0
  299. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.vol +4291 -0
  300. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.in2d +17 -0
  301. ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.vol +149 -0
  302. ngsolve-6.2.2506.post216.dev0.dist-info/METADATA +14 -0
  303. ngsolve-6.2.2506.post216.dev0.dist-info/RECORD +306 -0
  304. ngsolve-6.2.2506.post216.dev0.dist-info/WHEEL +5 -0
  305. ngsolve-6.2.2506.post216.dev0.dist-info/licenses/LICENSE +504 -0
  306. ngsolve-6.2.2506.post216.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,963 @@
1
+ #ifndef FILE_NGS_BASEMATRIX
2
+ #define FILE_NGS_BASEMATRIX
3
+
4
+
5
+ /*********************************************************************/
6
+ /* File: basematrix.hpp */
7
+ /* Author: Joachim Schoeberl */
8
+ /* Date: 25. Mar. 2000 */
9
+ /*********************************************************************/
10
+
11
+
12
+ #include "basevector.hpp"
13
+ #include "multivector.hpp"
14
+ // #include "paralleldofs.hpp"
15
+
16
+ namespace ngla
17
+ {
18
+ class ParallelDofs;
19
+
20
+ // sets the solver which is used for InverseMatrix
21
+ enum INVERSETYPE { PARDISO, PARDISOSPD, SPARSECHOLESKY, SUPERLU, SUPERLU_DIST, MUMPS, MASTERINVERSE, UMFPACK };
22
+ extern string GetInverseName (INVERSETYPE type);
23
+
24
+ class BaseSparseMatrix;
25
+
26
+ /**
27
+ The base for all matrices in the linalg.
28
+ */
29
+ class NGS_DLL_HEADER BaseMatrix : public enable_shared_from_this_virtual<BaseMatrix>
30
+ {
31
+ protected:
32
+ shared_ptr<ParallelDofs> paralleldofs;
33
+ mutable char safety_check = 0;
34
+ bool is_complex = false;
35
+
36
+ protected:
37
+ ///
38
+ BaseMatrix ();
39
+ ///
40
+ BaseMatrix (shared_ptr<ParallelDofs> aparalleldofs);
41
+
42
+ public:
43
+ ///
44
+ virtual ~BaseMatrix ();
45
+ /// virtual function must be overloaded
46
+ virtual int VHeight() const;
47
+
48
+ /// virtual function must be overloaded
49
+ virtual int VWidth() const;
50
+
51
+ /// inline function VHeight
52
+ size_t Height() const
53
+ {
54
+ return VHeight();
55
+ }
56
+
57
+ /// inline function VWidth
58
+ size_t Width() const
59
+ {
60
+ return VWidth();
61
+ }
62
+
63
+ virtual tuple<size_t, size_t> Shape() const { return { Height(), Width() }; }
64
+
65
+ virtual xbool IsSymmetric() const { return maybe; }
66
+
67
+ /// is matrix complex ?
68
+ virtual bool IsComplex() const { return is_complex; }
69
+
70
+ /// scalar assignment
71
+ BaseMatrix & operator= (double s)
72
+ {
73
+ AsVector().SetScalar(s);
74
+ return *this;
75
+ }
76
+
77
+ /// linear access of matrix memory
78
+ virtual BaseVector & AsVector();
79
+ /// linear access of matrix memory
80
+ virtual const BaseVector & AsVector() const;
81
+ ///
82
+ virtual void SetZero();
83
+
84
+ virtual ostream & Print (ostream & ost) const;
85
+ virtual Array<MemoryUsage> GetMemoryUsage () const;
86
+ virtual size_t NZE () const;
87
+
88
+ template <typename T>
89
+ shared_ptr<T> SharedFromThis()
90
+ { return dynamic_pointer_cast<T> (shared_from_this()); }
91
+ /// whatever it means ... e.g. refactor sparse factorization
92
+ virtual void Update();
93
+ /// creates matrix of same type
94
+ virtual shared_ptr<BaseMatrix> CreateMatrix () const;
95
+ /// creates a matching vector, size = width
96
+ virtual AutoVector CreateRowVector () const = 0;
97
+ /// creates a matching vector, size = height
98
+ virtual AutoVector CreateColVector () const = 0;
99
+ /// creates a matching vector (for square matrices)
100
+ [[deprecated("use CreateRowVector or CreateColVector instead")]]
101
+ virtual AutoVector CreateVector () const;
102
+
103
+ virtual AutoVector Evaluate(BaseVector & v) const
104
+ {
105
+ auto res = CreateColVector();
106
+ Mult (v, res);
107
+ return res;
108
+ }
109
+ virtual AutoVector EvaluateTrans(BaseVector & v) const
110
+ {
111
+ auto res = CreateRowVector();
112
+ MultTrans (v, res);
113
+ return res;
114
+ }
115
+
116
+ /// y = matrix * x.
117
+ virtual void Mult (const BaseVector & x, BaseVector & y) const;
118
+ ///
119
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const;
120
+ /// y += s matrix * x
121
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const;
122
+ /// y += s matrix * x
123
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const;
124
+
125
+ /// y += s Trans(matrix) * x
126
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const;
127
+ /// y += s Trans(matrix) * x
128
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const;
129
+ /// y += s Trans(matrix) * x
130
+ virtual void MultConjTransAdd (Complex s, const BaseVector & x, BaseVector & y) const;
131
+
132
+ /// y += alpha M x
133
+ virtual void MultAdd (FlatVector<double> alpha, const MultiVector & x, MultiVector & y) const;
134
+
135
+ /**
136
+ to split mat x vec for symmetric matrices
137
+ only rows with inner or cluster true need by added (but more can be ...)
138
+ */
139
+ virtual void MultAdd1 (double s, const BaseVector & x, BaseVector & y,
140
+ const BitArray * ainner = NULL,
141
+ const Array<int> * acluster = NULL) const;
142
+
143
+ /// only cols with inner or cluster true need by added (but more can be ...)
144
+ virtual void MultAdd2 (double s, const BaseVector & x, BaseVector & y,
145
+ const BitArray * ainner = NULL,
146
+ const Array<int> * acluster = NULL) const;
147
+
148
+
149
+ void SetParallelDofs (shared_ptr<ParallelDofs> pardofs) { paralleldofs = pardofs; }
150
+ shared_ptr<ParallelDofs> GetParallelDofs () const { return paralleldofs; }
151
+ virtual optional<NgMPI_Comm> GetCommunicator() const { return nullopt; }
152
+
153
+ virtual shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<BitArray> subset = nullptr) const;
154
+ virtual shared_ptr<BaseMatrix> InverseMatrix (shared_ptr<const Array<int>> clusters) const;
155
+ virtual INVERSETYPE SetInverseType ( INVERSETYPE ainversetype ) const;
156
+ virtual INVERSETYPE SetInverseType ( string ainversetype ) const;
157
+ virtual INVERSETYPE GetInverseType () const;
158
+
159
+ typedef std::function<shared_ptr<BaseMatrix>(shared_ptr<BaseMatrix>,
160
+ shared_ptr<BitArray>,
161
+ shared_ptr<const Array<int>>)> T_INVCREATOR;
162
+ mutable T_INVCREATOR invcreator;
163
+ void SetInverseCreator(T_INVCREATOR ainvcreator) const { invcreator = ainvcreator; }
164
+
165
+ static SymbolTable<T_INVCREATOR> invcreators;
166
+ static void RegisterInverseCreator(string name, T_INVCREATOR creator);
167
+
168
+ virtual void SetInverseFlags (const Flags & flags) { ; }
169
+ virtual shared_ptr<BaseMatrix> DeleteZeroElements(double tol) const
170
+ {
171
+ throw Exception (string("DeleteZeroElements not overloaded, type =")+typeid(*this).name());
172
+ }
173
+
174
+
175
+ virtual void DoArchive (Archive & ar);
176
+
177
+
178
+ template <typename TSCAL>
179
+ Matrix<TSCAL> ToDense() const;
180
+
181
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const;
182
+
183
+ // time per run
184
+ double Timing (int runs = 10) const;
185
+
186
+ class OperatorInfo
187
+ {
188
+ public:
189
+ string name = "undef";
190
+ size_t height = 0, width = 0;
191
+ Array<const BaseMatrix*> childs;
192
+ OperatorInfo() = default;
193
+ OperatorInfo(string aname, size_t ah, size_t aw)
194
+ : name(aname), height(ah), width(aw) { }
195
+ };
196
+
197
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const;
198
+ void PrintOperatorInfo (ostream & ost, int level = 0) const;
199
+
200
+ // base class checks for sizes, derived BlockMatrix and ParallelMatrix check more
201
+ virtual xbool SameShape (BaseMatrix & other) const;
202
+ // *this * other
203
+ virtual xbool CanCompose (BaseMatrix & other) const;
204
+
205
+ virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const;
206
+ static std::map<type_index, function<shared_ptr<BaseMatrix>(const BaseMatrix&)>> devmatcreator;
207
+ static void RegisterDeviceMatrixCreator (type_index type,
208
+ function<shared_ptr<BaseMatrix>(const BaseMatrix&)> creator)
209
+ {
210
+ devmatcreator[type] = creator;
211
+ }
212
+
213
+ private:
214
+ BaseMatrix & operator= (const BaseMatrix & m2) { return *this; }
215
+
216
+ MemoryTracer mt = { "BaseMatrix" };
217
+ public:
218
+ const MemoryTracer& GetMemoryTracer() const { return mt; }
219
+ };
220
+
221
+
222
+
223
+
224
+
225
+
226
+ /// specifies the scalar type.
227
+ template <typename SCAL>
228
+ class NGS_DLL_HEADER S_BaseMatrix : virtual public BaseMatrix
229
+ {
230
+ public:
231
+ S_BaseMatrix () = default;
232
+ virtual ~S_BaseMatrix () = default;
233
+ // virtual bool IsComplex() const { return false; }
234
+ };
235
+
236
+ // specifies the scalar type Complex.
237
+ template <>
238
+ class S_BaseMatrix<Complex> : virtual public BaseMatrix
239
+ {
240
+ public:
241
+ ///
242
+ S_BaseMatrix () { is_complex = true; }
243
+ virtual ~S_BaseMatrix () = default;
244
+
245
+ // virtual bool IsComplex() const { return true; }
246
+
247
+ /*
248
+ /// calls MultAdd (Complex s);
249
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const;
250
+ /// must be overloaded
251
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const;
252
+
253
+ /// calls MultTransAdd (Complex s);
254
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const;
255
+ /// should be overloaded
256
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const;
257
+ */
258
+ };
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ /* *************************** Matrix * Vector ******************** */
267
+
268
+
269
+ ///
270
+ class VMatVecExpr
271
+ {
272
+ const BaseMatrix & m;
273
+ const BaseVector & x;
274
+
275
+ public:
276
+ VMatVecExpr (const BaseMatrix & am, const BaseVector & ax) : m(am), x(ax) { ; }
277
+
278
+ template <class TS>
279
+ void AssignTo (TS s, BaseVector & v) const
280
+ {
281
+ CheckSize (v);
282
+ m.Mult (x, v);
283
+ v *= s;
284
+ }
285
+
286
+ template <class TS>
287
+ void AddTo (TS s, BaseVector & v) const
288
+ {
289
+ CheckSize (v);
290
+ m.MultAdd (s, x, v);
291
+ }
292
+
293
+ NGS_DLL_HEADER void CheckSize (BaseVector & dest_vec) const;
294
+ };
295
+
296
+
297
+ /// BaseMatrix times Vector - expression template
298
+ inline VVecExpr<VMatVecExpr>
299
+ operator* (const BaseMatrix & a, const BaseVector & b)
300
+ {
301
+ return VMatVecExpr (a, b);
302
+ }
303
+
304
+
305
+
306
+ class NGS_DLL_HEADER DynamicMatVecExpression : public DynamicBaseExpression
307
+ {
308
+ shared_ptr<BaseMatrix> m;
309
+ shared_ptr<BaseVector> v;
310
+
311
+ AutoVector CreateVector() const override
312
+ { return m->CreateColVector(); }
313
+
314
+ AutoVector Evaluate() const override
315
+ {
316
+ return m->Evaluate(*v);
317
+ }
318
+
319
+ void AssignTo (double s, BaseVector & v2) const override
320
+ {
321
+ m->Mult(*v, v2);
322
+ v2 *= s;
323
+ }
324
+ void AddTo (double s, BaseVector & v2) const override
325
+ {
326
+ m->MultAdd (s, *v, v2);
327
+ }
328
+ void AssignTo (Complex s, BaseVector & v2) const override
329
+ {
330
+ m->Mult(*v, v2);
331
+ v2 *= s;
332
+ }
333
+ void AddTo (Complex s, BaseVector & v2) const override
334
+ {
335
+ m->MultAdd (s, *v, v2);
336
+ }
337
+ public:
338
+ DynamicMatVecExpression (shared_ptr<BaseMatrix> am, shared_ptr<BaseVector> av)
339
+ : m(am), v(av) { }
340
+ };
341
+
342
+
343
+
344
+ /* ************************** Transpose ************************* */
345
+
346
+ /**
347
+ The Transpose of a BaseMatrix.
348
+ */
349
+ class NGS_DLL_HEADER Transpose : public BaseMatrix
350
+ {
351
+ const BaseMatrix & bm;
352
+ shared_ptr<BaseMatrix> spbm;
353
+ public:
354
+ ///
355
+ Transpose (const BaseMatrix & abm) : bm(abm) { ; }
356
+ Transpose (shared_ptr<BaseMatrix> aspbm) : bm(*aspbm), spbm(aspbm) { ; }
357
+ ///
358
+ virtual bool IsComplex() const override { return bm.IsComplex(); }
359
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
360
+
361
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
362
+
363
+ virtual AutoVector CreateRowVector () const override { return bm.CreateColVector(); }
364
+ virtual AutoVector CreateColVector () const override { return bm.CreateRowVector(); }
365
+
366
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override
367
+ {
368
+ bm.MultTrans (x, y);
369
+ }
370
+
371
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override
372
+ {
373
+ bm.Mult (x, y);
374
+ }
375
+
376
+ ///
377
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
378
+ {
379
+ bm.MultTransAdd (s, x, y);
380
+ }
381
+ ///
382
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
383
+ {
384
+ bm.MultTransAdd (s, x, y);
385
+ }
386
+ ///
387
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
388
+ {
389
+ bm.MultAdd (s, x, y);
390
+ }
391
+ ///
392
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
393
+ {
394
+ bm.MultAdd (s, x, y);
395
+ }
396
+
397
+ virtual int VHeight() const override { return bm.VWidth(); }
398
+ virtual int VWidth() const override { return bm.VHeight(); }
399
+
400
+ auto SPtrMat() const { return spbm; }
401
+
402
+ virtual ostream & Print (ostream & ost) const override
403
+ {
404
+ ost << "Transpose of " << endl;
405
+ bm.Print(ost);
406
+ return ost;
407
+ }
408
+
409
+ virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
410
+ {
411
+ return make_shared<Transpose>(bm.CreateDeviceMatrix());
412
+ }
413
+
414
+ };
415
+
416
+
417
+
418
+ /* ************************** ConjTrans ************************* */
419
+
420
+ /**
421
+ The conjugate transpose of a BaseMatrix.
422
+ */
423
+ class NGS_DLL_HEADER ConjTrans : public BaseMatrix
424
+ {
425
+ shared_ptr<BaseMatrix> spbm;
426
+ public:
427
+ ConjTrans (shared_ptr<BaseMatrix> aspbm) : spbm(aspbm) { ; }
428
+ ///
429
+ virtual bool IsComplex() const override { return spbm->IsComplex(); }
430
+
431
+ virtual AutoVector CreateRowVector () const override { return spbm->CreateColVector(); }
432
+ virtual AutoVector CreateColVector () const override { return spbm->CreateRowVector(); }
433
+
434
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override
435
+ {
436
+ y = 0.0;
437
+ spbm->MultConjTransAdd (1, x, y);
438
+ }
439
+
440
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override
441
+ {
442
+ throw Exception("Trans of ConjTrans not available");
443
+ }
444
+
445
+ ///
446
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
447
+ {
448
+ spbm->MultConjTransAdd (s, x, y);
449
+ }
450
+ ///
451
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
452
+ {
453
+ spbm->MultConjTransAdd (s, x, y);
454
+ }
455
+ ///
456
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
457
+ {
458
+ throw Exception("Trans of ConjTrans not available");
459
+ }
460
+ ///
461
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
462
+ {
463
+ throw Exception("Trans of ConjTrans not available");
464
+ }
465
+
466
+ virtual int VHeight() const override { return spbm->VWidth(); }
467
+ virtual int VWidth() const override { return spbm->VHeight(); }
468
+
469
+
470
+ virtual ostream & Print (ostream & ost) const override
471
+ {
472
+ ost << "ConjTrans of " << endl;
473
+ spbm->Print(ost);
474
+ return ost;
475
+ }
476
+ };
477
+
478
+
479
+
480
+
481
+ /* ************************** Product ************************* */
482
+
483
+ /// action of product of two matrices
484
+ class NGS_DLL_HEADER ProductMatrix : public BaseMatrix
485
+ {
486
+ const BaseMatrix & bma;
487
+ const BaseMatrix & bmb;
488
+ shared_ptr<BaseMatrix> spbma;
489
+ shared_ptr<BaseMatrix> spbmb;
490
+ mutable AutoVector tempvec;
491
+ public:
492
+ ///
493
+ ProductMatrix (const BaseMatrix & abma, const BaseMatrix & abmb)
494
+ : bma(abma), bmb(abmb), tempvec(abmb.CreateColVector())
495
+ { ; }
496
+ ProductMatrix (shared_ptr<BaseMatrix> aspbma, shared_ptr<BaseMatrix> aspbmb)
497
+ : bma(*aspbma), bmb(*aspbmb), spbma(aspbma), spbmb(aspbmb)
498
+ // tempvec(aspbmb->CreateColVector())
499
+ {
500
+ try
501
+ {
502
+ tempvec.AssignPointer(bmb.CreateColVector());
503
+ }
504
+ catch (Exception & e)
505
+ {
506
+ tempvec.AssignPointer(bma.CreateRowVector());
507
+ }
508
+ }
509
+ ///
510
+ virtual bool IsComplex() const override { return bma.IsComplex() || bmb.IsComplex(); }
511
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
512
+
513
+ virtual AutoVector CreateRowVector () const override { return bmb.CreateRowVector(); }
514
+ virtual AutoVector CreateColVector () const override { return bma.CreateColVector(); }
515
+
516
+ auto SPtrA() const { return spbma; }
517
+ auto SPtrB() const { return spbmb; }
518
+
519
+
520
+ ///
521
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override
522
+ {
523
+ static Timer t("ProductMatrix::Mult"); RegionTimer reg(t);
524
+ bmb.Mult (x, tempvec);
525
+ bma.Mult (tempvec, y);
526
+ }
527
+
528
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override
529
+ {
530
+ static Timer t("ProductMatrix::Mult"); RegionTimer reg(t);
531
+ bma.MultTrans (x, tempvec);
532
+ bmb.MultTrans (tempvec, y);
533
+ }
534
+
535
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
536
+ {
537
+ static Timer t("ProductMatrix::MultAdd"); RegionTimer reg(t);
538
+ bmb.Mult (x, tempvec);
539
+ bma.MultAdd (s, tempvec, y);
540
+ }
541
+ ///
542
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
543
+ {
544
+ static Timer t("ProductMatrix::MultAdd complex"); RegionTimer reg(t);
545
+ bmb.Mult (x, tempvec);
546
+ bma.MultAdd (s, tempvec, y);
547
+ }
548
+ ///
549
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
550
+ {
551
+ static Timer t("ProductMatrix::MultTransAdd"); RegionTimer reg(t);
552
+ bma.MultTrans (x, tempvec);
553
+ bmb.MultTransAdd (s, tempvec, y);
554
+ }
555
+ ///
556
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
557
+ {
558
+ static Timer t("ProductMatrix::MultTransAdd complex"); RegionTimer reg(t);
559
+ bma.MultTrans (x, tempvec);
560
+ bmb.MultTransAdd (s, tempvec, y);
561
+ }
562
+
563
+ virtual void MultAdd (FlatVector<double> alpha, const MultiVector & x, MultiVector & y) const override
564
+ {
565
+ static Timer t("ProductMatrix::MultAdd(mv)"); RegionTimer reg(t);
566
+ auto tempvec = shared_ptr<BaseVector>(bmb.CreateColVector())->CreateMultiVector(x.Size());
567
+ *tempvec = 0;
568
+ Vector ones(x.Size());
569
+ ones = 1.0;
570
+ bmb.MultAdd (ones, x, *tempvec);
571
+ bma.MultAdd (alpha, *tempvec, y);
572
+ }
573
+
574
+
575
+ virtual int VHeight() const override { return bma.VHeight(); }
576
+ virtual int VWidth() const override { return bmb.VWidth(); }
577
+
578
+ virtual ostream & Print (ostream & ost) const override
579
+ {
580
+ ost << "Product of" << endl;
581
+ bma.Print(ost);
582
+ bmb.Print(ost);
583
+ return ost;
584
+ }
585
+
586
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
587
+
588
+ virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
589
+ {
590
+ return make_shared<ProductMatrix>(bma.CreateDeviceMatrix(), bmb.CreateDeviceMatrix());
591
+ }
592
+
593
+ };
594
+
595
+
596
+ /* ************************** Sum ************************* */
597
+
598
+ /// action of product of two matrices
599
+ class NGS_DLL_HEADER SumMatrix : public BaseMatrix
600
+ {
601
+ const BaseMatrix & bma;
602
+ const BaseMatrix & bmb;
603
+ shared_ptr<BaseMatrix> spbma;
604
+ shared_ptr<BaseMatrix> spbmb;
605
+ double a, b;
606
+ public:
607
+ ///
608
+ SumMatrix (const BaseMatrix & abma, const BaseMatrix & abmb,
609
+ double aa = 1, double ab = 1)
610
+ : bma(abma), bmb(abmb), a(aa), b(ab)
611
+ { ; }
612
+ SumMatrix (shared_ptr<BaseMatrix> aspbma, shared_ptr<BaseMatrix> aspbmb,
613
+ double aa = 1, double ab = 1);
614
+
615
+ ///
616
+ virtual bool IsComplex() const override { return bma.IsComplex() || bmb.IsComplex(); }
617
+
618
+ auto SPtrA() const { return spbma; }
619
+ auto SPtrB() const { return spbmb; }
620
+
621
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
622
+
623
+ virtual AutoVector CreateRowVector () const override
624
+ {
625
+ try
626
+ {
627
+ return bma.CreateRowVector();
628
+ }
629
+ catch (Exception & e)
630
+ {
631
+ return bmb.CreateRowVector();
632
+ }
633
+ }
634
+ virtual AutoVector CreateColVector () const override
635
+ {
636
+ try
637
+ {
638
+ return bma.CreateColVector();
639
+ }
640
+ catch (Exception & e)
641
+ {
642
+ return bmb.CreateColVector();
643
+ }
644
+ }
645
+
646
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override
647
+ {
648
+ static Timer t("SumMatrix::Mult"); RegionTimer reg(t);
649
+ if (a == 1)
650
+ bma.Mult (x, y);
651
+ else
652
+ {
653
+ y = 0.0;
654
+ bma.MultAdd (a, x, y);
655
+ }
656
+ bmb.MultAdd (b, x, y);
657
+ }
658
+
659
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override
660
+ {
661
+ static Timer t("SumMatrix::MultTrans"); RegionTimer reg(t);
662
+ if (a == 1)
663
+ bma.MultTrans (x, y);
664
+ else
665
+ {
666
+ y = 0.0;
667
+ bma.MultTransAdd (a, x, y);
668
+ }
669
+ bmb.MultTransAdd (b, x, y);
670
+ }
671
+
672
+ ///
673
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
674
+ {
675
+ static Timer t("SumMatrix::MultAdd"); RegionTimer reg(t);
676
+ bma.MultAdd (a*s, x, y);
677
+ bmb.MultAdd (b*s, x, y);
678
+ }
679
+ ///
680
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
681
+ {
682
+ static Timer t("SumMatrix::MultAdd complex"); RegionTimer reg(t);
683
+ bma.MultAdd (a*s, x, y);
684
+ bmb.MultAdd (b*s, x, y);
685
+ }
686
+ ///
687
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
688
+ {
689
+ static Timer t("SumMatrix::MultTransAdd"); RegionTimer reg(t);
690
+ bma.MultTransAdd (a*s, x, y);
691
+ bmb.MultTransAdd (b*s, x, y);
692
+ }
693
+ ///
694
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
695
+ {
696
+ static Timer t("SumMatrix::MultAdd complex"); RegionTimer reg(t);
697
+ bma.MultTransAdd (a*s, x, y);
698
+ bmb.MultTransAdd (b*s, x, y);
699
+ }
700
+
701
+ /// y += alpha M x
702
+ virtual void MultAdd (FlatVector<double> alpha, const MultiVector & x, MultiVector & y) const override
703
+ {
704
+ static Timer t("SumMatrix::MultAdd(mv)"); RegionTimer reg(t);
705
+ bma.MultAdd (Vector(a*alpha), x, y);
706
+ bmb.MultAdd (Vector(b*alpha), x, y);
707
+ }
708
+
709
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
710
+
711
+ virtual int VHeight() const override
712
+ {
713
+ try
714
+ {
715
+ return bma.VHeight();
716
+ }
717
+ catch (Exception &)
718
+ {
719
+ return bmb.VHeight();
720
+ }
721
+ }
722
+
723
+ virtual int VWidth() const override
724
+ {
725
+ try
726
+ {
727
+ return bma.VWidth();
728
+ }
729
+ catch (Exception &)
730
+ {
731
+ return bmb.VWidth();
732
+ }
733
+ }
734
+
735
+ virtual ostream & Print (ostream & ost) const override
736
+ {
737
+ ost << "Sum of" << endl;
738
+ ost << "Scale a = " << a << endl;
739
+ bma.Print(ost);
740
+ ost << "Scale b = " << b << endl;
741
+ bmb.Print(ost);
742
+ return ost;
743
+ }
744
+
745
+ virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
746
+ {
747
+ return make_shared<SumMatrix>(bma.CreateDeviceMatrix(), bmb.CreateDeviceMatrix(), a, b);
748
+ }
749
+
750
+ };
751
+
752
+
753
+ /* ************************** Scale ************************* */
754
+
755
+ template <typename TSCAL>
756
+ class VScaleMatrix : public BaseMatrix
757
+ {
758
+ const BaseMatrix & bm;
759
+ shared_ptr<BaseMatrix> spbm;
760
+ TSCAL scale;
761
+ public:
762
+ ///
763
+ VScaleMatrix (const BaseMatrix & abm, TSCAL ascale) : bm(abm), scale(ascale) { ; }
764
+ VScaleMatrix (shared_ptr<BaseMatrix> aspbm, TSCAL ascale)
765
+ : bm(*aspbm), spbm(aspbm), scale(ascale) { ; }
766
+ TSCAL GetScalingFactor() const { return scale; }
767
+ virtual bool IsComplex() const override
768
+ { return bm.IsComplex() || typeid(TSCAL)==typeid(Complex); }
769
+ ///
770
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
771
+ {
772
+ static Timer t("ScaleMatrix::MultAdd"); RegionTimer reg(t);
773
+ bm.MultAdd (s*scale, x, y);
774
+ }
775
+ ///
776
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
777
+ {
778
+ static Timer t("ScaleMatrix::MultAdd complex"); RegionTimer reg(t);
779
+ bm.MultAdd (s*scale, x, y);
780
+ }
781
+ ///
782
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
783
+ {
784
+ static Timer t("ScaleMatrix::MultTransAdd"); RegionTimer reg(t);
785
+ bm.MultTransAdd (s*scale, x, y);
786
+ }
787
+ ///
788
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
789
+ {
790
+ static Timer t("ScaleMatrix::MultTransAdd complex"); RegionTimer reg(t);
791
+ bm.MultTransAdd (s*scale, x, y);
792
+ }
793
+
794
+ virtual void MultAdd (FlatVector<double> alpha, const MultiVector & x, MultiVector & y) const override
795
+ {
796
+ static Timer t("ScaleMatrix::MultAdd(mv)"); RegionTimer reg(t);
797
+ if constexpr (is_same<TSCAL, double>())
798
+ {
799
+ bm.MultAdd (Vector(scale*alpha), x, y);
800
+ }
801
+ else
802
+ BaseMatrix::MultAdd(alpha, x, y);
803
+ }
804
+
805
+
806
+
807
+
808
+ virtual int VHeight() const override { return bm.VHeight(); }
809
+ virtual int VWidth() const override { return bm.VWidth(); }
810
+ virtual AutoVector CreateRowVector () const override { return bm.CreateRowVector(); }
811
+ virtual AutoVector CreateColVector () const override { return bm.CreateColVector(); }
812
+ virtual ostream & Print (ostream & ost) const override
813
+ {
814
+ ost << "Scale with " << scale << ":" << endl;
815
+ bm.Print(ost);
816
+ return ost;
817
+ }
818
+
819
+ auto SPtrMat() const { return spbm; }
820
+
821
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override
822
+ {
823
+ OperatorInfo info;
824
+ info.name = "ScaleMatrix, scale = "+ToString(scale);
825
+ info.height = Height();
826
+ info.width = Width();
827
+ info.childs += &bm;
828
+ return info;
829
+ }
830
+
831
+ virtual shared_ptr<BaseSparseMatrix> CreateSparseMatrix() const override;
832
+
833
+ virtual shared_ptr<BaseMatrix> CreateDeviceMatrix() const override
834
+ {
835
+ return make_shared<VScaleMatrix<TSCAL>>(bm.CreateDeviceMatrix(), scale);
836
+ }
837
+ };
838
+
839
+ inline VScaleMatrix<double> operator* (double d, const BaseMatrix & m)
840
+ {
841
+ return VScaleMatrix<double> (m, d);
842
+ }
843
+
844
+
845
+ /* ************************** Identity ************************* */
846
+
847
+ class NGS_DLL_HEADER IdentityMatrix : public BaseMatrix
848
+ {
849
+ bool has_format;
850
+ size_t size;
851
+ public:
852
+ ///
853
+ IdentityMatrix ()
854
+ : has_format(false) { ; }
855
+ IdentityMatrix (size_t asize, bool ais_complex)
856
+ : has_format(true), size(asize) { is_complex=ais_complex; }
857
+
858
+ virtual BaseMatrix::OperatorInfo GetOperatorInfo () const override;
859
+
860
+ ///
861
+ virtual void Mult (const BaseVector & x, BaseVector & y) const override
862
+ {
863
+ static Timer t("IdentityMatrix::Mult"); RegionTimer reg(t);
864
+ y = x;
865
+ }
866
+ virtual void MultTrans (const BaseVector & x, BaseVector & y) const override
867
+ {
868
+ static Timer t("IdentityMatrix::MultTrans"); RegionTimer reg(t);
869
+ y = x;
870
+ }
871
+ ///
872
+ virtual void MultAdd (double s, const BaseVector & x, BaseVector & y) const override
873
+ {
874
+ static Timer t("IdentityMatrix::MultAdd"); RegionTimer reg(t);
875
+ y += s*x;
876
+ }
877
+ ///
878
+ virtual void MultAdd (Complex s, const BaseVector & x, BaseVector & y) const override
879
+ {
880
+ static Timer t("IdentityMatrix::MultAdd Complex"); RegionTimer reg(t);
881
+ y += s*x;
882
+ }
883
+ ///
884
+ virtual void MultTransAdd (double s, const BaseVector & x, BaseVector & y) const override
885
+ {
886
+ static Timer t("IdentityMatrix::MultTransAdd"); RegionTimer reg(t);
887
+ y += s*x;
888
+ }
889
+ ///
890
+ virtual void MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const override
891
+ {
892
+ static Timer t("IdentityMatrix::MultTransAdd Complex"); RegionTimer reg(t);
893
+ y += s*x;
894
+ }
895
+
896
+ virtual int VHeight() const override
897
+ {
898
+ if (has_format) return size;
899
+ throw Exception("Identity: no Height");
900
+ }
901
+ virtual int VWidth() const override
902
+ {
903
+ if (has_format) return size;
904
+ throw Exception("Identity: no Width");
905
+ }
906
+ virtual AutoVector CreateRowVector () const override
907
+ {
908
+ if (has_format)
909
+ return CreateBaseVector(size, is_complex, 1);
910
+ throw Exception("Identity: no RowVector");
911
+ }
912
+ virtual AutoVector CreateColVector () const override
913
+ {
914
+ if (has_format)
915
+ return CreateBaseVector(size, is_complex, 1);
916
+ throw Exception("Identity: no ColVector");
917
+ }
918
+
919
+ virtual ostream & Print (ostream & ost) const override
920
+ {
921
+ ost << "Identity" << endl;
922
+ return ost;
923
+ }
924
+
925
+ };
926
+
927
+
928
+ /* *********************** operators ********************** */
929
+
930
+ // default is ProductMatrix, but optimizations for
931
+ // ParallelMatrices
932
+ // Embedding Matrices
933
+ // ....
934
+ shared_ptr<BaseMatrix> ComposeOperators (shared_ptr<BaseMatrix> a,
935
+ shared_ptr<BaseMatrix> b);
936
+ shared_ptr<BaseMatrix> AddOperators (shared_ptr<BaseMatrix> a,
937
+ shared_ptr<BaseMatrix> b,
938
+ double faca, double facb);
939
+
940
+ inline shared_ptr<BaseMatrix> operator* (shared_ptr<BaseMatrix> a,
941
+ shared_ptr<BaseMatrix> b)
942
+ {
943
+ return ComposeOperators(a,b);
944
+ }
945
+
946
+ inline shared_ptr<BaseMatrix> operator+ (shared_ptr<BaseMatrix> a,
947
+ shared_ptr<BaseMatrix> b)
948
+ {
949
+ return AddOperators(a,b,1,1);
950
+ }
951
+
952
+
953
+ shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat);
954
+
955
+
956
+ inline ostream & operator<< (ostream & ost, const BaseMatrix & m)
957
+ {
958
+ return m.Print(ost);
959
+ }
960
+
961
+ }
962
+
963
+ #endif