def negate(value, width=None):
 if (width is None):
  width = context.bits
 mask = ((1 << width) - 1)
 return (((mask + 1) - value) & mask)

def negate ( value , width = None ) : if ( width is None ) : width = context . bits mask = ( ( 1 << width ) - 1 ) return ( ( ( mask + 1 ) - value ) & mask )
negates the elements of a matrix row-wise .