/usr/include/CGAL/QP_functions.h is in libcgal-dev 4.2-5ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | // Copyright (c) 1997-2007 ETH Zurich (Switzerland).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Bernd Gaertner <gaertner@inf.ethz.ch>
#ifndef CGAL_QP_FUNCTIONS_H
#define CGAL_QP_FUNCTIONS_H
#include <iostream>
#include <string>
#include <CGAL/QP_options.h>
#include <CGAL/QP_solution.h>
namespace CGAL {
namespace QP_functions_detail {
// internal routine; writes P to out in MPS format
// Is_linear == Tag_true / Tag_false:
// p is treated as LinearProgram / QuadraticProgram
// Is_nonnegative == Tag_true / Tag_false
// p is treated as Nonnegative / Arbitrary
// the dmatrix parameter specificies whether the quadratic matrix (if any)
// is written in DMATRIX format (no multiplication by two, good for
// cross-checking output, or in QMATRIX format (good for using other
// solvers like CPLEX)
template <typename P, typename Is_linear, typename Is_nonnegative>
void print_program
(std::ostream& out,
const P &p,
const std::string& problem_name,
Is_linear is_linear,
Is_nonnegative is_nonnegative);
// internal routine: solves a program, depending on the tags
template <typename Program, typename ET,
typename Is_linear,typename Is_nonnegative >
Quadratic_program_solution<ET> solve_program
(const Program &p, const ET&,
Is_linear is_linear,
Is_nonnegative is_nonnegative,
const Quadratic_program_options& options = Quadratic_program_options());
// internal routines: prints name of solution function
inline void print_solution_function
(std::ostream& out,
Tag_true /*is_linear*/, Tag_true /*is_nonnegative*/)
{
out << "solve_nonnegative_linear_program";
}
inline void print_solution_function
(std::ostream& out,
Tag_false /*is_linear*/, Tag_true /*is_nonnegative*/)
{
out << "solve_nonnegative_quadratic_program";
}
inline void print_solution_function
(std::ostream& out,
Tag_true /*is_linear*/, Tag_false /*is_nonnegative*/)
{
out << "solve_linear_program";
}
inline void print_solution_function
(std::ostream& out,
Tag_false /*is_linear*/, Tag_false /*is_nonnegative*/)
{
out << "solve_quadratic_program";
}
// internal routine:
// test whether the system is of the form A x == b (equations only)
template <typename R>
bool is_in_equational_form (const R& r);
// internal routine:
// test whether the row vectors of A that correpsond to equations
// are linearly independent; this is done using type ET. The value
// type of LinearInequalitySystem must be convertible to ET
template <class Ar, class ET>
bool has_linearly_independent_equations
(const Ar& ar, const ET& dummy);
}
template <typename QuadraticProgram>
void print_quadratic_program
(std::ostream& out, const QuadraticProgram &qp,
const std::string& problem_name = std::string("MY_MPS"))
// writes qp to out in MPS format
{
QP_functions_detail::print_program
(out, qp, problem_name, CGAL::Tag_false(), CGAL::Tag_false());
}
template <typename LinearProgram>
void print_linear_program
(std::ostream& out, const LinearProgram &lp,
const std::string& problem_name = std::string("MY_MPS"))
// writes lp to out in MPS format
{
QP_functions_detail::print_program
(out, lp, problem_name, CGAL::Tag_true(), CGAL::Tag_false());
}
template <typename NonnegativeQuadraticProgram>
void print_nonnegative_quadratic_program
(std::ostream& out, const NonnegativeQuadraticProgram &qp,
const std::string& problem_name = std::string("MY_MPS"))
// writes qp to out in MPS format
{
QP_functions_detail::print_program
(out, qp, problem_name, CGAL::Tag_false(), CGAL::Tag_true());
}
template <typename NonnegativeLinearProgram>
void print_nonnegative_linear_program
(std::ostream& out, const NonnegativeLinearProgram &lp,
const std::string& problem_name = std::string("MY_MPS"))
// writes lp to out in MPS format
{
QP_functions_detail::print_program
(out, lp, problem_name, CGAL::Tag_true(), CGAL::Tag_true());
}
template <typename QuadraticProgram, typename ET>
Quadratic_program_solution<ET> solve_quadratic_program
(const QuadraticProgram &qp, const ET&,
const Quadratic_program_options& options = Quadratic_program_options());
template <typename NonnegativeQuadraticProgram, typename ET>
Quadratic_program_solution<ET> solve_nonnegative_quadratic_program
(const NonnegativeQuadraticProgram &qp, const ET&,
const Quadratic_program_options& options = Quadratic_program_options());
template <typename LinearProgram, typename ET>
Quadratic_program_solution<ET> solve_linear_program
(const LinearProgram &lp, const ET&,
const Quadratic_program_options& options = Quadratic_program_options());
template <typename NonnegativeLinearProgram, typename ET>
Quadratic_program_solution<ET> solve_nonnegative_linear_program
(const NonnegativeLinearProgram &lp, const ET&,
const Quadratic_program_options& options = Quadratic_program_options());
} //namespace CGAL
#include <CGAL/QP_solver/QP_functions_impl.h>
#endif // CGAL_QP_FUNCTIONS_H
|