Phylogeny constraint generation: private API

PortfolioOptimisers._validate_length_integer_phylogeny_constraint_B — Function
_validate_length_integer_phylogeny_constraint_B(alg::Integer, B::VecNum)
_validate_length_integer_phylogeny_constraint_B(alg::Int_ONC, B::VecNum)

Check the length of B against an integer cluster count alg.

The method on Int_ONC is the no-op of the value check on the set that reaches it. An algorithm that chooses the number of clusters fixes no count to check, so it puts no bound on B. The default OptimalNumberClusters holds a SecondOrderDifference, so this check does nothing for it. Any other type or arity is a MethodError.

Arguments

  • alg: The number of clusters that the source returns.

    • Integer: Bounds length(B).
    • AbstractOptimalNumberClustersAlgorithm: The function checks nothing.
  • B: The vector of bounds, one per row.

Validation

  • length(B) <= alg, on the Integer method only. A breach raises a DomainError.

Returns

  • nothing.

Related

source
PortfolioOptimisers.validate_length_integer_phylogeny_constraint_B — Function
validate_length_integer_phylogeny_constraint_B(cle::ClustersEstimator, B::VecNum)
validate_length_integer_phylogeny_constraint_B(cle::NwE_ClE, B::VecNum)

Check the length of B against the number of clusters that the estimator cle can return.

Only the ClustersEstimator method checks B. The method on NwE_ClE is the no-op of the value check on the set that reaches it, and it checks nothing. A NetworkEstimator goes there, so this function does not check the default source of an IntegerPhylogenyEstimator. A network estimator fixes no count of clusters. The row count of a network is known only after phylogeny_matrix runs, and the constructor of IntegerPhylogeny checks the length then. Any other type or arity is a MethodError.

Arguments

  • cle: The source of the relatedness matrix. The ClustersEstimator method reads its onc field, which states the number of clusters. The method on NwE_ClE ignores it.
  • B: The vector of bounds, one per row.

Validation

Returns

  • nothing.

Related

source