Class PopulationLattice
-
- All Implemented Interfaces:
public class PopulationLattice
Data structure modeling a lattice used to describe a combination of job populations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
PopulationLattice.sprodResult
-
Constructor Summary
Constructors Constructor Description PopulationLattice()
-
Method Summary
Modifier and Type Method Description static int
hashpop(Matrix n, Matrix N)
Computes a hash index for a population vector within a lattice. static int
hashpop(Matrix n, Matrix N, int R, Matrix prods)
Computes a hash index for a population vector using precomputed products. static Matrix
pprod(Matrix n)
Initializes a population product iterator. static Matrix
pprod(Matrix n, Matrix N)
Advances to the next population state in lexicographic order. static Matrix
pprodcon(Matrix n, Matrix lb, Matrix ub)
static PopulationLattice.sprodResult
sprod(int M, Matrix N)
static PopulationLattice.sprodResult
sprod(Matrix s, Matrix S, MatrixCell D)
-
-
Method Detail
-
hashpop
static int hashpop(Matrix n, Matrix N)
Computes a hash index for a population vector within a lattice. Maps a population vector to a unique index in the lattice space.
- Parameters:
n
- the current population vectorN
- the maximum population vector (lattice bounds)- Returns:
unique hash index for the population state
-
hashpop
static int hashpop(Matrix n, Matrix N, int R, Matrix prods)
Computes a hash index for a population vector using precomputed products. Optimized version that uses precomputed product values for efficiency.
- Parameters:
n
- the current population vectorN
- the maximum population vector (unused in this overload)R
- the number of job classesprods
- precomputed product values for hash computation- Returns:
unique hash index for the population state
-
pprod
static Matrix pprod(Matrix n)
Initializes a population product iterator. Returns a zero matrix to start iterating through population states.
- Parameters:
n
- the maximum population vector- Returns:
initial state (zero matrix) for population iteration
-
pprod
static Matrix pprod(Matrix n, Matrix N)
Advances to the next population state in lexicographic order. Generates the next non-negative vector less than or equal to N.
- Parameters:
n
- the current population stateN
- the maximum population bounds- Returns:
next population state, or null if enumeration is complete
-
sprod
static PopulationLattice.sprodResult sprod(int M, Matrix N)
-
sprod
static PopulationLattice.sprodResult sprod(Matrix s, Matrix S, MatrixCell D)
-
-
-
-