def histogram( *ret_shape )
      options = ret_shape.last.is_a?( Hash ) ? ret_shape.pop : {}
      options = { :weight => UINT.new( 1 ), :safe => true }.merge options
      unless options[:weight].matched?
        options[:weight] = Node.match(options[:weight]).maxint.new options[:weight]
      end
      if ( shape.first != 1 or dimension == 1 ) and ret_shape.size == 1
        [ self ].histogram *( ret_shape + [ options ] )
      else
        ( 0 ... shape.first ).collect { |i| unroll[i] }.
          histogram *( ret_shape + [ options ] )
      end
    end
def histogram( *ret_shape )
      options = ret_shape.last.is_a?( Hash ) ? ret_shape.pop : {}
      options = { :weight => UINT.new( 1 ), :safe => true }.merge options
      unless options[:weight].matched?
        options[:weight] = Node.match(options[:weight]).maxint.new options[:weight]
      end
      if ( shape.first != 1 or dimension == 1 ) and ret_shape.size == 1
        [ self ].histogram *( ret_shape + [ options ] )
      else
        ( 0 ... shape.first ).collect { |i| unroll[i] }.
          histogram *( ret_shape + [ options ] )
      end
    end
Compute histogram of this array

 @overload histogram( *ret_shape, options = {} )
   @param [Array<Integer>] ret_shape Dimensions of resulting histogram.
   @option options [Node] :weight (UINT(1)) Weights for computing the histogram.
   @option options [Boolean] :safe (true) Do a boundary check before creating the
           histogram.

 @return [Node] The histogram.