QPALM main
Proximal Augmented Lagrangian method for Quadratic Programs
Loading...
Searching...
No Matches
linesearch.h
Go to the documentation of this file.
1/**
2 * @file linesearch.h
3 * @author Ben Hermans
4 * @brief Routines to perform exact linesearch.
5 * @details Once the direction is found using the semismooth Newton method, the functions in this file can
6 * be called to calculate a stepsize with exact linesearch.
7 */
8
9#ifndef LINESEARCH_H
10#define LINESEARCH_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <qpalm/types.h>
17#include <qpalm/constants.h>
18
19
20/**
21 * Execute exact linesearch (using qsort)
22 *
23 * @param work Workspace
24 * @param c Linear systems solver environment
25 * @return tau Step size
26 */
28
29/**
30 * Helper function to copy vector a in array b (with indices)
31 *
32 * @param a Vector
33 * @param b Array (vector with added indices)
34 * @param n Vector length
35 */
36void vec_array_copy(c_float *a,
37 array_element *b,
38 size_t n);
39
40/**
41 * Select subsequence based on a set of indices, @f$b = a(L)@f$
42 *
43 * @param a Input array
44 * @param b Outpur array
45 * @param L Index set
46 * @param n Length of a
47 */
50 const c_int *L,
51 size_t n);
52
53/**
54 * Inner product over index set, @f$a(L)^T\cdot b(L)@f$
55 *
56 * @param a Vector
57 * @param b Vector
58 * @param L Index set
59 * @param n Vector length
60 */
62 const c_float *b,
63 const c_int *L,
64 size_t n);
65
66/**
67 * Helper function for qsort
68 *
69 * Carries out comparison between two array_elements
70 * @param a Pointer to array element
71 * @param b Pointer to array element
72 * @return a.x > b.x
73 */
74int compare (const void * a,
75 const void * b);
76
77# ifdef __cplusplus
78}
79# endif
80
81#endif
Constants used in QPALM.
ladel_int c_int
type for integer numbers
Definition global_opts.h:42
ladel_double c_float
type for floating point numbers
Definition global_opts.h:41
void vec_array_copy(c_float *a, array_element *b, size_t n)
Helper function to copy vector a in array b (with indices)
Definition linesearch.c:122
void select_subsequence(const array_element *a, array_element *b, const c_int *L, size_t n)
Select subsequence based on a set of indices, .
Definition linesearch.c:134
c_float exact_linesearch(QPALMWorkspace *work, solver_common *c)
Execute exact linesearch (using qsort)
Definition linesearch.c:14
c_float vec_prod_ind(const c_float *a, const c_float *b, const c_int *L, size_t n)
Inner product over index set, .
Definition linesearch.c:145
int compare(const void *a, const void *b)
Helper function for qsort.
Definition linesearch.c:158
QPALM Workspace.
Definition types.h:204
Array to sort in linesearch.
Definition types.h:34
Internal data structures used in QPALM.
ladel_work solver_common
Definition types.h:25