2017-07-20 19:35:53 +02:00
|
|
|
#ifdef __cplusplus
|
2018-08-09 18:06:22 +02:00
|
|
|
# include <iostream>
|
2017-07-20 19:35:53 +02:00
|
|
|
extern "C"
|
|
|
|
#else
|
2018-08-09 18:06:22 +02:00
|
|
|
# include <stdio.h>
|
2017-07-20 19:35:53 +02:00
|
|
|
#endif
|
|
|
|
int scalprod(int n, double* x, double* y, double* res);
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
double a[5] = { 1., 2., 3., 4., 5. };
|
|
|
|
double b[5] = { 2., 3., 4., 5., 6. };
|
|
|
|
double rk;
|
|
|
|
scalprod(5, a, b, &rk);
|
|
|
|
#ifdef __cplusplus
|
|
|
|
std::cout << rk << std::endl;
|
|
|
|
#else
|
|
|
|
printf("%f\n", rk);
|
|
|
|
#endif
|
|
|
|
}
|