Top Description Inners Fields Constructors Methods
org.apache.commons.math3.ml.neuralnet.twod.util

public Class LocationFinder

extends Object
Class Inheritance
Imports
java.util.Map, .HashMap, org.apache.commons.math3.ml.neuralnet.Neuron, org.apache.commons.math3.ml.neuralnet.twod.NeuronSquareMesh2D, org.apache.commons.math3.exception.MathIllegalStateException

Helper class to find the grid coordinates of a neuron.
Since
3.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
LocationFinder.Location

Container holding a (row, column) pair.

Field Summary

Modifier and TypeField and Description
private final Map<Long, LocationFinder.Location>
locations

Identifier to location mapping.

Constructor Summary

AccessConstructor and Description
public
LocationFinder(NeuronSquareMesh2D
Map.
map
)

Builds a finder to retrieve the locations of neurons that belong to the given map.

Method Summary

Modifier and TypeMethod and Description
public LocationFinder.Location

Returns:

the (row, column) coordinates of n, or null if no such neuron belongs to the map used to build this instance.
getLocation
(Neuron
Neuron.
n
)

Retrieves a neuron's grid coordinates.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

locationsback to summary
private final Map<Long, LocationFinder.Location> locations

Identifier to location mapping.

Constructor Detail

LocationFinderback to summary
public LocationFinder(NeuronSquareMesh2D map)

Builds a finder to retrieve the locations of neurons that belong to the given map.

Parameters
map:NeuronSquareMesh2D

Map.

Exceptions
MathIllegalStateException:
if the network contains non-unique identifiers. This indicates an inconsistent state due to a bug in the construction code of the underlying network.

Method Detail

getLocationback to summary
public LocationFinder.Location getLocation(Neuron n)

Retrieves a neuron's grid coordinates.

Parameters
n:Neuron

Neuron.

Returns:LocationFinder.Location

the (row, column) coordinates of n, or null if no such neuron belongs to the map used to build this instance.

org.apache.commons.math3.ml.neuralnet.twod.util back to summary

public Class LocationFinder.Location

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.ml.neuralnet.twod.util.LocationFinder.Location

Container holding a (row, column) pair.

Field Summary

Modifier and TypeField and Description
private final int
column

Column index.

private final int
row

Row index.

Constructor Summary

AccessConstructor and Description
public
Location(int
Row index.
row
,
int
Column index.
column
)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the column index.
getColumn
()

public int

Returns:

the row index.
getRow
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnback to summary
private final int column

Column index.

rowback to summary
private final int row

Row index.

Constructor Detail

Locationback to summary
public Location(int row, int column)
Parameters
row:int

Row index.

column:int

Column index.

Method Detail

getColumnback to summary
public int getColumn()
Returns:int

the column index.

getRowback to summary
public int getRow()
Returns:int

the row index.