11 #ifndef _VCS_INTERNAL_H
12 #define _VCS_INTERNAL_H
29 #define VCS_DATA_PTR(vvv) (&(vvv[0]))
35 #define plogf Cantera::writelogf
42 #define plogendl() Cantera::writelogendl()
51 extern int vcs_timing_print_lvl;
56 class VCS_SPECIES_THERMO;
124 double vcsUtil_gasConstant(
int mu_units);
160 int vcsUtil_mlequ(
double* c,
size_t idem,
size_t n,
double* b,
size_t m);
196 int vcsUtil_gaussj(
double* c,
size_t idem,
size_t n,
double* b,
size_t m);
203 typedef double(*VCS_FUNC_PTR)(
double xval,
double Vtarget,
204 int varID,
void* fptrPassthrough,
316 int vcsUtil_root1d(
double xmin,
double xmax,
size_t itmax, VCS_FUNC_PTR func,
317 void* fptrPassthrough,
318 double FuncTargVal,
int varID,
double* xbest,
339 inline void vcs_dzero(
double*
const vec_to,
const size_t length)
341 (void) memset((
void*) vec_to, 0, length *
sizeof(double));
349 inline void vcs_izero(
int*
const vec_to,
const size_t length)
351 (void) memset((
void*) vec_to, 0, length *
sizeof(int));
361 inline void vcs_dcopy(
double*
const vec_to,
362 const double*
const vec_from,
const size_t length)
364 (void) memcpy((
void*) vec_to, (
const void*) vec_from,
365 (length) *
sizeof(double));
376 inline void vcs_icopy(
int*
const vec_to,
377 const int*
const vec_from,
const size_t length)
379 (void) memcpy((
void*) vec_to, (
const void*) vec_from,
380 (length) *
sizeof(int));
388 inline void vcs_vdzero(std::vector<double> &vec_to,
const size_t length)
390 (void) memset((
void*)
VCS_DATA_PTR(vec_to), 0, (length) *
sizeof(
double));
398 inline void vcs_vizero(std::vector<int> &vec_to,
const size_t length)
400 (void) memset((
void*)
VCS_DATA_PTR(vec_to), 0, (length) *
sizeof(
int));
414 inline void vcs_vdcopy(std::vector<double> & vec_to,
415 const std::vector<double> & vec_from,
size_t length)
417 (void) memcpy((
void*)&(vec_to[0]), (
const void*) &(vec_from[0]),
418 (length) *
sizeof(double));
431 inline void vcs_vicopy(std::vector<int> & vec_to,
432 const std::vector<int> & vec_from,
const int length)
434 (void) memcpy((
void*)&(vec_to[0]), (
const void*) &(vec_from[0]),
435 (length) *
sizeof(int));
438 extern void vcs_dzero(
double*
const,
const int);
439 extern void vcs_izero(
int*
const ,
const int);
440 extern void vcs_dcopy(
double*
const,
const double*
const,
const int);
441 extern void vcs_icopy(
int*
const,
const int*
const,
const int);
442 extern void vcs_vdzero(std::vector<double> &vvv,
const int len = -1);
443 extern void vcs_vizero(std::vector<double> &vvv,
const int len = -1);
444 void vcs_vdcopy(std::vector<double> &vec_to,
445 const std::vector<double> vec_from,
const int len = -1);
446 void vcs_vicopy(std::vector<int> &vec_to,
447 const std::vector<int> vec_from,
const int len = -1);
456 double vcs_l2norm(
const std::vector<double> vec);
468 size_t vcs_optMax(
const double* x,
const double* xSize,
size_t j,
size_t n);
477 int vcs_max_int(
const int* vector,
int length);
487 void vcs_print_line(
const char* str,
int num);
498 const char* vcs_speciesType_string(
int speciesStatus,
int length = 100);
513 void vcs_print_stringTrunc(
const char* str,
size_t space,
int alignment);
526 bool vcs_doubleEqual(
double d1,
double d2);