# Questions tagged [lazy-computations]

The tag has no usage guidance.

18 questions
Filter by
Sorted by
Tagged with
418 views

### Breaking “Functional Loops” and Doing Lazy Evaluation In Mathematica

Alright, so this is a question about the functional way to break a for/while loop. Since we're on the Mathematica SE, I'm interested in the ways a Mathematica vet would handle this, however the ...
127 views

### Status of Streaming package

I see the Streaming package mentioned in this question How to use Streaming package in v11.1? with advice on getting it working in V11.1. I've failed to get either the built-in version or the patch ...
170 views

### Linear programming with lazy constraints

Does Mathematica offer any means for solving linear programming problems with "lazy constraints", as described e.g. here? While I am not very familiar with linear programming, my understanding of the ...
69 views

### Cutting digits of a number without approximation:

I am evaluating an exponential and I end up with the following result: $1.4497788553129478854329$ Is there a command on Mathematica that allows me to cut my result without approximating it? I would ...
333 views

### How to use Streaming package in v11.1?

I am trying to use the streaming package for lazy list operations demonstrated in this post. But I found that the package was significantly changed in version 11. After some observations, I found that ...
64 views

### Lazy tuples made from arbitrary lists [duplicate]

I am dealing with Tuples of n lists each having potentially different length: longList = Tuples[list1, list2, ..., listn]: Since I have to iterate over the ...
237 views

### Does Mathematica has any operators to program like writing lisp macros? [closed]

Lisps use read/eval, quote/syntax-quote, unquote/unquote-splicing and so on to make writing ...
2k views

### How to map and sum a list fast?

The following takes a lot of memory and is slow: AbsoluteTiming[Total[Map[#^2 &, Range[1, 100000000]]]] I suspect this is because it first calculates and ...
651 views

### Lazy form of Tuples/Outer to loop over list of lists

This is less a question and more asking if someone has implemented this already, with more skill. I need to perform the Outer-like generalized outer product of a ...
56 views

### Save a Mathematica notebook evaluated [duplicate]

My notebooks can take some time to evaluate and by quitting Mathematica, I have to reevaluate every definition I've made once I restart Mathematica. Is there a way to tell Mathematica to save the ...
998 views

### Efficient lazy weak compositions

In Mathematica all weak k-compositions of integer n can be generated using permutations of integer partitions: ...
948 views

### Alternative to Subsets to generate k-combinations

I need to generare a huge number of k-combinations for a quite big set of numbers (more than 100), so I would avoid Subsets because it requires too much memory (it generates all subsets at once). I ...
3k views

### Is there a built-in equivalent to Python's enumerate?

Python's built-in function enumerate takes an iterable over $(a_0, a_1, \dots )$ as argument and returns an iterable over the sequence of pairs \$((0, a_0), (1, a_1),...
1k views

### How to Fold over lazy lists and over tasks, just as with Lists?

Many modern languages, such as Haskell, feature lazy lists, which can model infinite sequences of values, albeit synchronously. Lately, the reactive programming movement has shown that asynchronous ...
1k views

### Lazy lists of Tuples and Subsets

I'm trying to build a lazy list that evaluates the n'th m-tuple or subset of a given list using Mathematicas ordering without calculating all the Tuples. The purpose is to allow for example the ...
2k views

### Permutations[Range[12]] produces an error instead of a list

This input: Permutations[Range[12]] Results in this (error) output: ...