Questions tagged [minimum]

Minimum refers to the value in a collection of values that is the least or smallest.

In mathematics, the minimum of a function is the smallest value that the function takes at a point either within a given neighborhood (local or relative minimum) or on the function domain in its entirety (absolute minimum).

Examples

Python

>> import numpy as np
>> np.min([0, 1, 2])
0

See also

1056 questions
4
votes
4 answers

Set minimum value of MySQL field - possible?

Quick newbie MySQL question. What would be the simplest way to ensure that the minimum value of a given field is 0? Basically, we have a script that runs automatically and subtracts an integer value from the value of a field every 15 minutes--but…
user405056
  • 71
  • 1
  • 4
4
votes
2 answers

Find the shortest sequence length out from list of arrays which should contain element from each array

Here is a problem: Suppose we have following arrays: [1,2,9] [3,6,7] [4,11] [8,10,12] Items in array are unique and ordered. The task is to find the shortest sequence length which will contain at least one element of every array, but these…
Oleksii Duzhyi
  • 1,203
  • 3
  • 12
  • 26
4
votes
1 answer

Python min override

In Python 3, I made a custom class C for a specific data structure that can be used as an iterable. But the class ensures that for any data structure c of C, c[0] will be the minimum value of all values in c. Is there a way that a call to min(c)…
Xoff
  • 356
  • 2
  • 13
4
votes
4 answers

Finding common minimum value between two arrays

I am working on a problem in Javascript. Finding common minimum value between two arrays. However, I have been told that this might not work on some values. What is the issue? function cmp(a, b) { return a - b; } function findMinimum(A, B) { …
Vintage
  • 238
  • 1
  • 2
  • 13
4
votes
2 answers

Finding minimum with a recursive function

Whatever the input, the result is always 0. Why is that ? #include #include int rekursiv( int v[], int i, int n, int *min ); int main( void ) { int v[ 100 ]; int n, i, min; printf( "Shkruanni n: " ); scanf(…
Shinz6
  • 147
  • 1
  • 2
  • 10
4
votes
3 answers

modelica: compute minimum/maximum of continuous variable over time

As stated above: I wish to compute the minimum (and/or maximum) of a continuous variable over time. Here is a minimal example to demonstrate: model MinMaxTest Real u; Real u_min(start = 10); Real u_max(start = -10); equation u = sin(time /…
PeterE
  • 5,715
  • 5
  • 29
  • 51
4
votes
1 answer

In a graph, how to find the nearest node to a group of nodes?

I have an undirected, unweighted graph, which doesn't have to be planar. I also have a subset of graph's nodes (true subset) and I need to find a node not belonging to the subset, with minimum sum of distances to all nodes in the subset. So far, I…
Nikola
  • 41
  • 2
4
votes
5 answers

finding the second minimum

I want to find the second minimum in a array list.Here's my code.Is there a better way to do it? int main(){ int a[5]={7,5,45,89,12}; int smallest=a[0]; int index; for(int i=0;i<5;i++){ if(a[i]
clarkson
  • 561
  • 2
  • 16
  • 32
4
votes
1 answer

scipy.optimize.basinhopping interval and accept test syntaces

I am trying to find the global minimum of an objective function using basinhopping, but for a majority of the time it is stuck at a local minimum. I read through the document for basinhopping, and found the interval and accept_test might be…
dilyar
  • 251
  • 1
  • 3
  • 11
4
votes
2 answers

Using Double.POSITIVE_INFINITY in Java to find minimum value

Simple question: will the following code work for finding the minimum value in an array of doubles (assume at least one value exists): double[] values = ... double currentMin = Double.POSITIVE_INFINITY; for(int i = 0; i < values.length; i++) { …
donnyton
  • 5,874
  • 9
  • 42
  • 60
4
votes
1 answer

Is there a faster way to separate the minimum and maximum of two arrays?

In [3]: f1 = rand(100000) In [5]: f2 = rand(100000) # Obvious method: In [12]: timeit fmin = np.amin((f1, f2), axis=0); fmax = np.amax((f1, f2), axis=0) 10 loops, best of 3: 59.2 ms per loop In [13]: timeit fmin, fmax = np.sort((f1, f2),…
endolith
  • 25,479
  • 34
  • 128
  • 192
4
votes
1 answer

Minimum or small enough

I am writing Haskell solver for simple board game. I have this function: bestMove :: Board -> (Int,Int) bestMove brd = minimumBy (comparing $ length.choices brd) (remaining brd) Basically bestMove is a move which leaves the smallest amount of…
Piotr Lopusiewicz
  • 2,514
  • 2
  • 27
  • 38
4
votes
2 answers

How to restrict the minimum size of the window for Eclipse e4

I am making an application based on Eclipse e4 framework. I was wondering how the minimal size of the application window can be controlled. There seems no properties can be defined in e4xmi file for this purpose. Does anyone know how to do it? I…
BayOtter
  • 209
  • 2
  • 9
4
votes
3 answers

Unexpected results of minEnclosingCircle in OpenCV

I have recently used the function minEnclosingCircle of OpenCV (2.4.2) because I needed to measure the diameters of a blob of points. After a while I realized that the results were not correct, so I decided to write a small routine that calculates…
Muffo
  • 1,733
  • 2
  • 19
  • 29
4
votes
4 answers

Python miminum value in dictionary of lists

Sorry about the question repost...I should have just edited this question in the first place. Flagged the new one for the mods. Sorry for the trouble Had to re-write the question due to changed requirements. I have a dictionary such as the…
user1530318
  • 25,507
  • 15
  • 37
  • 48