123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- #ifndef UTIL_H
- # define UTIL_H
- # ifdef __cplusplus
- extern "C" {
- # endif
- # include "types.h"
- # include "constants.h"
- const char* osqp_version(void);
- # ifndef EMBEDDED
- OSQPSettings* copy_settings(const OSQPSettings *settings);
- # endif
- void c_strcpy(char dest[],
- const char source[]);
- # ifdef PRINTING
- void print_setup_header(const OSQPWorkspace *work);
- void print_header(void);
- void print_summary(OSQPWorkspace *work);
- void print_polish(OSQPWorkspace *work);
- void print_footer(OSQPInfo *info,
- c_int polish);
- # endif
- # ifdef PROFILING
- # ifdef IS_WINDOWS
-
-
-
- # ifdef R_LANG
- #define NOGDI
- # endif
- # include <windows.h>
- struct OSQP_TIMER {
- LARGE_INTEGER tic;
- LARGE_INTEGER toc;
- LARGE_INTEGER freq;
- };
- # elif defined IS_MAC
- # include <mach/mach_time.h>
- struct OSQP_TIMER {
- uint64_t tic;
- uint64_t toc;
- mach_timebase_info_data_t tinfo;
- };
- # else
- # include <time.h>
- # include <sys/time.h>
- struct OSQP_TIMER {
- struct timespec tic;
- struct timespec toc;
- };
- # endif
- void osqp_tic(OSQPTimer *t);
- c_float osqp_toc(OSQPTimer *t);
- # endif
- # ifndef EMBEDDED
- c_int is_eq_csc(csc *A,
- csc *B,
- c_float tol);
- c_float* csc_to_dns(csc *M);
- # endif
- # ifdef PRINTING
- # include <stdio.h>
- void print_csc_matrix(csc *M,
- const char *name);
- void dump_csc_matrix(csc *M,
- const char *file_name);
- void print_trip_matrix(csc *M,
- const char *name);
- void print_dns_matrix(c_float *M,
- c_int m,
- c_int n,
- const char *name);
- void print_vec(c_float *v,
- c_int n,
- const char *name);
- void dump_vec(c_float *v,
- c_int len,
- const char *file_name);
- void print_vec_int(c_int *x,
- c_int n,
- const char *name);
- # endif
- # ifdef __cplusplus
- }
- # endif
- #endif
|