MCPcopy Create free account
hub / github.com/Kitware/VTK / SumImpl

Class SumImpl

Wrapping/Python/vtkmodules/numpy_interface/numpy_algorithms.py:166–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 """
165 from .algorithms import global_func
166 class SumImpl:
167 def op(self):
168 return algs.sum
169
170 def mpi_op(self):
171 from mpi4py import MPI
172 return MPI.SUM
173
174 def serial_composite(self, array, axis):
175 res = None
176 arrays = array.Arrays
177 for a in arrays:
178 if a is not dsa.NoneArray:
179 if res is None:
180 res = algs.sum(a, axis).astype(numpy.float64)
181 else:
182 res += algs.sum(a, axis)
183 return res
184
185 def default(self):
186 return numpy.float64(0)
187
188 return global_func(SumImpl(), array, axis, controller)
189

Callers 1

sumFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected