-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
questionFurther information is requestedFurther information is requested
Description
While analysing a network of Vertices it's not obvious which have constant values.
For example I've got the following code:
private static boolean isConstant(DoubleVertex vertex) {
if ( vertex instanceof ConstantDoubleVertex ){
return true;
} else if ( vertex instanceof DoubleBinaryOpVertex ){
DoubleBinaryOpVertex dbv = (DoubleBinaryOpVertex)vertex;
return isConstant(dbv.getLeft()) && isConstant(dbv.getRight());
}
return false;
}I think this would be useful as a core part of keanu so it's maintained
Alternatives
The main issue with this would be "custom" vertices from other sources. It may be better to provide an interface that let's code understand a vertex isn't going to change.
Additional context
Eventually this might even allow some automatic optimisations (e.g. cache values if they can never change).
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested