Sha256: d8a473ccb5ee582a19a607bd581bc71e63cd6eafcc7779b4d45952f7ca4a5765

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

#ifndef UTIL_H_GUARD
#define UTIL_H_GUARD

#ifdef __cplusplus
extern "C" {
#endif

#include "cones.h"
#include "scs.h"
#include <stdio.h>
#include <stdlib.h>

/* timing code courtesy of A. Domahidi */
#if (defined NOTIMER)
typedef void *SCS(timer);
#elif (defined _WIN32 || defined _WIN64 || defined _WINDLL)
/* Use Windows QueryPerformanceCounter for timing */
#include <windows.h>
typedef struct SCS(timer) {
  LARGE_INTEGER tic;
  LARGE_INTEGER toc;
  LARGE_INTEGER freq;
} SCS(timer);

#elif (defined __APPLE__)
/* Use MAC OSX mach_time for timing */
#include <mach/mach_time.h>
typedef struct SCS(timer) {
  uint64_t tic;
  uint64_t toc;
  mach_timebase_info_data_t tinfo;
} SCS(timer);

#else
/* Use POSIX clock_gettime() for timing on other machines */
#include <time.h>
typedef struct SCS(timer) {
  struct timespec tic;
  struct timespec toc;
} SCS(timer);

#endif

/* these all return milli-seconds */
void SCS(tic)(SCS(timer) * t);
scs_float SCS(tocq)(SCS(timer) * t);
void SCS(free_sol)(ScsSolution *sol);
void SCS(deep_copy_data)(ScsData *dest, const ScsData *src);
void SCS(deep_copy_stgs)(ScsSettings *dest, const ScsSettings *src);
void SCS(free_data)(ScsData *d);

#ifdef __cplusplus
}
#endif
#endif

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scs-0.4.0 vendor/scs/include/util.h