Class LocationFinder
- java.lang.Object
-
- org.apache.commons.math3.ml.neuralnet.twod.util.LocationFinder
-
public class LocationFinder extends java.lang.Object
Helper class to find the grid coordinates of a neuron.- Since:
- 3.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocationFinder.Location
Container holding a (row, column) pair.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Long,LocationFinder.Location>
locations
Identifier to location mapping.
-
Constructor Summary
Constructors Constructor Description LocationFinder(NeuronSquareMesh2D map)
Builds a finder to retrieve the locations of neurons that belong to the givenmap
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocationFinder.Location
getLocation(Neuron n)
Retrieves a neuron's grid coordinates.
-
-
-
Field Detail
-
locations
private final java.util.Map<java.lang.Long,LocationFinder.Location> locations
Identifier to location mapping.
-
-
Constructor Detail
-
LocationFinder
public LocationFinder(NeuronSquareMesh2D map)
Builds a finder to retrieve the locations of neurons that belong to the givenmap
.- Parameters:
map
- Map.- Throws:
MathIllegalStateException
- if the network contains non-unique identifiers. This indicates an inconsistent state due to a bug in the construction code of the underlyingnetwork
.
-
-
Method Detail
-
getLocation
public LocationFinder.Location getLocation(Neuron n)
Retrieves a neuron's grid coordinates.- Parameters:
n
- Neuron.- Returns:
- the (row, column) coordinates of
n
, ornull
if no such neuron belongs to themap used to build this instance
.
-
-