Tag Info

58

InternalInheritedBlock (IIB) is similar to Block, except that it preserves the original definition of the function being passed to it. The function can then be modified as we wish inside the IIB without affecting the external definition. Let's see how Block works first: f[x_] := x Block[{f}, Print@DownValues[f]; f[x_, y_] := x y; Print@...

58

From inspection, some investigation and ruebenko's help, what I've found so far is that InterpolatingFunction has the following underlying structure: InterpolatingFunction[ domain, (* or min/max of grid for each dimension *) List[ version, (* 3 in Mathematica 7, 4 from 8 onwards *) ...

57

Introduction This post is long overdue as I have been repeatedly asked to explain code of mine containing these things. As I see increased use of this construct by others perhaps it is past due also. SparseArray objects can behave as functions accepting certain arguments to return internal data or efficiently return data in certain forms. These are known ...

54

The short answer is, yes! There is a whole undocumented package TemporalData containing some useful functions. The results below are from my own spelunking. Feel free to add/amend as appropriate. Let's set up some simple TemporalData objects to explore them: fakedata = Transpose@{DatePlus[{2001, 1}, {#, "Month"}] & /@ Range[0, 99], ...

52

The following simulates Mathematica's behaviour after using it for more than 24 hrs. MathLinkCallFrontEnd[FrontEndUndocumentedCrashFrontEndPacket[]] Works as advertised! :D

45

Sequential With From Daniel Lichtblau's comment there is a new undocumented syntax for With introduced sometime after version 10.1 that allows: With[{a = 0}, {a = a + 1}, {a = a + 1}, a] 2 Delayed With, Block, and Module These scoping constructs support the use of := in definitions which allows one to handle unevaluated expressions. With[{x := 2 + 2}, ...

40

Funny you should ask :), it turns out there is an undocumented use of Integrate that one can leverage to integrate over regions. Unfortunately this does not seem to work for NIntegrate. This usage is better leveraged in conjunction with some other undocumented functions (see here and here). I will show a few examples of how to use this feature. First, let's ...

37

InternalPartitionRagged This one has a usage statement! InternalPartitionRagged[Range[14], {3, 5, 2, 4}] {{1, 2, 3}, {4, 5, 6, 7, 8}, {9, 10}, {11, 12, 13, 14}} Note that Length[list] must equal n1 + ... + nk. (* changed the last 4 to 3 *) InternalPartitionRagged[Range[14], {3, 5, 2, 3}] InternalPartitionRagged[Range[14], {3, 5, 2, 3}] InternalS1,...

36

InternalInheritedBlock What does InternalInheritedBlock do? Daniel's MathGroup post Strange behaviour of InternalInheritedBlock How safe is the use of Block and InternalInheritedBlock InternalLocalizedblock What is the purpose of InternalLocalizedBlock? InternalBag InternalBag inside Compile Daniel Lichtblau's answer On the use of of ...

36

System The default value for the overhang parameter k (3rd argument) in ListCorrelate is None. Internal Predicates InternalLinearQ[expr, var] yields True if expr is a polynonial of exactly order one in var, and yields False otherwise. InternalRationalFunctionQ[expr,var] returns True if expr is a rational function of the symbol var, and returns False ...

36

To create ExperimentalNumericalFunction, one needs to evaluate ExperimentalCreateNumericalFunction[vars, expr, dims] where vars is a list of arguments, expr - the expression from which the numerical function will be created, dims - the dimensions of the output matrix produced by this expression. If the output is scalar, then dims should be set to {}. It ...

35

InternalLocalizedBlock behaves the same as Block, but it can localize non-Symbols (e.g. f[1], Subscript[x, 0], etc.). For example, InternalLocalizedBlock[{Subscript[x, 0]}, Subscript[x, 0] = 1] (* 1 *) Compare this to Block[{Subscript[x, 0]}, Subscript[x, 0] = 1] (* During evaluation of In[79]:= Block::lvsym: Local variable specification {Subscript[x, ...

34

nb2 = NotebookOpen @ FileNameJoin[ {$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Core.nb"}]; Note that some of the named styles in the core stylesheet styles are empty, i.e. the style name is defined but no styles set: Cell[StyleData["style"]] For example (with V8): Union[Cases[NotebookGet[nb2],StyleData[x_, ___] :> x, \[... 34 There is the undocumented option Beveled in the FractionBox FractionBox[a, b, Beveled -> True] // DisplayForm 33 This is a community wiki answer. Feel free to improve it. Introduction RawArray is an atomic array type that can hold data in any of the following formats: "Integer8", "UnsignedInteger8", "Integer16", "UnsignedInteger16", "Integer32", "UnsignedInteger32", "Integer64", "UnsignedInteger64", "Real32", "Real64", "Complex64", "Complex128" (Some aliases can ... 31 Such functions set up a one-time iterator, i.e. a GeneralUtilitiesIterator. Its functionality may be inspected with ? GeneralUtilitiesIterator and so forth. Except for a ConstantIterator which always returns the same value (forever), they go sequentially through values until they return GeneralUtilitiesIteratorExhausted. The main (if internal) utility ... 27 Update Leaving my old answer below for historical reference, however as of version 11.2.0 (currently available on Wolfram Cloud and soon to be released as a desktop product) the low-level linear algebra functions have been documented, see http://reference.wolfram.com/language/LowLevelLinearAlgebra/guide/BLASGuide.html The comments by both Michael E2 and J.... 27 SatisfiableQ has three methods: "BDD": converts the expression to a BDD (binary decision diagram), "SAT": uses the Minisat library, "TREE": a branch-and-bound method based on the expression tree. SatisfiabilityCount counts instances by converting the expression to a BDD, so its timing should be close to SatisfiableQ with the "BDD" method (counting ... 27 It seems the model file in MXNet (checkpoint) is defined by two files: a ".json" file and a ".params" file. The json file contains the definition of the network, and the params file contains the actual weight and bias of each neuron. The params file is in the binary format of MXNet's NDArray representation. Thus, to export a network in Mathematica to MXNet, ... 26 Properties for SparseArray and InterpolatingFunction objects SparseArray objects can accept a range of Properties (or Methods) that allow the efficient extraction of certain information, most commonly "AdjacencyLists" or "NonzeroPositions" as a frequently faster alternative to Position. I started this answer to detail them but as it grew I came to believe ... 26 The details of the styles associated with various themes can be accessed using the function ResolvePlotThemes in the Charting context. For example: Grid[{#, Column@(ChartingResolvePlotTheme[#, ListPlot] /. HoldPattern[PlotMarkers -> _] :> Sequence[])} & /@ {"Monochrome", "Frame", "Vibrant"}, Dividers -> All] (* removed the part ... 26 So I have a little bit more info, but mostly a learning technique we can test: Init I wanted to see when each of these was called so I made each possible handler (without a previous assignment) just call Print. Then I found that for "Wolfram.System.Print" this is a terrible idea as it is called anytime the system prints. So I removed that. Here's what I'm ... 26 We can get old-style messages using Internal$MessageMenu = False Needless to say, this is unsupported and undocumented functionality.

25

CompileInnerDo This is the one that initially struck me as interesting since I use compiled functions quite a lot. From the documentation of Do: Unless an explicit Return is used, the value returned by Do is Null. But that doesn't seem to be the case for CompileInnerDo! f1 = Compile[{{x}}, Module[{a}, a = x; CompileInnerDo[a++, {i, 10^8}]] ...

25

Version 10 introduced some undocumented functionality that makes it easier to explore the style hierarchy. As usual, "undocumented" === "buyer beware". We start by evaluating: StyleManagerOpenStyleManager This does nothing other than trigger the auto-loading of certain symbols. We'll come back to a more interesting use of this symbol later. Now, we ...

23

Yes, this form exists, and was first shown to me by Leonid. It is: Function[Null, (* body with ## *), (* attributes *)] As always the Null may be implicit, so in your application: Function[, Length[Unevaluated@#1]{##2}, HoldFirst][1+2,2+3,3+1] {10, 8}

23

We can use one of several ways. First, let us create some test data: arr = Range[10]; (* this is an Integer packed array *) unpacked = {1, 2, 3} (* this is an Integer array that is NOT packed *) Since Mathematica 10.4, InternalPackedArrayType directly returns the type: InternalPackedArrayType[arr] (* Integer *) InternalPackedArrayType[unpacked] (* $... 22 One can use Style and FractionBoxOptions to set Beveled: Plot[Sin[x], {x, -2 Pi, 2 Pi}, Ticks -> {Pi Range[-2, 2, 1/2], Automatic}, BaseStyle -> {FractionBoxOptions -> {Beveled -> True}}] It doesn't look too good here, though: This looks ok, Style[3 Pi/2, FractionBoxOptions -> {Beveled -> True}] but not in the "Label" style, Style[... 22 A long comment: Automatic renaming again: ClearAll[F]; F[x_] := Hold[With[{a = x}, {b = x}, a]]; F[0] Hold[With[{a$ = 0}, {b = 0}, a]] I was expecting it already in DownValues, but this is not the case. DownValues @ F {HoldPattern[F[x_]] :> Hold[With[{a = x}, {b = x}, a]]} So who does it? :) Here is a pure guess, if evaluation is really a ...

21

In addition to the error messages quoted in the question the line returns: GeneralUtilitiesBenchmarkingPackagePrivateplot[ IndexBy[{{{16, 9.37132*10^-6}, . . . IndexBy was removed from 10.1.0: Note that IndexBy will be removed in a future version of Mathematica. It was something that was considered for 10.0.0 but didn't make the cut. – Stefan R Feb ...

Only top voted, non community-wiki answers of a minimum length are eligible