Package: primitives

## [Java] Class double[][]

- primitives.double[][]

-     public class double[][]
      extends Object

  GDK enhancements for double[][].

  displayName:
    double[][]
  receiverFqcn:
    double[][]

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public double[]` | `column(int col)` Select a column from a 2D array.
    `` | `public double` | `eachColumn(Closure<?> closure)` Process the columns of the array.
    `` | `public List<Double>` | `flatten()` Flattens a 2D array into a new collection.
    `` | `public double` | `transpose()` A transpose method for 2D double arrays.
    `` | `public Iterator<double[]>` | `transposing()` An iterator of the columns of the array.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public double[] column(int col)

      Select a column from a 2D array.

           double[][] nums = [[1.0d, 2.0d], [10.0d, 20.0d]]
           assert nums.column(0) == [1.0d, 10.0d] as double[]
           assert nums.column(1) == [2.0d, 20.0d] as double[]

      Returns:
        a double[]
      Since:
        5.0.0

    - #### public double eachColumn(Closure<?> closure)

      Process the columns of the array.

           double[][] nums = [[1.0d, 2.0d], [10.0d, 20.0d]]
           nums.eachColumn {
               assert it[0] * 10.0d == it[1]
           }

      Parameters:
        `closure` - the closure applied on each array column
      Returns:
        the self array
      Since:
        5.0.0

    - #### public List<Double> flatten()

      Flattens a 2D array into a new collection. The items are copied row by row.

      Example usage:

           double[][] array = [[0.0f, 1.0f], [2.0f, 3.0f]]
           assert array.flatten() == [0.0f, 1.0f, 2.0f, 3.0f]

      Returns:
        a Collection of the array elements
      Since:
        5.0.0

    - #### public double transpose()

      A transpose method for 2D double arrays.

      Example usage:

           double[][] doubles = [[1.0d, 10.0d], [2.0d, 20.0d]]
           double[][] expected = [[1.0d, 2.0d], [10.0d, 20.0d]]
           def result = doubles.transpose()
           assert result == expected
           assert doubles.class.componentType == result.class.componentType

      Returns:
        the transposed 2D double array
      Since:
        3.0.8

    - #### public Iterator<double[]> transposing()

      An iterator of the columns of the array.

           double[][] nums = [[1.0d, 2.0d], [10.0d, 20.0d]]
           assert nums.transpose() == nums.transposing().toList()

      Returns:
        the iterator
      Since:
        5.0.0