Array.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of QuadProg++: a C++ library implementing
  2. // the algorithm of Goldfarb and Idnani for the solution of a (convex)
  3. // Quadratic Programming problem by means of an active-set dual method.
  4. // Copyright (C) 2007-2009 Luca Di Gaspero.
  5. // Copyright (C) 2009 Eric Moyer.
  6. //
  7. // QuadProg++ is free software: you can redistribute it and/or modify
  8. // it under the terms of the GNU Lesser General Public License as published by
  9. // the Free Software Foundation, either version 3 of the License, or
  10. // (at your option) any later version.
  11. //
  12. // QuadProg++ is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU Lesser General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU Lesser General Public License
  18. // along with QuadProg++. If not, see <http://www.gnu.org/licenses/>.
  19. #include "vislearning/optimization/quadprog/Array.h"
  20. /**
  21. Index utilities
  22. */
  23. namespace QuadProgPP{
  24. std::set<unsigned int> seq(unsigned int s, unsigned int e)
  25. {
  26. std::set<unsigned int> tmp;
  27. for (unsigned int i = s; i <= e; i++)
  28. tmp.insert(i);
  29. return tmp;
  30. }
  31. std::set<unsigned int> singleton(unsigned int i)
  32. {
  33. std::set<unsigned int> tmp;
  34. tmp.insert(i);
  35. return tmp;
  36. }
  37. }