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
15
votes
2 answers

C: Casting minimum 32-bit integer (-2147483648) to float gives positive number (2147483648.0)

I was working on an embedded project when I ran into something which I thought was strange behaviour. I managed to reproduce it on codepad (see below) to confirm, but don't have any other C compilers on my machine to try it on them. Scenario: I have…
avanzal
  • 153
  • 1
  • 6
14
votes
9 answers

Python: get key with the least value from a dictionary BUT multiple minimum values

I'm trying to do the same as Get the key corresponding to the minimum value within a dictionary, where we want to get the key corresponding to the minimum value in a dictionary. The best way appears to be: min(d, key=d.get) BUT I want to apply…
gozzilli
  • 8,089
  • 11
  • 56
  • 87
14
votes
8 answers

How can I override the minimum-font-size in Firefox?

My site displays just like I need it to in IE and Opera, but in Firefox I can't use CSS to get font sizes smaller than Firefox's default minimum-font-size. Of course, I can go to Tools → Options and remove this value, but some users will see some of…
Alextronic
  • 491
  • 2
  • 4
  • 11
14
votes
3 answers

Horizontal minimum and maximum using SSE

I have a function using SSE to do a lot of stuff, and the profiler shows me that the code portion I use to compute the horizontal minimum and maximum consumes most of the time. I have been using the following implementation for the minimum for…
user46317
  • 843
  • 1
  • 10
  • 16
13
votes
3 answers

Fastest way to find minimal product of 2 array elements containing 200000+ elements

I have an array a[n]. The number n is entered by us. I need to find the minimal product of a[i] and a[j] if: 1) abs(i - j) > k 2) a[i] * a[j] is minimised Here is my solution (very naive): #include using namespace std; #define ll long…
Mouvre
  • 274
  • 2
  • 10
12
votes
6 answers

Fetching Minimum/Maximum for each group in ActiveRecord

This is an age-old question where given a table with attributes 'type', 'variety' and 'price', that you fetch the record with the minimum price for each type there is. In SQL, we can do this by: select f.type, f.variety, f.price from ( select…
Geofrey Flores
12
votes
1 answer

How to find the minimum value in a numpy matrix?

Hey this is a quick and easy question... How would i find the minimum value of this matrix, excluding 0? As in, 8 arr = numpy.array([[ 0., 56., 20., 44.], [ 68., 0., 56., 8.], [ 32., 56., 0., 44.], …
Sean
  • 1,283
  • 9
  • 27
  • 43
11
votes
5 answers

A two way minimum spanning tree of a directed graph

Given a directed graph with weighted edges, what algorithm can be used to give a sub-graph that has minimum weight, but allows movement from any vertex to any other vertex in the graph (under the assumption that paths between any two vertices always…
11
votes
2 answers

How to find the smallest ellipse covering a given fraction of a set of points in R?

I'm wondering: Is there some function/clever way to find the smallest ellipse covering a given fraction of a set of 2d points in R? With smallest I mean the ellipse with the smallest area. Clarification: I'm fine with an approximately correct…
Rasmus Bååth
  • 4,827
  • 4
  • 29
  • 29
11
votes
1 answer

Fetched Property in XCode Data Model Editor for minimum value

How do I add a Fetched Property in XCode's Data Model Editor for minimum value of one attribute?? My model: Model http://www.freeimagehosting.net/uploads/b48853070e.png Item (name, note, storedItem) StoredItem (price, item) Item 1 ---> N StoredITem…
wal
  • 2,044
  • 3
  • 18
  • 22
11
votes
3 answers

Change the labels of a colorbar from increasing to decreasing values

I'd like to change the labels for the colorbar from increasing to decreasing values. When I try to do this via vmin and vmax I get the error message: minvalue must be less than or equal to maxvalue So, for example I'd like the colorbar to start at…
Paul Eigenthaler
  • 165
  • 1
  • 2
  • 10
11
votes
6 answers

Suggest an algorithm (graph - possibly NP-Complete)

There is a network of towns, connected by roads of various integer lengths. A traveler wishes to travel in his car from one town to another. However, he does not want to minimize distance traveled; instead he wishes to minimize the petrol cost of…
Andrew Wills
  • 111
  • 4
10
votes
6 answers

How to get the biggest numbers out from huge amount of numbers?

I'd like to get the largest 100 elements out from a list of at least 100000000 numbers. I could sort the entire list and just take the last 100 elements from the sorted list, but that would be very expensive in terms of both memory and time. Is…
limi
  • 695
  • 1
  • 8
  • 18
10
votes
6 answers

Select distinct from usercolumn and minimum value of dates for each field in usercolumn

I have some data like this but more than 1500000 records and more than 700 users: usercolumn , datecolumn\ a1 , 1998/2/11\ a2 , 1998/3/11\ a1 , 1998/2/15\ a4 , …
nasiry
9
votes
5 answers

Fastest way to determine the non-zero minimum

Having an array of for instance 4 integers how can one determine it's non-zero minimum - in the fastest way ?
Patryk
  • 22,602
  • 44
  • 128
  • 244
1 2
3
70 71