3277 |
return identity(self.getShape()) |
return identity(self.getShape()) |
3278 |
else: |
else: |
3279 |
return transpose(self.getDifferentiatedArguments(arg)[0],axis_offset=self.getArgument()[1]) |
return transpose(self.getDifferentiatedArguments(arg)[0],axis_offset=self.getArgument()[1]) |
3280 |
|
def symmetric(arg): |
3281 |
|
""" |
3282 |
|
returns the symmetric part of the square matrix arg. This is (arg+transpose(arg))/2 |
3283 |
|
|
3284 |
|
@param arg: square matrix. Must have rank 2 or 4 and be square. |
3285 |
|
@type arg: L{numarray.NumArray}, L{escript.Data}, L{Symbol} |
3286 |
|
@return: symmetric part of arg |
3287 |
|
@rtype: L{numarray.NumArray}, L{escript.Data}, L{Symbol} depending on the input |
3288 |
|
""" |
3289 |
|
return (arg+transpose(arg))/2 |
3290 |
|
|
3291 |
|
def nonsymmetric(arg): |
3292 |
|
""" |
3293 |
|
returns the nonsymmetric part of the square matrix arg. This is (arg-transpose(arg))/2 |
3294 |
|
|
3295 |
|
@param arg: square matrix. Must have rank 2 or 4 and be square. |
3296 |
|
@type arg: L{numarray.NumArray}, L{escript.Data}, L{Symbol} |
3297 |
|
@return: symmetric part of arg |
3298 |
|
@rtype: L{numarray.NumArray}, L{escript.Data}, L{Symbol} depending on the input |
3299 |
|
""" |
3300 |
|
return (arg-transpose(arg))/2 |
3301 |
|
|
3302 |
def inverse(arg): |
def inverse(arg): |
3303 |
""" |
""" |