Comments (3)
ExpandTemplate has an overload that accepts which of the ith
expansions should be made.
For instance:
With[{k = 2, t = ColorBlindTemplate[2, 1.0]},
ExpandTemplate[t, #] & /@
Range[0, k^Length[TemplateCoreVars[t]] - 1]]
is equivalent to:
With[{k = 2, t = ColorBlindTemplate[2, 1.0]},
ExpandTemplate[t]]
This means the user can partition the range any way he wants and perform any kind of side effect (dump into a file, for instance) as needed for each partition.
What we could do to make this easier is expose a function that gives you the upper bound of the expansion range so the user won't have to calculate it.
from catemplates.
Note that the user can also use a more imperative approach if he wants:
With[{k = 2, t = ColorBlindTemplate[2, 1.0]},
For[i = 0, i < k^Length[TemplateCoreVars[t]], i++,
e = ExpandTemplate[t, i];
DumpToFile[e];]]
from catemplates.
This is certainly a good workaround, and we might be happy to stick to it for the moment.
But what I really had in mind is an iterative alternative, tha might allow the user to compute all expansions wanted, provided they would be willing to wait. This is what the IthTuple function in CAMaT allows; have a look.
from catemplates.
Related Issues (20)
- ColorBlindTemplate[4] produces error.
- When mixing modular and non-modular templates, ModularTemplateIntersection depends on the order of it's arguments HOT 2
- ModularTemplateIntersection produces templates that don't preserve the index-variable duality
- Generalize SymmetricTemplate to work with any values of k.
- Create an expansion function for templates generated with a mod N different from k. HOT 1
- ModularTemplateIntersection produces wrong results on equivalent templates HOT 1
- Is it possible to intersect two templates with the same k and r, but different Ns? How?
- Implement a template ADT HOT 1
- How should a template resultant from an intersection expand itself? HOT 1
- Validate a template's k and r before intersection
- Implement imprisonment expressions with the new template ADT HOT 3
- Adapt current generator functions to return template ADTs HOT 1
- Adapt template intersection to the new ADT HOT 1
- Remove SymmetricTemplate function, add generalized MaximumSymmetryFunction
- Automatically decide if a modular template intersection is needed HOT 1
- RestrictedTemplateIntersection[t1,t1] results in {} instead of t1 HOT 1
- Bug when handling asymmetric radii
- Modify names of the post-expansion functions
- $RecursionLimit set to Infinity should be default in the package. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catemplates.