@@ -236,63 +236,88 @@ def __getitem__(self, row):
236
236
def add (self , other , * args , ** kwargs ):
237
237
'''Algebra: add method of BlockDataContainer with number/DataContainer or BlockDataContainer
238
238
239
- :param: other (number, DataContainer or subclasses or BlockDataContainer
240
- :param: out (optional): provides a placehold for the resul.
239
+ Parameters
240
+ ----------
241
+ other : number, DataContainer or subclasses or BlockDataContainer
242
+ out : BlockDataContainer, optional
243
+ Provides a placeholder for the result
241
244
'''
242
245
return self .binary_operations (BlockDataContainer .ADD , other , * args , ** kwargs )
243
246
def subtract (self , other , * args , ** kwargs ):
244
247
'''Algebra: subtract method of BlockDataContainer with number/DataContainer or BlockDataContainer
245
248
246
- :param: other (number, DataContainer or subclasses or BlockDataContainer
247
- :param: out (optional): provides a placeholder for the result.
249
+ Parameters
250
+ ----------
251
+ other : number, DataContainer or subclasses or BlockDataContainer
252
+ out : BlockDataContainer, optional
253
+ Provides a placeholder for the result
248
254
'''
249
255
return self .binary_operations (BlockDataContainer .SUBTRACT , other , * args , ** kwargs )
250
256
def multiply (self , other , * args , ** kwargs ):
251
257
'''Algebra: multiply method of BlockDataContainer with number/DataContainer or BlockDataContainer
252
258
253
- :param: other (number, DataContainer or subclasses or BlockDataContainer)
254
- :param: out (optional): provides a placeholder for the result.
259
+ Parameters
260
+ ----------
261
+ other : number, DataContainer or subclasses or BlockDataContainer
262
+ out : BlockDataContainer, optional
263
+ Provides a placeholder for the result
255
264
'''
256
265
return self .binary_operations (BlockDataContainer .MULTIPLY , other , * args , ** kwargs )
257
266
def divide (self , other , * args , ** kwargs ):
258
267
'''Algebra: divide method of BlockDataContainer with number/DataContainer or BlockDataContainer
259
268
260
- :param: other (number, DataContainer or subclasses or BlockDataContainer)
261
- :param: out (optional): provides a placeholder for the result.
269
+ Parameters
270
+ ----------
271
+ other : number, DataContainer or subclasses or BlockDataContainer
272
+ out : BlockDataContainer, optional
273
+ Provides a placeholder for the result
274
+
262
275
'''
263
276
return self .binary_operations (BlockDataContainer .DIVIDE , other , * args , ** kwargs )
264
277
def power (self , other , * args , ** kwargs ):
265
278
'''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer
266
279
267
- :param: other (number, DataContainer or subclasses or BlockDataContainer
268
- :param: out (optional): provides a placeholder for the result.
280
+ Parameters
281
+ ----------
282
+ other : number, DataContainer or subclasses or BlockDataContainer
283
+ out : BlockDataContainer, optional
284
+ Provides a placeholder for the result
269
285
'''
270
286
return self .binary_operations (BlockDataContainer .POWER , other , * args , ** kwargs )
271
287
def maximum (self , other , * args , ** kwargs ):
272
- '''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer
288
+ '''Algebra: maximum method of BlockDataContainer with number/DataContainer or BlockDataContainer
273
289
274
- :param: other (number, DataContainer or subclasses or BlockDataContainer)
275
- :param: out (optional): provides a placeholder for the result.
290
+ Parameters
291
+ ----------
292
+ other : number, DataContainer or subclasses or BlockDataContainer
293
+ out : BlockDataContainer, optional
294
+ Provides a placeholder for the result
276
295
'''
277
296
return self .binary_operations (BlockDataContainer .MAXIMUM , other , * args , ** kwargs )
278
297
def minimum (self , other , * args , ** kwargs ):
279
- '''Algebra: power method of BlockDataContainer with number/DataContainer or BlockDataContainer
280
-
281
- :param: other (number, DataContainer or subclasses or BlockDataContainer)
282
- :param: out (optional): provides a placeholder for the result.
298
+ '''Algebra: minimum method of BlockDataContainer with number/DataContainer or BlockDataContainer
299
+
300
+ Parameters
301
+ ----------
302
+ other : number, DataContainer or subclasses or BlockDataContainer
303
+ out : BlockDataContainer, optional
304
+ Provides a placeholder for the result
305
+
283
306
'''
284
307
return self .binary_operations (BlockDataContainer .MINIMUM , other , * args , ** kwargs )
285
308
286
- def sapyb (self , a , y , b , out , num_threads = NUM_THREADS ):
309
+ def sapyb (self , a , y , b , out = None , num_threads = NUM_THREADS ):
287
310
r'''performs axpby element-wise on the BlockDataContainer containers
288
311
289
312
Does the operation .. math:: a*x+b*y and stores the result in out, where x is self
290
313
291
- :param a: scalar
292
- :param b: scalar
293
- :param y: compatible (Block)DataContainer
294
- :param out: (Block)DataContainer to store the result
295
-
314
+ Parameters
315
+ ----------
316
+ a : scalar or BlockDataContainer
317
+ b : scalar or BlockDataContainer
318
+ y : compatible (Block)DataContainer
319
+ out : BlockDataContainer, optional
320
+ Provides a placeholder for the result
296
321
297
322
Example:
298
323
--------
@@ -307,9 +332,9 @@ def sapyb(self, a, y, b, out, num_threads = NUM_THREADS):
307
332
>>> out = bdc1.sapyb(a,bdc2,b)
308
333
'''
309
334
if out is None :
310
- raise ValueError ( " out container cannot be None" )
335
+ out = self * 0
311
336
kwargs = {'a' :a , 'b' :b , 'out' :out , 'num_threads' : NUM_THREADS }
312
- self .binary_operations (BlockDataContainer .SAPYB , y , ** kwargs )
337
+ return self .binary_operations (BlockDataContainer .SAPYB , y , ** kwargs )
313
338
314
339
315
340
def axpby (self , a , b , y , out , dtype = numpy .float32 , num_threads = NUM_THREADS ):
0 commit comments