Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [implementation-details]

For questions regarding the underlying implementation of built-in functions.

12
votes
2answers
175 views

Listable built-in functions - Why are they so fast on numerical vectors?

Consider the following small example, where I calculate Exp on a large vector by employing the listability which many mathematical built-in functions have: ...
0
votes
0answers
41 views

Proper implementation of numerically integrated function inside a differential equation

I have a numerically-inverted function TP which is then fed to the differential equation below. My question is: What is the right way to implement this ...
1
vote
0answers
54 views

Difference between NSolve and FindRoot?

While it is clear what FindRoot does (start at a point and look for local extremum using gradient), how does NSolve work? Also, ...
5
votes
0answers
48 views

Details of NDSolve calling LSODA

Inspired by my question regarding the computation time of NDSolve using the LSODA backend I was wondering how NDSolve is actually calling LSODA (what arguments are sent to LSODA), i.e. what are the ...
7
votes
1answer
220 views

How does Mathematica determine when to use scientific notation?

I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient ...
14
votes
4answers
2k views

What stopwords list is the Wolfram language using?

The documentation of DeleteStopwords only says that it "uses a standard, built-in list of stopwords". So what is it exactly? Update Now that it is said "standard"...
2
votes
1answer
73 views

“Exporting” Plot Theme “Classic”

I really like the 3D plots in Mathematica with the PlotTheme option set to "Classic". I wonder if there's a way to export the ...
6
votes
1answer
443 views

Which algorithm does Mathematica use for “RandomSearch”?

Recently I have used Mathematica for minimization of certain functions and I have realized that even though it lasts much longer, the method "RandomSearch" functions much better than the other methods ...
6
votes
2answers
294 views

FindMinimum: How can I know which method Mathematica has used?

I have been using FindMinimum to find a local minimum of a non-linear function within a constrained region. How can I know which method Mathematica has selected to find the local minimum? Thanks in ...
3
votes
0answers
80 views

The actual polynomial behind a BezierFunction

Let's say I have the following Mathematica code pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}}; F = BezierFunction[pts] How can I find the actual polynomial of the <...
1
vote
0answers
42 views

How to reconstruct the result of ColorBalance manually?

I want to know about the mathematics behind white balance. I understand that it should be 3 different constants being applied to the red/green/blue channels. Thus I used ...
4
votes
3answers
154 views

Finding Root of BesselJ [closed]

When I work on some physical problem I needed to know how to get all of first 100 roots of BesselJ[n,x] function -which is a quasi periodic function-, as a List. I ...
2
votes
1answer
36 views

Evaluation Time of RandomVariate Function

This question is about the runtime of the function RandomVariate. Take a simple normalized Gaussian distribution G on the real line, I tried to generate N random ...
12
votes
1answer
121 views

How is the Hessian computed using ``Experimental`NumericalFunction``?

Here and here it was explained how to use Experimental`NumericalFunction to compute the Hessian of a numerical function. I would like to know how this undocumented ...
3
votes
1answer
115 views

The algorithm behind InputForm for machine numbers

There are several questions on this site about implementing fast CSV/TSV export for machine numbers without loss of precision. Recently I discovered that Export ...
5
votes
1answer
57 views

What GraphRepresentations does Mathematica use?

Mathematica can use multiple internal representations for Graphs. Normally, we don't need to care about this. But the specific representation used can influence the ...
2
votes
0answers
59 views

Why doesn't the low-level box representation of a graph with VertexLabels use GraphicsComplex?

Compare following two low-level box representations of a graph without VertexLabels and one with VertexLabels set to ...
0
votes
0answers
31 views

LatticeReduce (2D) more than two vector [duplicate]

I wonder how LatticeReduce works when I use more than two vector arguments each one in 2D. I know the Gauss algorithm to reduce two vectors. However, how ...
1
vote
1answer
82 views

Confusing periodic boundary condition with `PeriodicInterpolation`

When using NDSolve to solve a PDE with a periodic boundary condition, for example, $y(0,t)=y(L,t)$ using ...
4
votes
2answers
95 views

underlying data for `QuantilePlot[]`

What is the best way to produce the actual pairs of points shown by QuantilePlot? Would anyone have an implementation? (I am interested in the simplest possible ...
5
votes
0answers
126 views

Does DegreeGraphDistribution sample uniformly?

Bug introduced in 10.0 or earlier and persisting through 11.3.0 There are two undirected labelled simple graphs with the degree sequence {1, 2, 2, 1}: ...
1
vote
0answers
46 views

How does DominantColors work?

I'm trying to understand the algorithms behind DominantColors[]. Unfortunately Trace[] and ...
1
vote
0answers
59 views

Mathematica’s algorithm for limits of multivariable functions

What algorithm does Mathematica use to compute limits for functions in $\mathbb{R}^n$ with $n\geq2$? Here I refer to limits that present indeterminate forms. How can it test every possible path? Does ...
15
votes
2answers
3k views

How was Nothing implemented?

How was Nothing implemented in Wolfram language at the language level? For example, {a, b, Nothing, c, d, Nothing} will return <...
6
votes
0answers
44 views

What method does FindGraphCommunities use with Method -> “Centrality”?

Cross-posted to W Community I would like to know what method FindGraphCommunities uses with the option Method -> "Centrality"...
3
votes
0answers
108 views

How does Mathematica draw 2D and 3D graphics?

I'd like to know Mathematica draws 3D graphics with respect to platform it's running on? For Windows: Is it using Diret3D(DirectX)? For Linux/Solaris: Is it Using OpenGL or Vulkan? For Mac OS X: ...
3
votes
1answer
142 views

What is Mathematica's ML Linear Regression Method?

When I run p = Predict[trainingSet, Method -> "LinearRegression"];, how is that different from just running ordinary least squares? It's quite slow on a ...
14
votes
3answers
1k views

What's the default colormap (or color scheme) used in mathematica?

For example, the colors used on this page: http://reference.wolfram.com/language/ref/ContourStyle.html or here: https://www.wolfram.com/mathematica/new-in-10/plot-themes/default.html or here: ...
4
votes
1answer
114 views

Formulation of skewness and kurtosis calculated from Smooth Kernel Distribution

I would like to know the formulation used to calculate skewness and kurtosis in Mathematica. I see that for a discrete data set, skewness is calculated as ...
2
votes
0answers
217 views

How does Mathematica numerically integrate to infinity?

Suppose you have a function that can only be evaluated numerically. I.e., you call $f[x]$ with a particular value of $x$ and get a value after a brief amount of time, but there is no good way of ...
0
votes
0answers
150 views

How FindRoot is implemented

I am trying to reproduce my mathematica code in java, the problem is that I use FindRoot to solve either equations or non linear systems of equations (3*3 speciically). For example ...
2
votes
0answers
51 views

What image adjustments are made when importing raw camera data?

I am trying to use Mathematica to import and process raw camera data in the Canon CR2 format. What I would like is data which has a linear relationship to exposure. I am thinking that the closest I ...
5
votes
0answers
161 views

How does NSolve find the roots to an equation?

I'm using NSolve to find the roots to a transcendental equation. For this, I need to specify a bounded region where roots are searched. What I want to know is how <...
5
votes
1answer
127 views

How is N[Mean[distribution]] evaluated?

Particularly when applied to calculating the (population) mean of a (continuous univariate) random variable, as in ...
0
votes
0answers
59 views

LowpassFilter and LeastSquaresFilterKernel implementation

I'm in the troublesome phase to port Mathematica code into another programming language. I cannot find a proper reference on the algorithm used in the ...
2
votes
0answers
59 views

How does Simplify resolve SimplifyCount ties?

The expressions a (b + c) + b c and a b + (a + b) c are equivalent and equally complex as measured by ...
-1
votes
1answer
147 views

Automatic “simplification” can make an expression strictly more complex

Mathematica's automatic simplification rules result in the following behavior: -(a + b) x (* (-a - b) x *) On the other hand, ...
4
votes
0answers
185 views

How does `Simplify` resolve `LeafCount` ties? [closed]

The documentation for ComplexityFunction says With the default setting ComplexityFunction->Automatic, forms are ranked primarily according to their LeafCount, ...
9
votes
2answers
209 views

Reconstructing ContourPlot with ListContourPlot

Let f be some numeric function with two arguments f[x_?NumericQ, y_?NumericQ] := x y For the purposes of this question ...
4
votes
1answer
513 views

How does Mathematica calculate the Standard error during a non linear fit?

I am doing a simple non linear fit. If I use nlm["ParameterTable"] I get a table with Standard Errors. Does anyone know how Mathematica calculate those "standard ...
6
votes
0answers
86 views

What does the alignment error returned from FindGeometricTransform measure?

FindGeometricTransform returns "the alignment error together with the transformation function." How is the alignment error computed? I ask because if you iterate <...
11
votes
0answers
466 views

What algorithm is Mathematica using to find the smallest eigenvalue so quickly?

My question is what kind of black magic is Mathematica doing to obtain the correct answer so quickly compared to other programming languages? Details: I've written a Mathematica notebook to find the ...
22
votes
2answers
427 views

What can be inlined by “InlineExternalDefinitions” -> True?

This not-well-documented option of Compile has been used quite a bit in this site, and based on these examples, I used to think ...
4
votes
1answer
90 views

How does TimeValue calculate value of Cashflow?

The code below calculates the future value of a Cashflow. I intend that the cashflow adds 1 unit on each period for 10 periods, and specifies an effective interest rate of 1% per period. The table is ...
1
vote
0answers
34 views

Where can I find the source of data which is used by ChromaticityPlot3D?

This question is related to this one. Now I'm interested in the origin of the chromaticity diagrams for different color spaces, which can be found using chromaticityPlot3D. Therefore, I need the ...
7
votes
1answer
258 views

What exactly do DerivativeFilter and RidgeFilter do with the scale parameter?

Both DerivativeFilter and RidgeFilter take an optional parameter σ to indicate the scale of ...
6
votes
3answers
518 views

how to take ImageFeatures?

I want to know how to transform images to feature vector. There is a function FeatureExtractor.And it has some methods. ...
4
votes
0answers
108 views

Which filter does InverseRadon use by default?

I am using the InverseRadon function. According to the documentation the function uses a Hann filter and no cutoff (...
21
votes
1answer
537 views

Why Except is so slow as compared to equivalent RegularExpression?

When comparing performance of the solutions suggested for this question I discovered that StringExpression involving Except is ...
4
votes
0answers
57 views

Is it possible to access FrontEnd's own conversion rules for boxes?

Before sending its output to the FrontEnd the Kernel converts it into boxes by applying MakeBoxes. But it is not the whole story. FrontEnd not just displays the box ...