int main() { auto x = minimum(5, 4, 2, 3); std::cout << x << std::endl; auto y = minimumc(std::less<>(), 3, 2, 1, 0); std::cout << y << std::endl; }
int simplex(double* a,int n,int m,FILE* file) { double aux; int pos=0,nm2,err=0; nm2=n+m+2; aux=minimumc(&a[nm2],m,nm2,n+m,&pos); if(file) fmprint(a,m+1,nm2,file); if(aux<0) err=simplexd(a,n,m,pos+1,file); if(!err) { aux=minimumr(a,nm2,0,&pos); if(aux<0) err=simplexp(a,n,m,pos,file); } return err; }
T1 minimumc(Compare comp, T1 a, T... args) { return minimumc(comp, a, minimumc(comp, args...)); }