text:
#include <gsl/gsl_test.h>
#include <gsl/gsl_ieee_utils.h>
#include <gsl/gsl_math.h>
#include "gsl_cblas.h"

#include "tests.h"

void
test_syr2k (void) {
const double flteps = 1e-4, dbleps = 1e-6;
  {
   int order = 101;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.1f;
   float A[] = { -0.635f, 0.805f };
   int lda = 2;
   float B[] = { 0.773f, 0.375f };
   int ldb = 2;
   float C[] = { 0.616f };
   int ldc = 1;
   float C_expected[] = { 0.174988f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1622)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.1f;
   float A[] = { -0.396f, -0.131f };
   int lda = 2;
   float B[] = { -0.603f, -0.288f };
   int ldb = 2;
   float C[] = { -0.434f };
   int ldc = 1;
   float C_expected[] = { -0.20931f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1623)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.1f;
   float A[] = { -0.085f, -0.444f };
   int lda = 1;
   float B[] = { 0.936f, 0.752f };
   int ldb = 1;
   float C[] = { -0.64f };
   int ldc = 1;
   float C_expected[] = { 0.184069f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1624)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.1f;
   float A[] = { 0.655f, 0.45f };
   int lda = 1;
   float B[] = { 0.16f, -0.747f };
   int ldb = 1;
   float C[] = { 0.576f };
   int ldc = 1;
   float C_expected[] = { 0.19641f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1625)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.0f;
   float A[] = { 0.259f, -0.334f };
   int lda = 1;
   float B[] = { -0.911f, -0.426f };
   int ldb = 1;
   float C[] = { 0.432f };
   int ldc = 1;
   float C_expected[] = { 0.056199f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1626)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.0f;
   float A[] = { -0.765f, 0.7f };
   int lda = 1;
   float B[] = { 0.487f, 0.768f };
   int ldb = 1;
   float C[] = { 0.836f };
   int ldc = 1;
   float C_expected[] = { -0.099027f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1627)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.0f;
   float A[] = { -0.584f, 0.056f };
   int lda = 2;
   float B[] = { 0.928f, -0.101f };
   int ldb = 2;
   float C[] = { -0.529f };
   int ldc = 1;
   float C_expected[] = { 0.328565f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1628)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha = -0.3f;
   float beta = 0.0f;
   float A[] = { 0.25f, 0.8f };
   int lda = 2;
   float B[] = { 0.489f, -0.642f };
   int ldb = 2;
   float C[] = { 0.322f };
   int ldc = 1;
   float C_expected[] = { 0.23481f };
   cblas_ssyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], flteps, "ssyr2k(case 1629)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha = 0;
   double beta = 0;
   double A[] = { 0.591, 0.21 };
   int lda = 2;
   double B[] = { -0.718, -0.579 };
   int ldb = 2;
   double C[] = { -0.856 };
   int ldc = 1;
   double C_expected[] = { -0.0 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1630)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha = 0;
   double beta = 0;
   double A[] = { -0.971, -0.824 };
   int lda = 2;
   double B[] = { -0.227, 0.457 };
   int ldb = 2;
   double C[] = { 0.521 };
   int ldc = 1;
   double C_expected[] = { 0.0 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1631)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha = 0;
   double beta = 0;
   double A[] = { -0.274, 0.583 };
   int lda = 1;
   double B[] = { 0.668, -0.83 };
   int ldb = 1;
   double C[] = { 0.907 };
   int ldc = 1;
   double C_expected[] = { 0.0 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1632)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha = 0;
   double beta = 0;
   double A[] = { -0.512, -0.436 };
   int lda = 1;
   double B[] = { -0.443, -0.259 };
   int ldb = 1;
   double C[] = { -0.667 };
   int ldc = 1;
   double C_expected[] = { 0.0 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1633)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha = -0.3;
   double beta = 0;
   double A[] = { 0.741, -0.341 };
   int lda = 1;
   double B[] = { 0.743, -0.315 };
   int ldb = 1;
   double C[] = { -0.776 };
   int ldc = 1;
   double C_expected[] = { -0.3947868 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1634)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha = -0.3;
   double beta = 0;
   double A[] = { 0.03, 0.175 };
   int lda = 1;
   double B[] = { -0.832, 0.291 };
   int ldb = 1;
   double C[] = { 0.281 };
   int ldc = 1;
   double C_expected[] = { -0.015579 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1635)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha = -0.3;
   double beta = 0;
   double A[] = { 0.476, 0.496 };
   int lda = 2;
   double B[] = { -0.626, -0.159 };
   int ldb = 2;
   double C[] = { -0.964 };
   int ldc = 1;
   double C_expected[] = { 0.226104 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1636)");
     }
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha = -0.3;
   double beta = 0;
   double A[] = { -0.489, 0.611 };
   int lda = 2;
   double B[] = { -0.285, -0.673 };
   int ldb = 2;
   double C[] = { -0.11 };
   int ldc = 1;
   double C_expected[] = { 0.1631028 };
   cblas_dsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[i], C_expected[i], dbleps, "dsyr2k(case 1637)");
     }
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha[2] = {1.0f, 0.0f};
   float beta[2] = {0.0f, 0.1f};
   float A[] = { 0.796f, 0.872f, -0.919f, 0.748f };
   int lda = 2;
   float B[] = { -0.945f, 0.915f, -0.252f, -0.276f };
   int ldb = 2;
   float C[] = { 0.07f, -0.957f };
   int ldc = 1;
   float C_expected[] = { -2.12843f, -0.054104f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1638) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1638) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha[2] = {1.0f, 0.0f};
   float beta[2] = {0.0f, 0.1f};
   float A[] = { 0.984f, 0.526f, 0.284f, 0.806f };
   int lda = 2;
   float B[] = { -0.509f, -0.178f, 0.188f, -0.221f };
   int ldb = 2;
   float C[] = { -0.388f, 0.795f };
   int ldc = 1;
   float C_expected[] = { -0.43092f, -0.747044f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1639) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1639) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha[2] = {1.0f, 0.0f};
   float beta[2] = {0.0f, 0.1f};
   float A[] = { -0.16f, 0.628f, -0.06f, -0.645f };
   int lda = 1;
   float B[] = { 0.846f, 0.545f, 0.032f, 0.493f };
   int ldb = 1;
   float C[] = { -0.041f, -0.621f };
   int ldc = 1;
   float C_expected[] = { -0.26101f, 0.783636f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1640) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1640) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   float alpha[2] = {1.0f, 0.0f};
   float beta[2] = {0.0f, 0.1f};
   float A[] = { -0.478f, -0.556f, 0.519f, 0.177f };
   int lda = 1;
   float B[] = { -0.946f, 0.423f, -0.859f, 0.736f };
   int ldb = 1;
   float C[] = { -0.54f, -0.035f };
   int ldc = 1;
   float C_expected[] = { 0.226066f, 1.05345f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1641) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1641) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha[2] = {0.0f, 0.0f};
   float beta[2] = {1.0f, 0.0f};
   float A[] = { -0.582f, 0.09f, -0.176f, 0.784f };
   int lda = 1;
   float B[] = { 0.687f, -0.859f, 0.945f, 0.756f };
   int ldb = 1;
   float C[] = { -0.663f, -0.186f };
   int ldc = 1;
   float C_expected[] = { -0.663f, -0.186f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1642) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1642) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha[2] = {0.0f, 0.0f};
   float beta[2] = {1.0f, 0.0f};
   float A[] = { 0.231f, -0.452f, -0.112f, -0.837f };
   int lda = 1;
   float B[] = { -0.258f, 0.464f, -0.224f, 0.893f };
   int ldb = 1;
   float C[] = { -0.448f, 0.046f };
   int ldc = 1;
   float C_expected[] = { -0.448f, 0.046f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1643) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1643) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha[2] = {0.0f, 0.0f};
   float beta[2] = {1.0f, 0.0f};
   float A[] = { 0.115f, 0.178f, -0.193f, -0.491f };
   int lda = 2;
   float B[] = { 0.545f, -0.665f, 0.979f, -0.4f };
   int ldb = 2;
   float C[] = { 0.522f, 0.712f };
   int ldc = 1;
   float C_expected[] = { 0.522f, 0.712f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1644) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1644) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   float alpha[2] = {0.0f, 0.0f};
   float beta[2] = {1.0f, 0.0f};
   float A[] = { -0.725f, -0.808f, -0.244f, 0.145f };
   int lda = 2;
   float B[] = { 0.447f, -0.413f, -0.226f, -0.585f };
   int ldb = 2;
   float C[] = { -0.531f, 0.227f };
   int ldc = 1;
   float C_expected[] = { -0.531f, 0.227f };
   cblas_csyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], flteps, "csyr2k(case 1645) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], flteps, "csyr2k(case 1645) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha[2] = {-0.3, 0.1};
   double beta[2] = {-0.3, 0.1};
   double A[] = { 0.337, -0.737, -0.993, 0.69 };
   int lda = 2;
   double B[] = { -0.39, -0.836, -0.32, 0.368 };
   int ldb = 2;
   double C[] = { 0.844, -0.763 };
   int ldc = 1;
   double C_expected[] = { 0.3494384, 0.5248712 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1646) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1646) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha[2] = {-0.3, 0.1};
   double beta[2] = {-0.3, 0.1};
   double A[] = { 0.386, -0.465, 0.719, -0.378 };
   int lda = 2;
   double B[] = { 0.099, -0.879, 0.864, 0.141 };
   int ldb = 2;
   double C[] = { -0.599, -0.47 };
   int ldc = 1;
   double C_expected[] = { 0.1664126, 0.5082238 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1647) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1647) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha[2] = {-0.3, 0.1};
   double beta[2] = {-0.3, 0.1};
   double A[] = { 0.914, 0.128, -0.262, -0.26 };
   int lda = 1;
   double B[] = { 0.431, 0.276, 0.75, 0.904 };
   int ldb = 1;
   double C[] = { 0.287, 0.537 };
   int ldc = 1;
   double C_expected[] = { -0.3532044, 0.0216788 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1648) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1648) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 111;
   int N = 1;
   int K = 2;
   double alpha[2] = {-0.3, 0.1};
   double beta[2] = {-0.3, 0.1};
   double A[] = { 0.618, 0.72, 0.392, -0.737 };
   int lda = 1;
   double B[] = { 0.783, 0.531, 0.375, 0.203 };
   int ldb = 1;
   double C[] = { 0.058, -0.116 };
   int ldc = 1;
   double C_expected[] = { -0.3837348, -0.2968344 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1649) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1649) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha[2] = {0, 1};
   double beta[2] = {1, 0};
   double A[] = { -0.372, -0.735, -0.711, 0.051 };
   int lda = 1;
   double B[] = { 0.257, 0.097, 0.338, -0.484 };
   int ldb = 1;
   double C[] = { -0.142, -0.197 };
   int ldc = 1;
   double C_expected[] = { -0.414766, -0.676886 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1650) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1650) imag");
     };
   };
  };

  {
   int order = 101;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha[2] = {0, 1};
   double beta[2] = {1, 0};
   double A[] = { 0.1, -0.878, 0.28, -0.381 };
   int lda = 1;
   double B[] = { -0.208, 0.309, -0.276, 0.123 };
   int ldb = 1;
   double C[] = { 0.483, -0.541 };
   int ldc = 1;
   double C_expected[] = { -0.22324, -0.10083 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1651) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1651) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 121;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha[2] = {0, 1};
   double beta[2] = {1, 0};
   double A[] = { -0.918, 0.515, -0.985, 0.067 };
   int lda = 2;
   double B[] = { -0.034, 0.408, 0.66, -0.945 };
   int ldb = 2;
   double C[] = { -0.063, -0.018 };
   int ldc = 1;
   double C_expected[] = { -1.228982, -1.549386 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1652) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1652) imag");
     };
   };
  };

  {
   int order = 102;
   int uplo = 122;
   int trans = 112;
   int N = 1;
   int K = 2;
   double alpha[2] = {0, 1};
   double beta[2] = {1, 0};
   double A[] = { 0.443, -0.009, -0.245, -0.008 };
   int lda = 2;
   double B[] = { 0.495, -0.239, -0.973, -0.032 };
   int ldb = 2;
   double C[] = { -0.85, -0.799 };
   int ldc = 1;
   double C_expected[] = { -0.660584, 0.111526 };
   cblas_zsyr2k(order, uplo, trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
   {
     int i;
     for (i = 0; i < 1; i++) {
       gsl_test_rel(C[2*i], C_expected[2*i], dbleps, "zsyr2k(case 1653) real");
       gsl_test_rel(C[2*i+1], C_expected[2*i+1], dbleps, "zsyr2k(case 1653) imag");
     };
   };
  };

}


text:
/* vector/gsl_vector_long.h
 *
 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef __GSL_VECTOR_LONG_H__
#define __GSL_VECTOR_LONG_H__

#if !defined( GSL_FUN )
#  if !defined( GSL_DLL )
#    define GSL_FUN extern
#  elif defined( BUILD_GSL_DLL )
#    define GSL_FUN extern __declspec(dllexport)
#  else
#    define GSL_FUN extern __declspec(dllimport)
#  endif
#endif

#include <stdlib.h>
#include <gsl/gsl_types.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_inline.h>
#include <gsl/gsl_check_range.h>
#include <gsl/gsl_block_long.h>

#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif

__BEGIN_DECLS

typedef struct
{
  size_t size;
  size_t stride;
  long *data;
  gsl_block_long *block;
  int owner;
}
gsl_vector_long;

typedef struct
{
  gsl_vector_long vector;
} _gsl_vector_long_view;

typedef _gsl_vector_long_view gsl_vector_long_view;

typedef struct
{
  gsl_vector_long vector;
} _gsl_vector_long_const_view;

typedef const _gsl_vector_long_const_view gsl_vector_long_const_view;

/* Allocation */

GSL_FUN gsl_vector_long *gsl_vector_long_alloc (const size_t n);
GSL_FUN gsl_vector_long *gsl_vector_long_calloc (const size_t n);

GSL_FUN gsl_vector_long *gsl_vector_long_alloc_from_block (gsl_block_long * b,
                                                     const size_t offset,
                                                     const size_t n,
                                                     const size_t stride);

GSL_FUN gsl_vector_long *gsl_vector_long_alloc_from_vector (gsl_vector_long * v,
                                                      const size_t offset,
                                                      const size_t n,
                                                      const size_t stride);

GSL_FUN void gsl_vector_long_free (gsl_vector_long * v);

/* Views */

GSL_FUN _gsl_vector_long_view
gsl_vector_long_view_array (long *v, size_t n);

GSL_FUN _gsl_vector_long_view
gsl_vector_long_view_array_with_stride (long *base,
                                         size_t stride,
                                         size_t n);

GSL_FUN _gsl_vector_long_const_view
gsl_vector_long_const_view_array (const long *v, size_t n);

GSL_FUN _gsl_vector_long_const_view
gsl_vector_long_const_view_array_with_stride (const long *base,
                                               size_t stride,
                                               size_t n);

GSL_FUN _gsl_vector_long_view
gsl_vector_long_subvector (gsl_vector_long *v,
                            size_t i,
                            size_t n);

GSL_FUN _gsl_vector_long_view
gsl_vector_long_subvector_with_stride (gsl_vector_long *v,
                                        size_t i,
                                        size_t stride,
                                        size_t n);

GSL_FUN _gsl_vector_long_const_view
gsl_vector_long_const_subvector (const gsl_vector_long *v,
                                  size_t i,
                                  size_t n);

GSL_FUN _gsl_vector_long_const_view
gsl_vector_long_const_subvector_with_stride (const gsl_vector_long *v,
                                              size_t i,
                                              size_t stride,
                                              size_t n);

/* Operations */

GSL_FUN void gsl_vector_long_set_zero (gsl_vector_long * v);
GSL_FUN void gsl_vector_long_set_all (gsl_vector_long * v, long x);
GSL_FUN int gsl_vector_long_set_basis (gsl_vector_long * v, size_t i);

GSL_FUN int gsl_vector_long_fread (FILE * stream, gsl_vector_long * v);
GSL_FUN int gsl_vector_long_fwrite (FILE * stream, const gsl_vector_long * v);
GSL_FUN int gsl_vector_long_fscanf (FILE * stream, gsl_vector_long * v);
GSL_FUN int gsl_vector_long_fprintf (FILE * stream, const gsl_vector_long * v,
                              const char *format);

GSL_FUN int gsl_vector_long_memcpy (gsl_vector_long * dest, const gsl_vector_long * src);

GSL_FUN int gsl_vector_long_reverse (gsl_vector_long * v);

GSL_FUN int gsl_vector_long_swap (gsl_vector_long * v, gsl_vector_long * w);
GSL_FUN int gsl_vector_long_swap_elements (gsl_vector_long * v, const size_t i, const size_t j);

GSL_FUN long gsl_vector_long_max (const gsl_vector_long * v);
GSL_FUN long gsl_vector_long_min (const gsl_vector_long * v);
GSL_FUN void gsl_vector_long_minmax (const gsl_vector_long * v, long * min_out, long * max_out);

GSL_FUN size_t gsl_vector_long_max_index (const gsl_vector_long * v);
GSL_FUN size_t gsl_vector_long_min_index (const gsl_vector_long * v);
GSL_FUN void gsl_vector_long_minmax_index (const gsl_vector_long * v, size_t * imin, size_t * imax);

GSL_FUN int gsl_vector_long_add (gsl_vector_long * a, const gsl_vector_long * b);
GSL_FUN int gsl_vector_long_sub (gsl_vector_long * a, const gsl_vector_long * b);
GSL_FUN int gsl_vector_long_mul (gsl_vector_long * a, const gsl_vector_long * b);
GSL_FUN int gsl_vector_long_div (gsl_vector_long * a, const gsl_vector_long * b);
GSL_FUN int gsl_vector_long_scale (gsl_vector_long * a, const long x);
GSL_FUN int gsl_vector_long_add_constant (gsl_vector_long * a, const double x);
GSL_FUN int gsl_vector_long_axpby (const long alpha, const gsl_vector_long * x, const long beta, gsl_vector_long * y);
GSL_FUN long gsl_vector_long_sum (const gsl_vector_long * a);

GSL_FUN int gsl_vector_long_equal (const gsl_vector_long * u,
                            const gsl_vector_long * v);

GSL_FUN int gsl_vector_long_isnull (const gsl_vector_long * v);
GSL_FUN int gsl_vector_long_ispos (const gsl_vector_long * v);
GSL_FUN int gsl_vector_long_isneg (const gsl_vector_long * v);
GSL_FUN int gsl_vector_long_isnonneg (const gsl_vector_long * v);

GSL_FUN INLINE_DECL long gsl_vector_long_get (const gsl_vector_long * v, const size_t i);
GSL_FUN INLINE_DECL void gsl_vector_long_set (gsl_vector_long * v, const size_t i, long x);
GSL_FUN INLINE_DECL long * gsl_vector_long_ptr (gsl_vector_long * v, const size_t i);
GSL_FUN INLINE_DECL const long * gsl_vector_long_const_ptr (const gsl_vector_long * v, const size_t i);

#ifdef HAVE_INLINE

INLINE_FUN
long
gsl_vector_long_get (const gsl_vector_long * v, const size_t i)
{
#if GSL_RANGE_CHECK
  if (GSL_RANGE_COND(i >= v->size))
    {
      GSL_ERROR_VAL ("index out of range", GSL_EINVAL, 0);
    }
#endif
  return v->data[i * v->stride];
}

INLINE_FUN
void
gsl_vector_long_set (gsl_vector_long * v, const size_t i, long x)
{
#if GSL_RANGE_CHECK
  if (GSL_RANGE_COND(i >= v->size))
    {
      GSL_ERROR_VOID ("index out of range", GSL_EINVAL);
    }
#endif
  v->data[i * v->stride] = x;
}

INLINE_FUN
long *
gsl_vector_long_ptr (gsl_vector_long * v, const size_t i)
{
#if GSL_RANGE_CHECK
  if (GSL_RANGE_COND(i >= v->size))
    {
      GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
    }
#endif
  return (long *) (v->data + i * v->stride);
}

INLINE_FUN
const long *
gsl_vector_long_const_ptr (const gsl_vector_long * v, const size_t i)
{
#if GSL_RANGE_CHECK
  if (GSL_RANGE_COND(i >= v->size))
    {
      GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
    }
#endif
  return (const long *) (v->data + i * v->stride);
}
#endif /* HAVE_INLINE */

__END_DECLS

#endif /* __GSL_VECTOR_LONG_H__ */

ext: h

max_stars_repo_name: mgreter/astrometrylib

max_issues_repo_name: zzpwahaha/VimbaCamJILA

max_forks_repo_name: zzpwahaha/VimbaCamJILA


text:
#pragma once

#include <bgfx/bgfx.h>
#include <napi/napi.h>
#include <gsl/gsl>

namespace Babylon
{
    class VertexBuffer final
    {
    public:
        VertexBuffer(gsl::span<uint8_t> bytes, bool dynamic);
        ~VertexBuffer();

        void Dispose();

        void Update(Napi::Env env, gsl::span<uint8_t> bytes);
        void CreateHandle(const bgfx::VertexLayout& layout);
        void PromoteToFloats(bgfx::AttribType::Enum attribType, uint32_t numElements, uint32_t byteOffset, uint32_t byteStride);
        void Set(bgfx::Encoder* encoder, uint8_t stream, uint32_t startVertex, uint32_t numVertices, bgfx::VertexLayoutHandle layoutHandle);

    private:
        std::vector<uint8_t> m_bytes{};
        bool m_dynamic{};

        union
        {
            bgfx::VertexBufferHandle m_handle{bgfx::kInvalidHandle};
            bgfx::DynamicVertexBufferHandle m_dynamicHandle;
        };

        bool m_disposed{};
    };
}

max_stars_repo_name: darraghjburke/BabylonNative

max_issues_repo_name: darraghjburke/BabylonNative

max_forks_repo_name: darraghjburke/BabylonNative


text:
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <cconfigspace.h>
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_cdf.h>

#define NUM_DISTRIBS 2
#define NUM_SAMPLES 10000

void test_create_mixture_distribution() {
	ccs_distribution_t      distrib = NULL, distribs[NUM_DISTRIBS], distribs_ret[NUM_DISTRIBS];
	ccs_result_t            err = CCS_SUCCESS;
	int32_t                 refcount;
	ccs_object_type_t       otype;
	ccs_distribution_type_t dtype;
	ccs_numeric_type_t      data_type;
	ccs_interval_t          interval;
	const size_t            num_distribs = NUM_DISTRIBS;
	ccs_float_t             weights[NUM_DISTRIBS];
	size_t                  num_distribs_ret;
	ccs_float_t             weights_ret[NUM_DISTRIBS];
	const ccs_float_t       epsilon = 1e-15;

	for(size_t i = 0; i < num_distribs; i++) {
		weights[i] = (double)(i+1);
	}

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(-10.0),
		CCSF(0.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(0.0),
		CCSF(10.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs + 1);
	assert( err == CCS_SUCCESS );

	err = ccs_create_mixture_distribution(
		num_distribs,
		distribs,
		weights,
		&distrib);
	assert( err == CCS_SUCCESS );

	err = ccs_object_get_type(distrib, &otype);
	assert( err == CCS_SUCCESS );
	assert( otype == CCS_DISTRIBUTION );

	err = ccs_distribution_get_type(distrib, &dtype);
	assert( err == CCS_SUCCESS );
	assert( dtype == CCS_MIXTURE );

	err = ccs_distribution_get_data_types(distrib, &data_type);
	assert( err == CCS_SUCCESS );
	assert( data_type == CCS_NUM_FLOAT );

        err = ccs_distribution_get_bounds(distrib, &interval);
	assert( err == CCS_SUCCESS );
	assert( interval.type == CCS_NUM_FLOAT );
	assert( interval.lower.f == -10.0 );
	assert( interval.lower_included == CCS_TRUE );
	assert( interval.upper.f == 10.0 );
	assert( interval.upper_included == CCS_FALSE );

	err = ccs_mixture_distribution_get_num_distributions(distrib, &num_distribs_ret);
	assert( err == CCS_SUCCESS );
	assert( num_distribs_ret == num_distribs );

	err = ccs_mixture_distribution_get_distributions(distrib, num_distribs, distribs_ret, &num_distribs_ret);
	assert( err == CCS_SUCCESS );
	assert( num_distribs_ret == num_distribs );
	for (size_t i = 0; i < num_distribs; i++)
		assert( distribs_ret[i] == distribs[i] );

	err = ccs_mixture_distribution_get_weights(distrib, num_distribs, weights_ret, &num_distribs_ret);
	assert( err == CCS_SUCCESS );
	assert( num_distribs_ret == num_distribs );

	ccs_float_t inv_sum = 2.0 / (num_distribs * (num_distribs + 1));
	for (size_t i = 0; i < num_distribs; i++)
		assert( weights_ret[i] <= weights[i] * inv_sum + epsilon &&
		        weights_ret[i] >= weights[i] * inv_sum - epsilon );

	err = ccs_object_get_refcount(distrib, &refcount);
	assert( err == CCS_SUCCESS );
	assert( refcount == 1 );

	for (size_t i = 0; i < num_distribs; i++) {
		err = ccs_release_object(distribs[i]);
		assert( err == CCS_SUCCESS );
	}
	err = ccs_release_object(distrib);
	assert( err == CCS_SUCCESS );
}

void test_mixture_distribution() {
	ccs_distribution_t distrib = NULL, distribs[NUM_DISTRIBS];
	ccs_rng_t          rng = NULL;
	ccs_result_t       err = CCS_SUCCESS;
	const size_t       num_distribs = NUM_DISTRIBS;
	ccs_float_t        weights[NUM_DISTRIBS];
	const size_t       num_samples = NUM_SAMPLES;
	ccs_numeric_t      samples[NUM_SAMPLES];

	for(size_t i = 0; i < num_distribs; i++) {
		weights[i] = 1.0;
	}

	err = ccs_rng_create(&rng);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(-9.0),
		CCSF(1.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(1.0),
		CCSF(11.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs + 1);
	assert( err == CCS_SUCCESS );

	err = ccs_create_mixture_distribution(
		num_distribs,
		distribs,
		weights,
		&distrib);
	assert( err == CCS_SUCCESS );

	err = ccs_distribution_samples(distrib, rng, num_samples, samples);
	assert( err == CCS_SUCCESS );

	double mean = gsl_stats_mean((double*)samples, 1, num_samples);
	assert( mean < 1.0 + 0.1 );
	assert( mean > 1.0 - 0.1 );

	for (size_t i = 0; i < num_distribs; i++) {
		err = ccs_release_object(distribs[i]);
		assert( err == CCS_SUCCESS );
	}
	err = ccs_release_object(distrib);
	assert( err == CCS_SUCCESS );
	err = ccs_release_object(rng);
	assert( err == CCS_SUCCESS );
}

void test_mixture_distribution_strided_samples() {
	ccs_distribution_t t_distrib = NULL, distrib = NULL, distribs[NUM_DISTRIBS];
	ccs_distribution_t t_distribs[NUM_DISTRIBS];
	ccs_rng_t          rng = NULL;
	ccs_result_t       err = CCS_SUCCESS;
	const size_t       num_t_distribs = NUM_DISTRIBS;
	const size_t       num_distribs = NUM_DISTRIBS;
	const size_t       num_samples = NUM_SAMPLES;
	ccs_numeric_t      samples[NUM_SAMPLES*(NUM_DISTRIBS+1)];
	ccs_float_t        weights[] = { 1.0, 1.0 };

	err = ccs_rng_create(&rng);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(-5.0),
		CCSF(5.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_INTEGER,
		CCSI(-5),
		CCSI(5),
		CCS_LINEAR,
		CCSI(0),
		distribs + 1);
	assert( err == CCS_SUCCESS );

	err = ccs_create_multivariate_distribution(
		num_distribs,
		distribs,
		&distrib);
	assert( err == CCS_SUCCESS );

	t_distribs[0] = distrib;
	t_distribs[1] = distrib;
	err = ccs_create_mixture_distribution(
		num_t_distribs,
		t_distribs,
		weights,
		&t_distrib);
	assert( err == CCS_SUCCESS );

	err = ccs_distribution_strided_samples(distrib, rng, num_samples, NUM_DISTRIBS + 1, samples);
	assert( err == CCS_SUCCESS );

	for (size_t i = 0; i < num_samples; i++) {
		assert( samples[(NUM_DISTRIBS + 1)*i].f >= -5.0 );
		assert( samples[(NUM_DISTRIBS + 1)*i].f <   5.0 );
		assert( samples[(NUM_DISTRIBS + 1)*i + 1].i >= -5 );
		assert( samples[(NUM_DISTRIBS + 1)*i + 1].i <   5 );
	}
	double mean = gsl_stats_mean((double*)samples, NUM_DISTRIBS + 1, num_samples);
	assert( mean < 0.0 + 0.1 );
	assert( mean > 0.0 - 0.1 );

	for (size_t i = 0; i < num_distribs; i++) {
		err = ccs_release_object(distribs[i]);
		assert( err == CCS_SUCCESS );
	}
	err = ccs_release_object(t_distrib);
	assert( err == CCS_SUCCESS );
	err = ccs_release_object(distrib);
	assert( err == CCS_SUCCESS );
	err = ccs_release_object(rng);
	assert( err == CCS_SUCCESS );
}

void test_mixture_distribution_soa_samples() {
	ccs_distribution_t t_distrib = NULL, distrib = NULL, distribs[NUM_DISTRIBS];
	ccs_distribution_t t_distribs[NUM_DISTRIBS];
	ccs_rng_t          rng = NULL;
	ccs_result_t       err = CCS_SUCCESS;
	const size_t       num_t_distribs = NUM_DISTRIBS;
	const size_t       num_distribs = NUM_DISTRIBS;
	const size_t       num_samples = NUM_SAMPLES;
	ccs_numeric_t      samples1[NUM_SAMPLES];
	ccs_numeric_t      samples2[NUM_SAMPLES];
	ccs_numeric_t     *samples[] = { samples1, samples2 };
	ccs_float_t        weights[] = { 1.0, 1.0 };

	err = ccs_rng_create(&rng);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_FLOAT,
		CCSF(-5.0),
		CCSF(5.0),
		CCS_LINEAR,
		CCSF(0.0),
		distribs);
	assert( err == CCS_SUCCESS );

	err = ccs_create_uniform_distribution(
		CCS_NUM_INTEGER,
		CCSI(-5),
		CCSI(5),
		CCS_LINEAR,
		CCSI(0),
		distribs + 1);
	assert( err == CCS_SUCCESS );

	err = ccs_create_multivariate_distribution(
		num_distribs,
		distribs,
		&distrib);
	assert( err == CCS_SUCCESS );

	t_distribs[0] = distrib;
	t_distribs[1] = distrib;
	err = ccs_create_mixture_distribution(
		num_t_distribs,
		t_distribs,
		weights,
		&t_distrib);
	assert( err == CCS_SUCCESS );

	err = ccs_distribution_soa_samples(distrib, rng, num_samples, samples);
	assert( err == CCS_SUCCESS );

	for (size_t i = 0; i < num_samples; i++) {
		assert( samples1[i].f >= -5.0 );
		assert( samples1[i].f <   5.0 );
		assert( samples2[i].i >= -5 );
		assert( samples2[i].i <   5 );
	}
	double mean = gsl_stats_mean((double*)samples1, 1, num_samples);
	assert( mean < 0.0 + 0.1 );
	assert( mean > 0.0 - 0.1 );

	for (size_t i = 0; i < num_distribs; i++) {
		err = ccs_release_object(distribs[i]);
		assert( err == CCS_SUCCESS );
	}
	err = ccs_release_object(t_distrib);
	assert( err == CCS_SUCCESS );
	err = ccs_release_object(distrib);
	assert( err == CCS_SUCCESS );
	err = ccs_release_object(rng);
	assert( err == CCS_SUCCESS );
}

int main() {
	ccs_init();
	test_create_mixture_distribution();
	test_mixture_distribution();
	test_mixture_distribution_strided_samples();
	test_mixture_distribution_soa_samples();
	ccs_fini();
	return 0;
}

ext: c

max_stars_repo_name: deephyper/CCS

max_issues_repo_name: deephyper/CCS

max_forks_repo_name: deephyper/CCS


text:
#pragma once

#include <functional>
#include "ProgressBar.h"
#include <gsl_util.h>

template<typename TCollection>
void runParallel(
	std::function<void(typename TCollection::reference)> processElement,
	TCollection& collection,
	int maxThreadCount)
{
	if (maxThreadCount < 1) {
		throw std::invalid_argument(fmt::format("maxThreadCount cannot be {}.", maxThreadCount));
	}

	if (maxThreadCount == 1) {
		// Process synchronously
		for (auto& element : collection) {
			processElement(element);
		}
		return;
	}

	using future_type = std::future<void>;

	std::mutex mutex;
	int currentThreadCount = 0;
	std::condition_variable elementFinished;
	future_type finishedElement;

	// Before exiting, wait for all running tasks to finish, but don't re-throw exceptions.
	// This only applies if one task already failed with an exception.
	auto finishRunning = gsl::finally([&]{
		std::unique_lock<std::mutex> lock(mutex);
		elementFinished.wait(lock, [&] { return currentThreadCount == 0; });
	});

	// Asyncronously run all elements
	for (auto it = collection.begin(); it != collection.end(); ++it) {
		// This variable will later hold the future, but can be value-captured right now
		auto future = std::make_shared<future_type>();

		// Notifies that an element is done processing
		auto notifyElementDone = [&, future] {
			std::lock_guard<std::mutex> lock(mutex);
			finishedElement = std::move(*future);
			--currentThreadCount;
			elementFinished.notify_one();
		};

		// Processes the current element, then notifies
		auto wrapperFunction = [processElement, &element = *it, notifyElementDone]() {
			auto done = gsl::finally(notifyElementDone);
			processElement(element);
		};

		// Asynchronously process element
		{
			std::lock_guard<std::mutex> lock(mutex);
			*future = std::async(std::launch::async, wrapperFunction);
			++currentThreadCount;
		}

		// Wait for threads to finish, if necessary
		{
			std::unique_lock<std::mutex> lock(mutex);
			int targetThreadCount = it == collection.end() ? 0 : maxThreadCount - 1;
			while (currentThreadCount > targetThreadCount) {
				elementFinished.wait(lock);
				if (finishedElement.valid()) {
					// Re-throw any exception
					finishedElement.get();
					finishedElement = future_type();
				}
			}
		}
	}

}

template<typename TCollection>
void runParallel(
	std::function<void(typename TCollection::reference, ProgressSink&)> processElement,
	TCollection& collection,
	int maxThreadCount,
	ProgressSink& progressSink,
	std::function<double(const typename TCollection::reference)> getElementProgressWeight = [](typename TCollection::reference) { return 1.0; })
{
	// Create a collection of wrapper functions that take care of progress handling
	ProgressMerger progressMerger(progressSink);
	std::vector<std::function<void()>> functions;
	for (auto& element : collection) {
		auto& elementProgressSink = progressMerger.addSink(getElementProgressWeight(element));
		functions.push_back([&]() { processElement(element, elementProgressSink); });
	}

	// Run wrapper function
	runParallel([&](std::function<void()> function) { function(); }, functions, maxThreadCount);
}

inline int getProcessorCoreCount() {
	int coreCount = std::thread::hardware_concurrency();

	// If the number of cores cannot be determined, use a reasonable default
	return coreCount != 0 ? coreCount : 4;
}

max_stars_repo_name: meshonline/rhubarb-lip-sync

max_issues_repo_name: meshonline/rhubarb-lip-sync

max_forks_repo_name: meshonline/rhubarb-lip-sync


text:
/* movstat/alloc.c
 *
 * Copyright (C) 2018 Patrick Alken
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <config.h>
#include <stdlib.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_movstat.h>

/*
gsl_movstat_alloc()
  Allocate a workspace for moving window statistics.
The window around sample x_i is defined as:

W_i^{H,J} = {x_{i-H},...,x_i,...x_{i+J}}

The total window size is:

K = H + J + 1

Inputs: K - total samples in window (H = J = K / 2)

Return: pointer to workspace

Notes:
1) If K is even, it is rounded up to the next odd
*/

gsl_movstat_workspace *
gsl_movstat_alloc(const size_t K)
{
  const size_t H = K / 2;
  return gsl_movstat_alloc_with_size(0, H, H);
}

/*
gsl_movstat_alloc2()
  Allocate a workspace for moving window statistics.
The window around sample x_i is defined as:

W_i^{H,J} = {x_{i-H},...,x_i,...x_{i+J}}

The total window size is:

K = H + J + 1

Inputs: H - number of samples before current sample
        J - number of samples after current sample

Return: pointer to workspace
*/

gsl_movstat_workspace *
gsl_movstat_alloc2(const size_t H, const size_t J)
{
  return gsl_movstat_alloc_with_size(0, H, J);
}

/*
gsl_movstat_alloc_with_size()
  Allocate a workspace for moving window statistics with predefined workspace
size for accumulators. The window around sample x_i is defined as:

W_i^{H,J} = {x_{i-H},...,x_i,...x_{i+J}}

The total window size is:

K = H + J + 1

Inputs: accum_state_size - state size for accumulator (set to zero to use default value)
        H                - number of samples before current sample
        J                - number of samples after current sample

Return: pointer to workspace
*/

gsl_movstat_workspace *
gsl_movstat_alloc_with_size(const size_t accum_state_size, const size_t H, const size_t J)
{
  gsl_movstat_workspace *w;
  size_t state_size = accum_state_size;

  w = calloc(1, sizeof(gsl_movstat_workspace));
  if (w == 0)
    {
      GSL_ERROR_NULL ("failed to allocate space for workspace", GSL_ENOMEM);
    }

  w->H = H;
  w->J = J;
  w->K = H + J + 1;

  if (state_size == 0)
    {
      /*
       * determine maximum number of bytes needed for the various accumulators;
       * the accumulators will all share the same workspace
       */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_mad->size)(w->K));    /* MAD accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_mean->size)(w->K));   /* mean/variance/sd accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_min->size)(w->K));    /* min/max accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_sum->size)(w->K));    /* sum accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_median->size)(w->K)); /* median accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_Qn->size)(w->K));     /* Q_n accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_qqr->size)(w->K));    /* QQR accumulator */
      state_size = GSL_MAX(state_size, (gsl_movstat_accum_Sn->size)(w->K));     /* S_n accumulator */
    }

  w->state = malloc(state_size);
  if (w->state == 0)
    {
      gsl_movstat_free(w);
      GSL_ERROR_NULL ("failed to allocate space for accumulator state", GSL_ENOMEM);
    }

  w->work = malloc(w->K * sizeof(double));
  if (w->work == 0)
    {
      gsl_movstat_free(w);
      GSL_ERROR_NULL ("failed to allocate space for work", GSL_ENOMEM);
    }

  w->state_size = state_size;

  return w;
}

void
gsl_movstat_free(gsl_movstat_workspace * w)
{
  if (w->work)
    free(w->work);

  if (w->state)
    free(w->state);

  free(w);
}

max_stars_repo_name: ielomariala/Hex-Game

max_issues_repo_name: ielomariala/Hex-Game

max_forks_repo_name: karanbirsandhu/nu-sense


text:
#include <php.h>
#include <Zend/zend_interfaces.h>
#include <Zend/zend_exceptions.h>
#include <ext/spl/spl_iterators.h>
#include <ext/spl/spl_exceptions.h>
#if _MSC_VER
#include <complex.h>
#define lapack_complex_float _Fcomplex
#define lapack_complex_double _Dcomplex
#endif
#include <lapacke.h>
#include <Interop/Polite/Math/Matrix.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php_rindow_openblas.h"

#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif

static zend_object_handlers rindow_openblas_lapack_object_handlers;

// destractor
static void php_rindow_openblas_lapack_free_object(zend_object* object)
{
    zend_object_std_dtor(object);
}

// constructor
static zend_object* php_rindow_openblas_lapack_create_object(zend_class_entry* class_type) /* {{{ */
{
    zend_object* intern = NULL;

    intern = (zend_object*)ecalloc(1, sizeof(zend_object) + zend_object_properties_size(class_type));

    zend_object_std_init(intern, class_type);
    object_properties_init(intern, class_type);

    intern->handlers = &rindow_openblas_lapack_object_handlers;

    return intern;
} /* }}} */

/* Method Rindow\OpenBLAS\Lapack::
    public function gesvd(
        int $matrix_layout,
        string $jobu,
        string $jobvt,
        int $m,
        int $n,
        Buffer $A,  int $offsetA,  int $ldA,
        Buffer $S,  int $offsetS,
        Buffer $U,  int $offsetU,  int $ldU,
        Buffer $VT, int $offsetVT, int $ldVT,
        Buffer $SuperB,  int $offsetSuperB
     ) : void
 {{{ */
static PHP_METHOD(Lapack, gesvd)
{
/*
lapack_int LAPACKE_dgesvd( int matrix_layout, char jobu, char jobvt,
                           lapack_int m, lapack_int n, double* a,
                           lapack_int lda, double* s, double* u, lapack_int ldu,
                           double* vt, lapack_int ldvt, double* superb );
*/
    php_interop_polite_math_matrix_linear_buffer_t* bufferA;
    php_interop_polite_math_matrix_linear_buffer_t* bufferS;
    php_interop_polite_math_matrix_linear_buffer_t* bufferU;
    php_interop_polite_math_matrix_linear_buffer_t* bufferVT;
    php_interop_polite_math_matrix_linear_buffer_t* bufferSuperB;
    zend_long matrix_layout;
    zend_long jobu;
    zend_long jobvt;
    zend_long m;
    zend_long n;
    zval* objA=NULL;
    zend_long offsetA;
    zend_long ldA;
    zval* objS=NULL;
    zend_long offsetS;
    zval* objU=NULL;
    zend_long offsetU;
    zend_long ldU;
    zval* objVT=NULL;
    zend_long offsetVT;
    zend_long ldVT;
    zval* objSuperB=NULL;
    zend_long offsetSuperB;
    int info;

    ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 18, 18)
        Z_PARAM_LONG(matrix_layout)
        Z_PARAM_LONG(jobu)
        Z_PARAM_LONG(jobvt)
        Z_PARAM_LONG(m)
        Z_PARAM_LONG(n)

        Z_PARAM_OBJECT(objA) // Interop\Polite\Math\Matrix\LinearBuffer
        Z_PARAM_LONG(offsetA)
        Z_PARAM_LONG(ldA)
        Z_PARAM_OBJECT(objS) // Interop\Polite\Math\Matrix\LinearBuffer
        Z_PARAM_LONG(offsetS)

        Z_PARAM_OBJECT(objU) // Interop\Polite\Math\Matrix\LinearBuffer
        Z_PARAM_LONG(offsetU)
        Z_PARAM_LONG(ldU)
        Z_PARAM_OBJECT(objVT) // Interop\Polite\Math\Matrix\LinearBuffer
        Z_PARAM_LONG(offsetVT)

        Z_PARAM_LONG(ldVT)
        Z_PARAM_OBJECT(objSuperB) // Interop\Polite\Math\Matrix\LinearBuffer
        Z_PARAM_LONG(offsetSuperB)
    ZEND_PARSE_PARAMETERS_END();

    if(php_rindow_openblas_assert_shape_parameter(
        PHP_RINDOW_OPENBLAS_ASSERT_M, m)) {
        return;
    }
    if(php_rindow_openblas_assert_shape_parameter(
        PHP_RINDOW_OPENBLAS_ASSERT_N, n)) {
        return;
    }
    if( offsetS < 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "offsetS must be greater than zero or equal", 0);
        return;
    }
    if( offsetU < 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "offsetU must be greater than zero or equal", 0);
        return;
    }
    if( ldU <= 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "ldU must be greater than zero", 0);
        return;
    }
    if( offsetVT < 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "offsetVT must be greater than zero or equal", 0);
        return;
    }
    if( ldVT <= 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "ldVT must be greater than zero", 0);
        return;
    }
    if( offsetSuperB < 0 ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "offsetVT must be greater than zero or equal", 0);
        return;
    }
    // Check Buffer A
    bufferA = Z_INTEROP_POLITE_MATH_MATRIX_LINEAR_BUFFER_OBJ_P(objA);
    if(php_rindow_openblas_assert_buffer_type(bufferA,"a")) {
        return;
    }
    if(php_rindow_openblas_assert_matrix_buffer_spec(
        PHP_RINDOW_OPENBLAS_ASSERT_A, bufferA,m,n,offsetA,ldA)) {
        return;
    }

    // Check Buffer S
    bufferS = Z_INTEROP_POLITE_MATH_MATRIX_LINEAR_BUFFER_OBJ_P(objS);
    if(php_rindow_openblas_assert_buffer_type(bufferS,"s")) {
        return;
    }
    if( offsetS+MIN(m,n) > bufferS->size) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "BufferS size is too small", 0);
        return;
    }

    // Check Buffer U
    bufferU = Z_INTEROP_POLITE_MATH_MATRIX_LINEAR_BUFFER_OBJ_P(objU);
    if(php_rindow_openblas_assert_buffer_type(bufferU,"u")) {
        return;
    }
    if( offsetU+m*ldU > bufferU->size) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "BufferU size is too small", 0);
        return;
    }

    // Check Buffer VT
    bufferVT = Z_INTEROP_POLITE_MATH_MATRIX_LINEAR_BUFFER_OBJ_P(objVT);
    if(php_rindow_openblas_assert_buffer_type(bufferVT,"vt")) {
        return;
    }
    if( offsetVT+ldVT*n > bufferVT->size) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "BufferVT size is too small", 0);
        return;
    }

    // Check Buffer SuperB
    bufferSuperB = Z_INTEROP_POLITE_MATH_MATRIX_LINEAR_BUFFER_OBJ_P(objSuperB);
    if(php_rindow_openblas_assert_buffer_type(bufferSuperB,"b")) {
        return;
    }
    if( offsetSuperB+MIN(m,n)-1 > bufferSuperB->size) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "bufferSuperB size is too small", 0);
        return;
    }

    // Check Buffer A and B and C
    if(bufferA->dtype!=bufferS->dtype ||
       bufferA->dtype!=bufferU->dtype ||
       bufferA->dtype!=bufferVT->dtype ||
       bufferA->dtype!=bufferSuperB->dtype
    ) {
        zend_throw_exception(spl_ce_InvalidArgumentException, "Unmatch data type", 0);
        return;
    }

    switch (bufferA->dtype) {
        case php_interop_polite_math_matrix_dtype_float32:
            info = LAPACKE_sgesvd(
                (int)matrix_layout,
                (char)jobu,
                (char)jobvt,
                (lapack_int)m,(lapack_int)n,
                &(((float *)bufferA->data)[offsetA]), (lapack_int)ldA,
                &(((float *)bufferS->data)[offsetS]),
                &(((float *)bufferU->data)[offsetU]), (lapack_int)ldU,
                &(((float *)bufferVT->data)[offsetVT]), (lapack_int)ldVT,
                &(((float *)bufferSuperB->data)[offsetSuperB])
            );
            break;
        case php_interop_polite_math_matrix_dtype_float64:
            info = LAPACKE_dgesvd(
                (int)matrix_layout,
                (char)jobu,
                (char)jobvt,
                (lapack_int)m,(lapack_int)n,
                &(((double *)bufferA->data)[offsetA]), (lapack_int)ldA,
                &(((double *)bufferS->data)[offsetS]),
                &(((double *)bufferU->data)[offsetU]), (lapack_int)ldU,
                &(((double *)bufferVT->data)[offsetVT]), (lapack_int)ldVT,
                &(((double *)bufferSuperB->data)[offsetSuperB])
            );
            break;
        default:
            zend_throw_exception(spl_ce_RuntimeException, "Unsupported data type.", 0);
            return;
    }
    if( info == LAPACK_WORK_MEMORY_ERROR ) {
        zend_throw_exception(spl_ce_RuntimeException, "Not enough memory to allocate work array.", info);
        return;
    } else if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
        zend_throw_exception(spl_ce_RuntimeException, "Not enough memory to transpose matrix.", info);
        return;
    } else if( info < 0 ) {
        zend_throw_exception(spl_ce_RuntimeException, "Wrong parameter.", info);
        return;
    }
}
/* }}} */

ZEND_BEGIN_ARG_INFO_EX(ai_Lapack_gesvd, 0, 0, 18)
    ZEND_ARG_INFO(0, matrix_layout)
    ZEND_ARG_INFO(0, jobu)
    ZEND_ARG_INFO(0, jobvt)
    ZEND_ARG_INFO(0, m)
    ZEND_ARG_INFO(0, n)

    ZEND_ARG_OBJ_INFO(0, objA, Interop\\Polite\\Math\\Matrix\\LinearBuffer, 0)
    ZEND_ARG_INFO(0, offsetA)
    ZEND_ARG_INFO(0, ldA)
    ZEND_ARG_OBJ_INFO(0, objS, Interop\\Polite\\Math\\Matrix\\LinearBuffer, 0)
    ZEND_ARG_INFO(0, offsetS)

    ZEND_ARG_OBJ_INFO(0, objU, Interop\\Polite\\Math\\Matrix\\LinearBuffer, 0)
    ZEND_ARG_INFO(0, offsetU)
    ZEND_ARG_INFO(0, ldU)
    ZEND_ARG_OBJ_INFO(0, objVT, Interop\\Polite\\Math\\Matrix\\LinearBuffer, 0)
    ZEND_ARG_INFO(0, offsetVT)

    ZEND_ARG_INFO(0, ldVT)
    ZEND_ARG_OBJ_INFO(0, objSuperB, Interop\\Polite\\Math\\Matrix\\LinearBuffer, 0)
    ZEND_ARG_INFO(0, offsetSuperB)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_Lapack_void, 0, 0, 0)
ZEND_END_ARG_INFO()

/* {{{ Rindow\OpenBLAS\Lapack function entries */
static zend_function_entry php_rindow_openblas_lapack_me[] = {
    /* clang-format off */
    PHP_ME(Lapack, gesvd,  ai_Lapack_gesvd,  ZEND_ACC_PUBLIC)
    PHP_FE_END
    /* clang-format on */
};
/* }}} */

/* Class Rindow\OpenBLAS\Lapack {{{ */
static zend_class_entry* rindow_openblas_lapack_ce;

void php_rindow_openblas_lapack_init_ce(INIT_FUNC_ARGS)
{
    zend_class_entry ce;

    INIT_NS_CLASS_ENTRY(ce, "Rindow\\OpenBLAS", "Lapack", php_rindow_openblas_lapack_me);
    rindow_openblas_lapack_ce = zend_register_internal_class(&ce);
    rindow_openblas_lapack_ce->create_object = php_rindow_openblas_lapack_create_object;

    memcpy(&rindow_openblas_lapack_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
    rindow_openblas_lapack_object_handlers.offset    = 0;
    rindow_openblas_lapack_object_handlers.free_obj  = php_rindow_openblas_lapack_free_object;
    rindow_openblas_lapack_object_handlers.clone_obj = NULL;

    //zend_class_implements(rindow_openblas_lapack_ce, 2, spl_ce_ArrayAccess, spl_ce_Countable);
}
/* }}} */

max_stars_repo_name: yuichiis/rindow-openblas

max_issues_repo_name: yuichiis/rindow-openblas

max_forks_repo_name: yuichiis/rindow-openblas


text:
// Rob Farber
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <nlopt.h>

#include "myFunc.h"

void writeParam(char *filename, int nParam, double *x)
{
  FILE *fn=fopen(filename,"w");
  if(!fn) {
    fprintf(stderr,"Cannot open %s\n",filename);
    exit(1);
  }

  uint32_t n=nParam; // ensure size is uint32_t
  fwrite(&n,sizeof(uint32_t), 1, fn);
  for(int i=0; i < nParam; i++) {
    float tmp=x[i];
    fwrite(&tmp,sizeof(float), 1, fn);
  }
  fclose(fn);
}
int main(int argc, char* argv[])
{
  double begintime = getTime();

  nlopt_opt opt;
  userData_t uData = {0};

  memset(&uData, 0, sizeof(userData_t));

  if(argc < 3) {
    fprintf(stderr,"Use: datafile paramFile\n");
    return -1;
  }
  init(argv[1],&uData);
  printf("myFunc %s\n", desc);
  printf("nExamples %d\n", uData.nExamples);
  printf("Number Parameters %d\n", N_PARAM);

  double endtime = getTime();

  printf(" memset and read file cost time: %g\n", endtime-begintime);

  begintime = getTime();

  opt = nlopt_create(NLOPT_LN_PRAXIS, N_PARAM); // algorithm and dimensionality
  // NOTE: alternative optimization methods ...
  //opt = nlopt_create(NLOPT_LN_NEWUOA, N_PARAM);
  //opt = nlopt_create(NLOPT_LN_COBYLA, N_PARAM);
  //opt = nlopt_create(NLOPT_LN_BOBYQA, N_PARAM);
  //opt = nlopt_create(NLOPT_LN_AUGLAG, N_PARAM);

  nlopt_set_min_objective(opt, objFunc, (void*) &uData);
/*
#if defined(MAX_RUNTIME)
  fprintf(stderr,"Warning: performing a quick %d second test!\n", MAX_RUNTIME);
  nlopt_set_maxtime(opt, MAX_RUNTIME); // Use for running quick tests
#else
  fprintf(stderr,"MAX runtime %d seconds!\n", 120*60);
  nlopt_set_maxtime(opt, (120. * 60.)); // maximum runtime in seconds
#endif
*/
  double minf; /* the minimum objective value, upon return */

  __declspec(align(64)) double x[N_PARAM];
  for(int i=0; i < N_PARAM; i++) x[i] = 0.1*(rand()/(double)RAND_MAX);

  endtime= getTime();

  printf(" serial part costs time : %g \n ", endtime-begintime);

  begintime = getTime();

  int nExamples=uData.nExamples*EXAMPLE_SIZE;
  float* example=uData.example;
  float* param=uData.param;
  {
    double startTime=getTime();
    int ret=nlopt_optimize(opt, x, &minf);
    printf("Optimization Time %g\n",getTime()-startTime);

    if (ret < 0) {
      printf("nlopt failed! ret %d\n", ret);
    } else {
      printf("found minimum %0.10g ret %d\n", minf,ret);
    }
  }

  endtime= getTime();

  printf(" parallel part costs time: %g \n", endtime-begintime);

  writeParam(argv[2],N_PARAM, x);
  fini(&uData);
  nlopt_destroy(opt);

  return 0;
}

max_stars_repo_name: puckbee/PhiBench

max_issues_repo_name: puckbee/PhiBench

max_forks_repo_name: puckbee/PhiBench