Package org.apache.sysds.runtime.compress.colgroup.mapping

## Interface MapToFactory

    public interface MapToFactory

### Nested Class Summary

Nested Classes
`static class` `MapToFactory.MAP_TYPE`

### Field Summary

Fields
`static org.apache.commons.logging.Log` `LOG`

### Method Summary

Static Methods
`static AMapToData` `create​(int size, boolean zeros, IntArrayList[] values)`
`static AMapToData` `create​(int size, int numTuples)` Create and allocate a map with the given size and support for upto the num tuples argument of values
`static AMapToData` `create​(int size, int[] values, int nUnique)`
`static AMapToData` `create​(int size, ABitmap ubm)`
`static AMapToData` `create​(int size, MapToFactory.MAP_TYPE t)`
`static long` `estimateInMemorySize​(int size, int numTuples)`
`static AMapToData` `readIn​(DataInput in)`
`static AMapToData` `resize​(AMapToData d, int numTuples)` Reshape the map, to a smaller instance if applicable.
`static AMapToData` `resizeForce​(AMapToData d, MapToFactory.MAP_TYPE t)` Force the mapping into an other mapping type.

### Field Detail

#### LOG

    static final org.apache.commons.logging.Log LOG

### Method Detail

#### create

    static AMapToData create​(int size,
                             ABitmap ubm)

#### create

    static AMapToData create​(int size,
                             boolean zeros,
                             IntArrayList[] values)

#### create

    static AMapToData create​(int size,
                             int[] values,
                             int nUnique)

#### create

    static AMapToData create​(int size,
                             int numTuples)

Create and allocate a map with the given size and support for upto the num tuples argument of values

Parameters:
  `size` - The number of cells to allocate
  `numTuples` - The maximum value to be able to represent inside the map.
Returns:
  A new map

#### create

    static AMapToData create​(int size,
                             MapToFactory.MAP_TYPE t)

#### resize

    static AMapToData resize​(AMapToData d,
                             int numTuples)

Reshape the map, to a smaller instance if applicable. Note that it returns the input if the input is the smallest representation that fits, otherwise it will return something that is smaller.

Parameters:
  `d` - The Input mat to potentially reduce the size of.
  `numTuples` - The number of tuples that should be in the resulting map
Returns:
  The returned hopefully reduced map.

#### resizeForce

    static AMapToData resizeForce​(AMapToData d,
                                  MapToFactory.MAP_TYPE t)

Force the mapping into an other mapping type. This method is unsafe since if there is overflows in the conversions, they are not handled. Also if the change is into the same type a new map is allocated anyway.

Parameters:
  `d` - The map to resize.
  `t` - The type to resize to.
Returns:
  A new allocated mapToData with the specified type.

#### estimateInMemorySize

    static long estimateInMemorySize​(int size,
                                     int numTuples)

#### readIn

    static AMapToData readIn​(DataInput in)
                      throws IOException

Throws:
  `IOException`