PageRenderTime 26ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/hpc_kernel_samples/sparse_linear_algebra/casestudies/pagerank-petsc/petsc-2.3.2-p10/src/tops/server/cxx/TOPS_Structured_Matrix_Impl.cxx

https://gitlab.com/steinret/CodeVault
C++ | 201 lines | 97 code | 20 blank | 84 comment | 21 complexity | b26994ff78ec81ff16e13cf25a62e963 MD5 | raw file
  1. //
  2. // File: TOPS_Structured_Matrix_Impl.cxx
  3. // Symbol: TOPS.Structured.Matrix-v0.0.0
  4. // Symbol Type: class
  5. // Babel Version: 1.0.0
  6. // Description: Server-side implementation for TOPS.Structured.Matrix
  7. //
  8. // WARNING: Automatically generated; only changes within splicers preserved
  9. //
  10. //
  11. #include "TOPS_Structured_Matrix_Impl.hxx"
  12. //
  13. // Includes for all method dependencies.
  14. //
  15. #ifndef included_sidl_BaseInterface_hxx
  16. #include "sidl_BaseInterface.hxx"
  17. #endif
  18. #ifndef included_sidl_ClassInfo_hxx
  19. #include "sidl_ClassInfo.hxx"
  20. #endif
  21. #ifndef included_sidl_NotImplementedException_hxx
  22. #include "sidl_NotImplementedException.hxx"
  23. #endif
  24. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._includes)
  25. // Insert-Code-Here {TOPS.Structured.Matrix._includes} (additional includes or code)
  26. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._includes)
  27. // speical constructor, used for data wrapping(required). Do not put code here unless you really know what you're doing!
  28. TOPS::Structured::Matrix_impl::Matrix_impl() : StubBase(reinterpret_cast<
  29. void*>(::TOPS::Structured::Matrix::_wrapObj(reinterpret_cast< void*>(this))),
  30. false) , _wrapped(true){
  31. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._ctor2)
  32. // Insert-Code-Here {TOPS.Structured.Matrix._ctor2} (ctor2)
  33. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._ctor2)
  34. }
  35. // user defined constructor
  36. void TOPS::Structured::Matrix_impl::_ctor() {
  37. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._ctor)
  38. // Insert-Code-Here {TOPS.Structured.Matrix._ctor} (constructor)
  39. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._ctor)
  40. }
  41. // user defined destructor
  42. void TOPS::Structured::Matrix_impl::_dtor() {
  43. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._dtor)
  44. // Insert-Code-Here {TOPS.Structured.Matrix._dtor} (destructor)
  45. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._dtor)
  46. }
  47. // static class initializer
  48. void TOPS::Structured::Matrix_impl::_load() {
  49. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._load)
  50. // Insert-Code-Here {TOPS.Structured.Matrix._load} (class initialization)
  51. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._load)
  52. }
  53. // user defined static methods: (none)
  54. // user defined non-static methods:
  55. /**
  56. * Method: dimen[]
  57. */
  58. int32_t
  59. TOPS::Structured::Matrix_impl::dimen_impl ()
  60. {
  61. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.dimen)
  62. return this->vdimen;
  63. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.dimen)
  64. }
  65. /**
  66. * Method: lower[]
  67. */
  68. int32_t
  69. TOPS::Structured::Matrix_impl::lower_impl (
  70. /* in */int32_t a )
  71. {
  72. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.lower)
  73. return this->vlower[a];
  74. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.lower)
  75. }
  76. /**
  77. * Method: length[]
  78. */
  79. int32_t
  80. TOPS::Structured::Matrix_impl::length_impl (
  81. /* in */int32_t a )
  82. {
  83. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.length)
  84. return this->vlength[a];
  85. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.length)
  86. }
  87. /**
  88. * Method: set[D1]
  89. */
  90. void
  91. TOPS::Structured::Matrix_impl::set_impl (
  92. /* in */int32_t i,
  93. /* in array<double,2> */::sidl::array<double> values )
  94. {
  95. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.setD1)
  96. // Insert-Code-Here {TOPS.Structured.Matrix.setD1} (set method)
  97. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.setD1)
  98. }
  99. /**
  100. * Method: set[D2]
  101. */
  102. void
  103. TOPS::Structured::Matrix_impl::set_impl (
  104. /* in */int32_t i,
  105. /* in */int32_t j,
  106. /* in array<double,2> */::sidl::array<double> values )
  107. {
  108. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.setD2)
  109. int I = i - this->gghostlower[0] + this->gghostlength[0]*(j - this->gghostlower[1]);
  110. if ((values.dimen() == 1 || values.length(1) == 1) && values.length(0) == 1) {
  111. MatSetValuesLocal(this->mat,1,&I,1,&I,values.first(),INSERT_VALUES);
  112. } else {
  113. MatSetValuesRowLocal(this->mat,I,values.first());
  114. }
  115. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.setD2)
  116. }
  117. /**
  118. * Method: set[D3]
  119. */
  120. void
  121. TOPS::Structured::Matrix_impl::set_impl (
  122. /* in */int32_t i,
  123. /* in */int32_t j,
  124. /* in */int32_t k,
  125. /* in array<double,2> */::sidl::array<double> values )
  126. {
  127. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.setD3)
  128. int I = i - this->gghostlower[0] + this->gghostlength[0]*(j - this->gghostlower[1]) + this->gghostlength[0]*this->gghostlength[1]*(k - this->gghostlower[2]);
  129. if ((values.dimen() == 1 || values.length(1) == 1) && values.length(0) == 1) {
  130. MatSetValuesLocal(this->mat,1,&I,1,&I,values.first(),INSERT_VALUES);
  131. } else {
  132. MatSetValuesRowLocal(this->mat,I,values.first());
  133. }
  134. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.setD3)
  135. }
  136. /**
  137. * Method: set[D4]
  138. */
  139. void
  140. TOPS::Structured::Matrix_impl::set_impl (
  141. /* in */int32_t i,
  142. /* in */int32_t j,
  143. /* in */int32_t k,
  144. /* in */int32_t l,
  145. /* in array<double,2> */::sidl::array<double> values )
  146. {
  147. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.setD4)
  148. int I = i - this->gghostlower[0] + this->gghostlength[0]*(j - this->gghostlower[1]) + this->gghostlength[0]*this->gghostlength[1]*(k - this->gghostlower[2]) +
  149. this->gghostlength[0]*this->gghostlength[1]*this->gghostlength[2]*(l - gghostlower[3]);
  150. if ((values.dimen() == 1 || values.length(1) == 1) && values.length(0) == 1) {
  151. MatSetValuesLocal(this->mat,1,&I,1,&I,values.first(),INSERT_VALUES);
  152. } else {
  153. MatSetValuesRowLocal(this->mat,I,values.first());
  154. }
  155. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.setD4)
  156. }
  157. /**
  158. * Method: apply[]
  159. */
  160. void
  161. TOPS::Structured::Matrix_impl::apply_impl (
  162. /* in array<double> */::sidl::array<double> x,
  163. /* in array<double> */::sidl::array<double> y )
  164. {
  165. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.apply)
  166. // Insert-Code-Here {TOPS.Structured.Matrix.apply} (apply method)
  167. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.apply)
  168. }
  169. /**
  170. * Method: zero[]
  171. */
  172. void
  173. TOPS::Structured::Matrix_impl::zero_impl ()
  174. {
  175. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix.zero)
  176. MatZeroEntries(this->mat);
  177. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix.zero)
  178. }
  179. // DO-NOT-DELETE splicer.begin(TOPS.Structured.Matrix._misc)
  180. // Insert-Code-Here {TOPS.Structured.Matrix._misc} (miscellaneous code)
  181. // DO-NOT-DELETE splicer.end(TOPS.Structured.Matrix._misc)