Package org.goplanit.utils.od
Class OdPrimitiveMatrix<T extends Number>
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.od.OdDataImpl<T>
-
- org.goplanit.utils.od.OdMatrixImpl<T,org.ojalgo.array.Array2D<T>>
-
- org.goplanit.utils.od.OdPrimitiveMatrix<T>
-
- All Implemented Interfaces:
Cloneable
,Comparable<IdAble>
,Iterable<T>
,IdAble
,OdData<T>
,OdMatrix<T,org.ojalgo.array.Array2D<T>>
- Direct Known Subclasses:
OdDemandMatrix
,OdSkimMatrix
public abstract class OdPrimitiveMatrix<T extends Number> extends OdMatrixImpl<T,org.ojalgo.array.Array2D<T>>
This class contains common methods for handling origin-demand matrices.- Author:
- gman6028, markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.od.OdMatrixImpl
matrixContents
-
Fields inherited from class org.goplanit.utils.od.OdDataImpl
zones
-
-
Constructor Summary
Constructors Constructor Description OdPrimitiveMatrix(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones, org.ojalgo.array.Array2D<T> matrixContents)
Constructor for Od matrix containing primitives, i.e.OdPrimitiveMatrix(OdPrimitiveMatrix<T> other)
Copy Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract OdPrimitiveMatrix<T>
clone()
Create a shallow copy of this entityT
getValue(long originId, long destinationId)
Returns the value for a specified origin and destination by their internal idT
getValue(Zone origin, Zone destination)
Returns the value for a specified origin and destinationabstract OdMatrixIterator<T,org.ojalgo.array.Array2D<T>>
iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrixvoid
setValue(Zone origin, Zone destination, T value)
Sets the value for a specified origin and destination-
Methods inherited from class org.goplanit.utils.od.OdDataImpl
getNumberOfOdZones, getOdZones
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.goplanit.utils.od.OdData
getNumberOfOdZones
-
-
-
-
Constructor Detail
-
OdPrimitiveMatrix
public OdPrimitiveMatrix(Class<? extends IdAble> idTokenClass, IdGroupingToken idToken, OdZones zones, org.ojalgo.array.Array2D<T> matrixContents)
Constructor for Od matrix containing primitives, i.e. number based- Parameters:
idTokenClass
- to use for id generationidToken
- to use for the matrix idzones
- holder for zones considered in the matrixmatrixContents
- container for the matrix contents
-
OdPrimitiveMatrix
public OdPrimitiveMatrix(OdPrimitiveMatrix<T> other)
Copy Constructor- Parameters:
other
- to copy
-
-
Method Detail
-
setValue
public void setValue(Zone origin, Zone destination, T value)
Sets the value for a specified origin and destination- Parameters:
origin
- specified origindestination
- specified destinationvalue
- value at the specified cell
-
getValue
public T getValue(Zone origin, Zone destination)
Returns the value for a specified origin and destination- Parameters:
origin
- specified origindestination
- specified destination- Returns:
- value at the specified cell
-
getValue
public T getValue(long originId, long destinationId)
Returns the value for a specified origin and destination by their internal id- Parameters:
originId
- specified origindestinationId
- specified destination- Returns:
- value at the specified cell
-
clone
public abstract OdPrimitiveMatrix<T> clone()
Create a shallow copy of this entity
-
iterator
public abstract OdMatrixIterator<T,org.ojalgo.array.Array2D<T>> iterator()
Returns an iterator which can iterate through all the origin-destination cells in the matrix- Specified by:
iterator
in interfaceIterable<T extends Number>
- Specified by:
iterator
in interfaceOdData<T extends Number>
- Specified by:
iterator
in interfaceOdMatrix<T extends Number,org.ojalgo.array.Array2D<T extends Number>>
- Specified by:
iterator
in classOdMatrixImpl<T extends Number,org.ojalgo.array.Array2D<T extends Number>>
- Returns:
- iterator through all the origin-destination cells
-
-