I have written a procedure in which I create a matrix and then manipulate (change) the matrix until certain conditions are met (a while loop). I would like to know when an iteration of my loop does not make any changes to my matrix (but the stopping conditions are not yet met) so that I do not enter into an infinite loop.
Situation: I have multiple lists of the form [i$i=1..n,0$k] , where n is a positive integer and k is a nonegative integer.
Desired result: For each list, produce a list of permutations of the list (as you would receive from combinat[permute]) such that in each permutation, the nonnegative integers in the list appear in ascending order from left to right and no two nonnegative integers are adjacent to one another.
I have a list of lists. The number of lists I have is unknown (though always a positive integer) and the number of elements in each list is unknown (though, again, always a positive integer). Some examples:
I'd like to form a list of all possible sums formed from one element of each list. The lists of sums from the examples above would be
The order doesn't matter, and repeated elements don't matter. I can form these lists when I can control the number of lists in the large list and write an explicit nest of for loops. I figure there's got to be a more elegant and powerful way of producing these sums.
I've got two procedures set up that work, but I know there have to be better ways to accomplish the same goals.
First, I've got a procedure that finds to how many digits two floats (
b) agree. I had tried a few methods of examining the
SFloatExponent of the difference, but those methods would fail in unpredictable ways. My current method explodes the floats into lists and compares every entry in a
for loop. The example below is basically the heart of my procedure (I do take into consideration things like the location of the decimal and trailing zeros):
I recently purchased a Maple e-book, and I noticed a few lovely features of which I would like to take advantage. The first is the ability to create a compressed worksheet. There seems to be a painfully simple mechanism behind compressing and uncompressing the worksheet, since when the worksheet is opened with a text editor, the first characters are (if I recall correctly) "<compressedworksheet". I cannot find any documentation inside of Maple detailing the compression and uncompression of files. Thus, I ask you, Maplesoft: How can I compress my worksheet files in this manner?
The second feature of which I would like to take advantage is the use of a license file. Looking at the XML code of the compressed worksheet, it seems that one only needs to make reference to the location of a license file in order for Maple to look for the license file. The license file itself is very short--only about 4 lines--which makes me assume that the license file checking mechanism is similarly simple. Again, Maplesoft: How can I make and use my own .dat "license" files?