Error: a brace-enclosed initializer is not allowed here before

Fermé
aycha mabrouk Messages postés 7 Date d'inscription jeudi 10 octobre 2013 Statut Membre Dernière intervention 25 avril 2018 - Modifié le 1 nov. 2017 à 23:19
Dalfab Messages postés 706 Date d'inscription dimanche 7 février 2016 Statut Membre Dernière intervention 2 novembre 2023 - 6 nov. 2017 à 18:17
Bonjour,
Salut ,j'écris une structure de données qui contient 11 paramètres en c++ ;lors de compilation du code sur vivado HLS j'ai quelque erreur:aidez-moi à corriger.merci

../../../../main.cpp:181:28: error: a brace-enclosed initializer is not allowed here before '{' token
../../../../main.cpp:181:65: error: ISO C++ forbids initialization of member 'parameters' [-fpermissive]
../../../../main.cpp:181:65: error: making 'parameters' static [-fpermissive]
../../../../main.cpp:181:65: error: invalid in-class initialization of static data member of non-integral type 'double [5][1]'

struct model
 {
  double parameters[5][1] ={{1},{1},{1},{10},{0.150000000000000}};

  double *nr_class[1][1]={ { new double(3) } }; /* number of classes, = 2 in regression/one class svm */
  double *totalSV[1][1]= { { new double(38) } };   /* total #SV */
  //double svm_node **SV=SVs=
              double *rho[3][1]= {{3.85250072056665},{1.98260813354295},{-9.85381777928213}};


           double *label[3][1]= {{1},{2},{3}}; /* label of each class (label[k]) */
        double *sv_indices[38][1]= {{1},{3],{11},{18},{20},{22},{25},{26},{29},{30},{42},{43},{45},{49},{50},{51},{55},{56},{60},{63},{65},{69},{70},{71},{72},{73},{75},{82},{83},{90},{94},{98},{102},{104},{107},{110},{113},{119}};       /* sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set */


        double *probA[3][1]= {{-3.04020468884611},{-3.02985537320699},{-1.22838128162279}};  /* pariwise probability information */
        double *probB[3][1]= {{-0.143832034298135},{-0.331592706939798},{-0.317353460209991}};
               double *sv_coef [38][2]= {
     {0.0441014900184046,0},
     {0.115481676752995,0.0247201450973238},
     {0.0284525394158882,0},
     {0.115481676752995,0.0247201450973238},
     {0.115481676752995,0.0247201450973238},
     {0.115481676752995,0.0247201450973238},
     {0.0429276473187021,0.0247201450973238},
     {0.115481676752995,0.0247201450973238},
     {0.115481676752995,0.0247201450973238},
     {0.115481676752995,0.0247201450973238},
     {0,2.56566567302770},
     {-0.115481676752995,0},
     {-0.115481676752995,0},
     {-0.115481676752995,0},
     {-0.115481676752995,0},
     {0,2.56566567302770},
     {0,1.19304447300938},
     {-0.115481676752995,0},
     {0,1.37262120001832},
     {0,2.56566567302770}
     {0,2.56566567302770},
     {-0.115481676752995,0},
     {0,2.56566567302770},
     {0,2.56566567302770},
     {0,2.56566567302770},
     {-0.115481676752995,0},
     {-0.115481676752995,0},
     {-0.0247201450973238,-2.56566567302770},
     {-0.0247201450973238,-0.665006705657444},
     {-0.0247201450973238,-2.56566567302770},
     {0,-1.82845371567548},
     {-0.0247201450973238,-2.56566567302770},
     {0,-2.56566567302770},
     {-0.0247201450973238,-2.56566567302770},
     {-0.0247201450973238,-0.106867010440775},
     {0,-1.24158009628657},
     {-0.0247201450973238,-2.56566567302770},
     {-0.0247201450973238,-1.28942381799513}}; /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */

    /* constants in decision functions (rho[k*(k-1)/2]) */
  /* for classification only */

  //double *label= [1;2;3]; /* label of each class (label[k]) */
  double *nSV[3][1] ={{10},{17},{11}}; /* number of SVs for each class (nSV[k]) */
     /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
     double *SVs[38][14]={
  {-0.579400000000000,-0.924500000000000,-0.878900000000000,-0.907400000000000,-0.902800000000000,-0.979600000000000,-0.977000000000000,-0.918200000000000,-0.904600000000000,-0.965100000000000,-0.972900000000000,-0.941700000000000,-0.961900000000000,-0.936700000000000},
 {-0.422700000000000,-0.443500000000000,-0.809000000000000,-0.880800000000000,-0.879800000000000,-0.924100000000000,-0.930800000000000,-0.978100000000000,-0.949100000000000,-0.970100000000000,-0.990400000000000,-0.975300000000000,-0.981400000000000,-0.953000000000000},
 {-0.604400000000000,-0.850700000000000,-0.851100000000000,-0.788000000000000,-0.885200000000000,-0.825500000000000,-0.921000000000000,-0.933900000000000,-0.966800000000000,-0.917600000000000,-0.965200000000000,-0.930500000000000,-0.948600000000000,-0.938700000000000},
 {-0.624000000000000,-0.648500000000000,-0.985600000000000,-0.876800000000000,-0.893100000000000,-0.938300000000000,-0.919000000000000,-0.885100000000000,-0.948400000000000,-0.899200000000000,-0.970700000000000,-0.911300000000000,-0.970000000000000,-0.944600000000000},
 {-0.373800000000000,-0.520300000000000,-0.703800000000000,-0.811600000000000,-0.843900000000000,-0.867900000000000,-0.861400000000000,-0.921700000000000,-0.848200000000000,-0.952100000000000,-0.933600000000000,-0.956300000000000,-0.972600000000000,-0.953500000000000},
 {-0.592300000000000,-0.691900000000000,-0.768000000000000,-0.894100000000000,-0.934600000000000,-0.866900000000000,-0.905700000000000,-0.945100000000000,-0.930800000000000,-0.924100000000000,-0.931800000000000,-0.954100000000000,-0.948000000000000,-0.924400000000000},
 {-0.654400000000000,-0.672400000000000,-0.835300000000000,-0.712100000000000,-0.832100000000000,-0.886900000000000,-0.937600000000000,-0.940200000000000,-0.886500000000000,-0.936000000000000,-0.931100000000000,-0.939500000000000,-0.956700000000000,-0.919200000000000},
 {-0.561800000000000,-0.692600000000000,-0.856300000000000,-0.844700000000000,-0.909900000000000,-0.966400000000000,-0.960200000000000,-0.930600000000000,-0.941100000000000,-0.954500000000000,-0.974700000000000,-0.970400000000000,-0.965500000000000,-0.955400000000000},
 {-0.391300000000000,-0.480500000000000,-0.932100000000000,-0.764200000000000,-0.972300000000000,-0.867300000000000,-0.848900000000000,-0.905100000000000,-0.848600000000000,-0.914100000000000,-0.981400000000000,-0.982400000000000,-0.964400000000000,-0.932900000000000},
 {-0.396100000000000,-0.744400000000000,-0.801300000000000,-0.727400000000000,-0.803800000000000,-0.792200000000000,-0.971400000000000,-0.910600000000000,-0.871400000000000,-0.888500000000000,-0.925600000000000,-0.908700000000000,-0.957600000000000,-0.940900000000000},
 {0.222900000000000,0.123500000000000,-0.748800000000000,-0.749800000000000,-0.844400000000000,-0.844300000000000,-0.850000000000000,-0.773300000000000,-0.812600000000000,-0.917000000000000,-0.845500000000000,-0.868700000000000,-0.912900000000000,-0.848100000000000},
 {-0.192100000000000,-0.604500000000000,-0.759700000000000,-0.777900000000000,-0.893400000000000,-0.894400000000000,-0.937800000000000,-0.854600000000000,-0.925500000000000,-0.921700000000000,-0.944000000000000,-0.920000000000000,-0.892500000000000,-0.813400000000000},
 {-0.204200000000000,-0.572400000000000,-0.856900000000000,-0.844600000000000,-0.792400000000000,-0.915600000000000,-0.910700000000000,-0.895800000000000,-0.926600000000000,-0.936200000000000,-0.953000000000000,-0.942300000000000,-0.898400000000000,-0.758500000000000},
 {-0.0876000000000000,-0.390600000000000,-0.908600000000000,-0.877600000000000,-0.892700000000000,-0.909400000000000,-0.921300000000000,-0.925000000000000,-0.963700000000000,-0.942500000000000,-0.960700000000000,-0.956600000000000,-0.893900000000000,-0.812300000000000},
 {-0.0936000000000000,-0.458900000000000,-0.854300000000000,-0.889600000000000,-0.812200000000000,-0.891600000000000,-0.936300000000000,-0.905800000000000,-0.948900000000000,-0.921800000000000,-0.946200000000000,-0.916800000000000,-0.906800000000000,-0.812800000000000},
 {0.0935000000000000,-0.146800000000000,-0.573100000000000,-0.545100000000000,-0.589000000000000,-0.881400000000000,-0.871000000000000,-0.753100000000000,-0.849100000000000,-0.841400000000000,-0.978900000000000,-0.876200000000000,-0.948100000000000,-0.873700000000000},
 {0.180900000000000,-0.187700000000000,-0.706100000000000,-0.642400000000000,-0.545500000000000,-0.655700000000000,-0.468800000000000,-0.694200000000000,-0.728000000000000,-0.824000000000000,-0.861800000000000,-0.882100000000000,-0.917600000000000,-0.742600000000000},
 {-0.0212000000000000,-0.778900000000000,-0.772300000000000,-0.947900000000000,-0.912400000000000,-0.921000000000000,-0.940000000000000,-0.950700000000000,-0.937100000000000,-0.972200000000000,-0.937400000000000,-0.963200000000000,-0.848000000000000,-0.821400000000000},
 {0.0572000000000000,-0.277800000000000,-0.757100000000000,-0.712300000000000,-0.838600000000000,-0.938700000000000,-0.926500000000000,-0.938600000000000,-0.942300000000000,-0.965800000000000,-0.956000000000000,-0.933300000000000,-0.909400000000000,-0.826600000000000},
 {0.191300000000000,-0.332500000000000,-0.707300000000000,-0.676500000000000,-0.802500000000000,-0.789700000000000,-0.848200000000000,-0.914800000000000,-0.903900000000000,-0.898500000000000,-0.911200000000000,-0.895600000000000,-0.864300000000000,-0.800500000000000},
 {0.408700000000000,-0.243800000000000,-0.656500000000000,-0.706000000000000,-0.743500000000000,-0.782400000000000,-0.843800000000000,-0.862300000000000,-0.833800000000000,-0.904400000000000,-0.866400000000000,-0.905800000000000,-0.916900000000000,-0.829200000000000},
 {-0.323100000000000,-0.549200000000000,-0.750300000000000,-0.781800000000000,-0.849000000000000,-0.889800000000000,-0.853500000000000,-0.932100000000000,-0.871900000000000,-0.896600000000000,-0.863500000000000,-0.904000000000000,-0.925800000000000,-0.857600000000000},
 {0.209400000000000,-0.236800000000000,-0.335700000000000,-0.765000000000000,-0.785700000000000,-0.789900000000000,-0.919700000000000,-0.754400000000000,-0.844700000000000,-0.877600000000000,-0.910800000000000,-0.847100000000000,-0.941700000000000,-0.908500000000000},
 {0.242600000000000,-0.0374000000000000,-0.576700000000000,-0.593000000000000,-0.771100000000000,-0.773100000000000,-0.892300000000000,-0.868800000000000,-0.909200000000000,-0.908600000000000,-0.897400000000000,-0.914600000000000,-0.912300000000000,-0.816600000000000},
 {0.0511000000000000,-0.258800000000000,-0.668400000000000,-0.737000000000000,-0.832900000000000,-0.832400000000000,-0.887100000000000,-0.877400000000000,-0.971400000000000,-0.885400000000000,-0.963700000000000,-0.970300000000000,-0.929400000000000,-0.857400000000000},
 {-0.234300000000000,-0.486400000000000,-0.685100000000000,-0.686200000000000,-0.833600000000000,-0.909700000000000,-0.832900000000000,-0.930600000000000,-0.933100000000000,-0.916400000000000,-0.985400000000000,-0.929200000000000,-0.902100000000000,-0.841800000000000},
 {-0.262300000000000,-0.632300000000000,-0.813000000000000,-0.752200000000000,-0.927500000000000,-0.925600000000000,-0.896200000000000,-0.870100000000000,-0.942600000000000,-0.939100000000000,-0.925000000000000,-0.928300000000000,-0.903800000000000,-0.780500000000000},
 {0.230000000000000,-0.256200000000000,-0.734400000000000,-0.758100000000000,-0.817300000000000,-0.840100000000000,-0.910500000000000,-0.917400000000000,-0.879500000000000,-0.925600000000000,-0.894500000000000,-0.890100000000000,-0.941900000000000,-0.833400000000000},
 {0.0883000000000000,-0.0528000000000000,-0.489900000000000,-0.539800000000000,-0.785300000000000,-0.803000000000000,-0.736500000000000,-0.833100000000000,-0.878600000000000,-0.831800000000000,-0.867600000000000,-0.837800000000000,-0.916700000000000,-0.874400000000000},
 {0.254400000000000,-0.228500000000000,-0.674800000000000,-0.654900000000000,-0.790300000000000,-0.860700000000000,-0.852300000000000,-0.853700000000000,-0.905600000000000,-0.901800000000000,-0.971100000000000,-0.901900000000000,-0.919800000000000,-0.902300000000000},
 {0.135000000000000,-0.0175000000000000,-0.472800000000000,-0.543200000000000,-0.672200000000000,-0.677100000000000,-0.705400000000000,-0.714900000000000,-0.844500000000000,-0.943600000000000,-0.936000000000000,-0.838600000000000,-0.906000000000000,-0.890100000000000},
 {0.222300000000000,-0.114700000000000,-0.625800000000000,-0.679300000000000,-0.746200000000000,-0.826000000000000,-0.852900000000000,-0.891700000000000,-0.918300000000000,-0.882600000000000,-0.885400000000000,-0.919500000000000,-0.937700000000000,-0.847200000000000},
 {0.191200000000000,0.0347000000000000,-0.715100000000000,-0.721600000000000,-0.743500000000000,-0.814700000000000,-0.828300000000000,-0.822700000000000,-0.892300000000000,-0.877100000000000,-0.892100000000000,-0.898300000000000,-0.926600000000000,-0.804100000000000},
 {0.221700000000000,-0.0990000000000000,-0.589900000000000,-0.711300000000000,-0.716600000000000,-0.862500000000000,-0.843100000000000,-0.892000000000000,-0.849600000000000,-0.915500000000000,-0.889900000000000,-0.929300000000000,-0.964300000000000,-0.842700000000000},
 {0.154300000000000,-0.0310000000000000,-0.669200000000000,-0.740100000000000,-0.819800000000000,-0.844400000000000,-0.887100000000000,-0.943400000000000,-0.895600000000000,-0.900100000000000,-0.886500000000000,-0.923400000000000,-0.926200000000000,-0.820000000000000},
 {0.171900000000000,-0.159200000000000,-0.259400000000000,-0.510100000000000,-0.631400000000000,-0.626800000000000,-0.765700000000000,-0.787700000000000,-0.832900000000000,-0.825500000000000,-0.883200000000000,-0.859900000000000,-0.940400000000000,-0.801300000000000},
 {0.204800000000000,-0.318500000000000,-0.546800000000000,-0.742400000000000,-0.828200000000000,-0.844400000000000,-0.889100000000000,-0.891100000000000,-0.930100000000000,-0.900500000000000,-0.949100000000000,-0.896600000000000,-0.950900000000000,-0.863400000000000},
 {0.316800000000000,-0.134600000000000,-0.750300000000000,-0.711100000000000,-0.884900000000000,-0.735900000000000,-0.878500000000000,-0.868500000000000,-0.913100000000000,-0.938700000000000,-0.925300000000000,-0.932200000000000,-0.958400000000000,-0.848600000000000}};

  /* XXX */
  //int free_sv;  /* 1 if svm_model is created by svm_load_model*/
     /* 0 if svm_model is created by svm_train */
 };
  [predict_label1,precision1,prob_estimates_t1]=SVMPredict(LabelS1,SStest1, model);


   return;

   };

2 réponses

mamiemando Messages postés 33446 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 20 décembre 2024 7 812
Modifié le 6 nov. 2017 à 09:50
Bonjour,

Plusieurs choses ne vont pas :

- Comme le message d'erreur l'indique, tu n'es pas sensée initialiser les membres de ta structure ainsi. En C++ il faut par exemple passer par un constructeur, que l'on parle d'une structure ou d'une classe.

- Il n'est pas très logique de stocker tout dans des tableaux à double entrée, en particulier quand il s'agit de vecteurs ou de valeurs numériques.

- Il y a aussi de grosses confusions en matières de typage. Par exemple
double * tab[m][n]
signifie que tu stockes une matrice de taille
m
x
n
de
double *
(donc une matrice d'adresses mémoires).

- En terme de typage, il n'y a aucune raison de stocker dans un
double
un nombre de classe.
unsigned int
ou
size_t
seraient plus adéquat.

-
[predict_label1,precision1,prob_estimates_t1]=SVMPredict(LabelS1,SStest1, model);
n'est pas possible en C (une fonction n'a qu'une valeur de retour). Si tu veux retourner une paire et l'affecter dans deux variables, c'est possible mais ce n'est pas comme ça qu'on fait.

Voici un exemple de constructeur :

struct MaStructure {
  int membre1;
  int membre2;
  int membre3;

  MaStructure(int x1, int x2):
    membre1(x1),
    membre1(x2)
  {
    membre3 = 8;
  }
};

int main() {
  MaStructure s(3, 7);
  return 0;
}


Pour récupérer une paire dans deux variables, on peut utiliser std::tie

#include <iostream>
#include <tuple>

int main() {
    int x, y;
    std::pair<int, int> p = std::make_pair(3, 7);

    std::tie(x, y) = p;
    std::cout << "x = " << x << std::endl
              << "y = " << y << std::endl;
    return 0;
}


Voici comment tu pourrais gérer tes vecteurs (et matrices) avec un compilateur récent :

#include <iostream>
#include <ostream>
#include <vector>

template <typename T>
std::ostream & operator << (
    std::ostream & os,
    const std::vector<T> & v
) {
    os << '[';
    for (auto x : v) os << ' ' << x;
    os << " ]";
    return os;
}

int main() {
    std::vector<int> v = {1, 2, 3};
    std::cout << "v = " << v << std::endl;
    std::vector<std::vector<int>> m = {{1, 2}, {3, 4}};
    std::cout << "m = " << m << std::endl;
    return 0;
}


Bonne chance
0
aycha mabrouk Messages postés 7 Date d'inscription jeudi 10 octobre 2013 Statut Membre Dernière intervention 25 avril 2018
Modifié le 7 nov. 2017 à 09:29
Bonjour ,
j'ai modifié mon code de cette façon ,maintenant j'essaye de corriger les erreurs et je suis pas sure qu'il fonctionne ou non parce que c'est ma première fois que j'écris un code c ++ en vivado HLS,s'il vous plaît Monsieur pouvez-vous me dit qu'elle est la faute avec une suggestion de correction .merci
WARNING: [SIM 211-51] HLS only supports CLANG compiler in Linux.
INFO: [SIM 211-4] CSIM will launch GCC as the compiler.
Compiling ../../../../src1/main.cpp in debug mode
../../../../src1/main.cpp: In function 'void pavilion_ref(T (*)[DIM2], T (*)[DIMb], T (*)[DIMd], T (*)[DIMf])':
../../../../src1/main.cpp:199:8: error: expected unqualified-id before '=' token
../../../../src1/main.cpp: At global scope:
../../../../src1/main.cpp:212:47: error: expected ',' or '...' before 'predict_label1'
../../../../src1/main.cpp: In function 'void pavilion_hw(T (*)[DIM2], T)':
../../../../src1/main.cpp:327:8: error: expected unqualified-id before '=' token
../../../../src1/main.cpp:329:5: error: expected unqualified-id before 'return'
../../../../src1/main.cpp:333:1: error: expected ';' after struct definition
../../../../src1/main.cpp:335:1: error: a template declaration cannot appear at block scope
../../../../src1/main.cpp:363:1: error: expected ';' before 'template'
../../../../src1/main.cpp:364:29: error: 'U' was not declared in this scope
../../../../src1/main.cpp:364:31: error: 'TI' was not declared in this scope
../../../../src1/main.cpp:364:34: error: 'TD' was not declared in this scope
../../../../src1/main.cpp:364:36: error: template argument 2 is invalid
../../../../src1/main.cpp:364:36: error: template argument 3 is invalid
../../../../src1/main.cpp:364:36: error: template argument 4 is invalid
../../../../src1/main.cpp:365:1: error: a function-definition is not allowed here before '{' token
../../../../src1/main.cpp:657:2: error: expected '}' at end of input



#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include <ap_axi_sdata.h>
#include <ap_int.h>

#include <string>
#include "rt_nonfinite.h"
#include "pavilion.h"
#include "main.h"
//#include "mat.h"
#include "pavilion_terminate.h"
#include "pavilion_initialize.h"


#include "svm.h"
#include "SVMPredict.h"
//#include " svm_predict.h"

typedef ap_axiu<32,4,5,5> AXI_VAL;
///////////////////declaration des matrices/////////////
 static double const parameters[5][1]={{1},{1},{1},{10},{0.150000000000000}};
 static  double const nr_class[1][1]={ 3 };
 static  double const totalSV[1][1]= {38};   /* total #SV */
   //double svm_node **SV=SVs=
               double rho[3][1]= {{3.85250072056665},{1.98260813354295},{-9.85381777928213}};


            static  double const label[3][1]= {{1},{2},{3}}; /* label of each class (label[k]) */
         static  double const sv_indices[38][1]= {{1},{3},{11},{18},{20},{22},{25},{26},{29},{30},{42},{43},{45},{49},{50},{51},{55},{56},{60},{63},{65},{69},{70},{71},{72},{73},{75},{82},{83},{90},{94},{98},{102},{104},{107},{110},{113},{119}};       /* sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set */


         static  double const probA[3][1]= {{-3.04020468884611},{-3.02985537320699},{-1.22838128162279}};  /* pariwise probability information */
         static  double const probB[3][1]= {{-0.143832034298135},{-0.331592706939798},{-0.317353460209991}};
      static  double const sv_coef [38][2]= {{0.0441014900184046,0},{0.115481676752995,0.0247201450973238},{0.0284525394158882,0},{0.115481676752995,0.0247201450973238},{0.115481676752995,0.0247201450973238},{0.115481676752995,0.0247201450973238},{0.0429276473187021,0.0247201450973238},{0.115481676752995,0.0247201450973238}, {0.115481676752995,0.0247201450973238}, {0.115481676752995,0.0247201450973238},{0,2.56566567302770},{-0.115481676752995,0},{-0.115481676752995,0},{-0.115481676752995,0},{-0.115481676752995,0}, {0,2.56566567302770},{0,1.19304447300938},{-0.115481676752995,0},{0,1.37262120001832},{0,2.56566567302770},{0,2.56566567302770},{-0.115481676752995,0}, {0,2.56566567302770},{0,2.56566567302770}, {0,2.56566567302770},{0,2.56566567302770},{-0.115481676752995,0},{-0.115481676752995,0},{-0.0247201450973238,-2.56566567302770},{-0.0247201450973238,-0.665006705657444},{-0.0247201450973238,-2.56566567302770},{0,-1.82845371567548},{-0.0247201450973238,-2.56566567302770},{0,-2.56566567302770},  {-0.0247201450973238,-2.56566567302770}, {-0.0247201450973238,-0.106867010440775}, {0,-1.24158009628657},  {-0.0247201450973238,-2.56566567302770}}; /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */

     /* constants in decision functions (rho[k*(k-1)/2]) */
   /* for classification only */

   //double *label= [1;2;3]; /* label of each class (label[k]) */
   static  double const nSV[3][1] ={{10},{17},{11}}; /* number of SVs for each class (nSV[k]) */
      /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
      static  double const SVs[38][14]={
   {-0.579400000000000,-0.924500000000000,-0.878900000000000,-0.907400000000000,-0.902800000000000,-0.979600000000000,-0.977000000000000,-0.918200000000000,-0.904600000000000,-0.965100000000000,-0.972900000000000,-0.941700000000000,-0.961900000000000,-0.936700000000000},
  {-0.422700000000000,-0.443500000000000,-0.809000000000000,-0.880800000000000,-0.879800000000000,-0.924100000000000,-0.930800000000000,-0.978100000000000,-0.949100000000000,-0.970100000000000,-0.990400000000000,-0.975300000000000,-0.981400000000000,-0.953000000000000},
  {-0.604400000000000,-0.850700000000000,-0.851100000000000,-0.788000000000000,-0.885200000000000,-0.825500000000000,-0.921000000000000,-0.933900000000000,-0.966800000000000,-0.917600000000000,-0.965200000000000,-0.930500000000000,-0.948600000000000,-0.938700000000000},
  {-0.624000000000000,-0.648500000000000,-0.985600000000000,-0.876800000000000,-0.893100000000000,-0.938300000000000,-0.919000000000000,-0.885100000000000,-0.948400000000000,-0.899200000000000,-0.970700000000000,-0.911300000000000,-0.970000000000000,-0.944600000000000},
  {-0.373800000000000,-0.520300000000000,-0.703800000000000,-0.811600000000000,-0.843900000000000,-0.867900000000000,-0.861400000000000,-0.921700000000000,-0.848200000000000,-0.952100000000000,-0.933600000000000,-0.956300000000000,-0.972600000000000,-0.953500000000000},
  {-0.592300000000000,-0.691900000000000,-0.768000000000000,-0.894100000000000,-0.934600000000000,-0.866900000000000,-0.905700000000000,-0.945100000000000,-0.930800000000000,-0.924100000000000,-0.931800000000000,-0.954100000000000,-0.948000000000000,-0.924400000000000},
  {-0.654400000000000,-0.672400000000000,-0.835300000000000,-0.712100000000000,-0.832100000000000,-0.886900000000000,-0.937600000000000,-0.940200000000000,-0.886500000000000,-0.936000000000000,-0.931100000000000,-0.939500000000000,-0.956700000000000,-0.919200000000000},
  {-0.561800000000000,-0.692600000000000,-0.856300000000000,-0.844700000000000,-0.909900000000000,-0.966400000000000,-0.960200000000000,-0.930600000000000,-0.941100000000000,-0.954500000000000,-0.974700000000000,-0.970400000000000,-0.965500000000000,-0.955400000000000},
  {-0.391300000000000,-0.480500000000000,-0.932100000000000,-0.764200000000000,-0.972300000000000,-0.867300000000000,-0.848900000000000,-0.905100000000000,-0.848600000000000,-0.914100000000000,-0.981400000000000,-0.982400000000000,-0.964400000000000,-0.932900000000000},
  {-0.396100000000000,-0.744400000000000,-0.801300000000000,-0.727400000000000,-0.803800000000000,-0.792200000000000,-0.971400000000000,-0.910600000000000,-0.871400000000000,-0.888500000000000,-0.925600000000000,-0.908700000000000,-0.957600000000000,-0.940900000000000},
  {0.222900000000000,0.123500000000000,-0.748800000000000,-0.749800000000000,-0.844400000000000,-0.844300000000000,-0.850000000000000,-0.773300000000000,-0.812600000000000,-0.917000000000000,-0.845500000000000,-0.868700000000000,-0.912900000000000,-0.848100000000000},
  {-0.192100000000000,-0.604500000000000,-0.759700000000000,-0.777900000000000,-0.893400000000000,-0.894400000000000,-0.937800000000000,-0.854600000000000,-0.925500000000000,-0.921700000000000,-0.944000000000000,-0.920000000000000,-0.892500000000000,-0.813400000000000},
  {-0.204200000000000,-0.572400000000000,-0.856900000000000,-0.844600000000000,-0.792400000000000,-0.915600000000000,-0.910700000000000,-0.895800000000000,-0.926600000000000,-0.936200000000000,-0.953000000000000,-0.942300000000000,-0.898400000000000,-0.758500000000000},
  {-0.0876000000000000,-0.390600000000000,-0.908600000000000,-0.877600000000000,-0.892700000000000,-0.909400000000000,-0.921300000000000,-0.925000000000000,-0.963700000000000,-0.942500000000000,-0.960700000000000,-0.956600000000000,-0.893900000000000,-0.812300000000000},
  {-0.0936000000000000,-0.458900000000000,-0.854300000000000,-0.889600000000000,-0.812200000000000,-0.891600000000000,-0.936300000000000,-0.905800000000000,-0.948900000000000,-0.921800000000000,-0.946200000000000,-0.916800000000000,-0.906800000000000,-0.812800000000000},
  {0.0935000000000000,-0.146800000000000,-0.573100000000000,-0.545100000000000,-0.589000000000000,-0.881400000000000,-0.871000000000000,-0.753100000000000,-0.849100000000000,-0.841400000000000,-0.978900000000000,-0.876200000000000,-0.948100000000000,-0.873700000000000},
  {0.180900000000000,-0.187700000000000,-0.706100000000000,-0.642400000000000,-0.545500000000000,-0.655700000000000,-0.468800000000000,-0.694200000000000,-0.728000000000000,-0.824000000000000,-0.861800000000000,-0.882100000000000,-0.917600000000000,-0.742600000000000},
  {-0.0212000000000000,-0.778900000000000,-0.772300000000000,-0.947900000000000,-0.912400000000000,-0.921000000000000,-0.940000000000000,-0.950700000000000,-0.937100000000000,-0.972200000000000,-0.937400000000000,-0.963200000000000,-0.848000000000000,-0.821400000000000},
  {0.0572000000000000,-0.277800000000000,-0.757100000000000,-0.712300000000000,-0.838600000000000,-0.938700000000000,-0.926500000000000,-0.938600000000000,-0.942300000000000,-0.965800000000000,-0.956000000000000,-0.933300000000000,-0.909400000000000,-0.826600000000000},
  {0.191300000000000,-0.332500000000000,-0.707300000000000,-0.676500000000000,-0.802500000000000,-0.789700000000000,-0.848200000000000,-0.914800000000000,-0.903900000000000,-0.898500000000000,-0.911200000000000,-0.895600000000000,-0.864300000000000,-0.800500000000000},
  {0.408700000000000,-0.243800000000000,-0.656500000000000,-0.706000000000000,-0.743500000000000,-0.782400000000000,-0.843800000000000,-0.862300000000000,-0.833800000000000,-0.904400000000000,-0.866400000000000,-0.905800000000000,-0.916900000000000,-0.829200000000000},
  {-0.323100000000000,-0.549200000000000,-0.750300000000000,-0.781800000000000,-0.849000000000000,-0.889800000000000,-0.853500000000000,-0.932100000000000,-0.871900000000000,-0.896600000000000,-0.863500000000000,-0.904000000000000,-0.925800000000000,-0.857600000000000},
  {0.209400000000000,-0.236800000000000,-0.335700000000000,-0.765000000000000,-0.785700000000000,-0.789900000000000,-0.919700000000000,-0.754400000000000,-0.844700000000000,-0.877600000000000,-0.910800000000000,-0.847100000000000,-0.941700000000000,-0.908500000000000},
  {0.242600000000000,-0.0374000000000000,-0.576700000000000,-0.593000000000000,-0.771100000000000,-0.773100000000000,-0.892300000000000,-0.868800000000000,-0.909200000000000,-0.908600000000000,-0.897400000000000,-0.914600000000000,-0.912300000000000,-0.816600000000000},
  {0.0511000000000000,-0.258800000000000,-0.668400000000000,-0.737000000000000,-0.832900000000000,-0.832400000000000,-0.887100000000000,-0.877400000000000,-0.971400000000000,-0.885400000000000,-0.963700000000000,-0.970300000000000,-0.929400000000000,-0.857400000000000},
  {-0.234300000000000,-0.486400000000000,-0.685100000000000,-0.686200000000000,-0.833600000000000,-0.909700000000000,-0.832900000000000,-0.930600000000000,-0.933100000000000,-0.916400000000000,-0.985400000000000,-0.929200000000000,-0.902100000000000,-0.841800000000000},
  {-0.262300000000000,-0.632300000000000,-0.813000000000000,-0.752200000000000,-0.927500000000000,-0.925600000000000,-0.896200000000000,-0.870100000000000,-0.942600000000000,-0.939100000000000,-0.925000000000000,-0.928300000000000,-0.903800000000000,-0.780500000000000},
  {0.230000000000000,-0.256200000000000,-0.734400000000000,-0.758100000000000,-0.817300000000000,-0.840100000000000,-0.910500000000000,-0.917400000000000,-0.879500000000000,-0.925600000000000,-0.894500000000000,-0.890100000000000,-0.941900000000000,-0.833400000000000},
  {0.0883000000000000,-0.0528000000000000,-0.489900000000000,-0.539800000000000,-0.785300000000000,-0.803000000000000,-0.736500000000000,-0.833100000000000,-0.878600000000000,-0.831800000000000,-0.867600000000000,-0.837800000000000,-0.916700000000000,-0.874400000000000},
  {0.254400000000000,-0.228500000000000,-0.674800000000000,-0.654900000000000,-0.790300000000000,-0.860700000000000,-0.852300000000000,-0.853700000000000,-0.905600000000000,-0.901800000000000,-0.971100000000000,-0.901900000000000,-0.919800000000000,-0.902300000000000},
  {0.135000000000000,-0.0175000000000000,-0.472800000000000,-0.543200000000000,-0.672200000000000,-0.677100000000000,-0.705400000000000,-0.714900000000000,-0.844500000000000,-0.943600000000000,-0.936000000000000,-0.838600000000000,-0.906000000000000,-0.890100000000000},
  {0.222300000000000,-0.114700000000000,-0.625800000000000,-0.679300000000000,-0.746200000000000,-0.826000000000000,-0.852900000000000,-0.891700000000000,-0.918300000000000,-0.882600000000000,-0.885400000000000,-0.919500000000000,-0.937700000000000,-0.847200000000000},
  {0.191200000000000,0.0347000000000000,-0.715100000000000,-0.721600000000000,-0.743500000000000,-0.814700000000000,-0.828300000000000,-0.822700000000000,-0.892300000000000,-0.877100000000000,-0.892100000000000,-0.898300000000000,-0.926600000000000,-0.804100000000000},
  {0.221700000000000,-0.0990000000000000,-0.589900000000000,-0.711300000000000,-0.716600000000000,-0.862500000000000,-0.843100000000000,-0.892000000000000,-0.849600000000000,-0.915500000000000,-0.889900000000000,-0.929300000000000,-0.964300000000000,-0.842700000000000},
  {0.154300000000000,-0.0310000000000000,-0.669200000000000,-0.740100000000000,-0.819800000000000,-0.844400000000000,-0.887100000000000,-0.943400000000000,-0.895600000000000,-0.900100000000000,-0.886500000000000,-0.923400000000000,-0.926200000000000,-0.820000000000000},
  {0.171900000000000,-0.159200000000000,-0.259400000000000,-0.510100000000000,-0.631400000000000,-0.626800000000000,-0.765700000000000,-0.787700000000000,-0.832900000000000,-0.825500000000000,-0.883200000000000,-0.859900000000000,-0.940400000000000,-0.801300000000000},
  {0.204800000000000,-0.318500000000000,-0.546800000000000,-0.742400000000000,-0.828200000000000,-0.844400000000000,-0.889100000000000,-0.891100000000000,-0.930100000000000,-0.900500000000000,-0.949100000000000,-0.896600000000000,-0.950900000000000,-0.863400000000000},
  {0.316800000000000,-0.134600000000000,-0.750300000000000,-0.711100000000000,-0.884900000000000,-0.735900000000000,-0.878500000000000,-0.868500000000000,-0.913100000000000,-0.938700000000000,-0.925300000000000,-0.932200000000000,-0.958400000000000,-0.848600000000000}};

      double  predict_label1[60][1];
        double precision1[3][1];
         double prob_estimates_t1[60][3];
//////////////////////////
#define DB_DEBUG

template <typename T, int DIM1, int DIM2, int DIMa, int DIMb, int DIMc, int DIMd, int DIMe, int DIMf>

void pavilion_ref(T LabelS1[DIM1][DIM2], T  predict_label1[DIMa][DIMb], T  precision1[DIMc][DIMd],T  prob_estimates_t1[DIMe][DIMf])
{

 double SStest1[60][14]={
 {-0.674090537952796,-0.967913560624215,-0.946607312926616,-0.949789832193271,-0.955656497278097,-0.938898706383114,-0.961972723505885,-0.943158564395126,-0.924258334652885,-0.987130021868515,-0.961224433510270,-0.979509038935985,-0.982841580894078,-0.968786461033008},
 {-0.661420074510186,-0.953582957005305,-0.976667803306075,-0.852024795662031,-0.923684241437988,-0.908602156779947,-0.961480830721390,-0.943819721336063,-0.961645084746726,-0.975901524455997,-0.964617784738062,-0.985199969033792,-0.979709442173101,-0.949066533256159},
 {-0.796228139367668,-0.761729500498894,-0.922254078572498,-0.835053436355116,-0.927209479313798,-0.955333905733235,-0.924794123637238,-0.959289492589635,-0.930944373099572,-0.938536988120820,-0.976986907828858,-0.949164123093526,-0.970737156105474,-0.947698751805312},
 {-0.760572782759851,-0.831771980500142,-0.945585944378708,-0.908125723416015,-0.942297850129234,-0.938465946137737,-0.968103420998903,-0.977193895073700,-0.969825462569338,-0.981781833938995,-0.975225320029628,-0.966562487844290,-0.979385622636404,-0.969916779098183},
 {-0.682062208785592,-0.901993333331962,-0.911439298246093,-0.995583382410982,-0.950515197199961,-0.939916724225237,-0.951278160425057,-0.951056228844938,-0.962461853366129,-0.977169060764356,-0.975068659001004,-1,-0.981383502203534,-0.960140644534363},
 {-0.764153524047345,-0.782068868778498,-0.930585958249904,-0.899522666144618,-0.961023627518624,-0.905380199817116,-0.931424494746754,-0.911851616413864,-0.955101420749475,-0.978391738284877,-0.977733347990399,-0.957980914548860,-0.987159688960536,-0.958296510208874},
 {-0.741980614232449,-0.708911988880729,-0.854515153854522,-0.844481728371788,-0.939444864580808,-0.921581100661191,-0.931215822177604,-0.924511727085001,-0.934842760732822,-0.944799003697996,-0.949046456708687,-0.969530645790348,-0.981557594662755,-0.966214670867448},
 {-0.373792542593349,-0.520278392032748,-0.703829741405612,-0.811632538345339,-0.843860131190612,-0.867918184900834,-0.861425053147186,-0.921678622630629,-0.848207919776101,-0.952149873411277,-0.933584801186523,-0.956270474264593,-0.972592914683167,-0.953500986248213},
 {-0.661229877813482,-0.663476191336492,-0.875946105955396,-0.813599831284167,-0.927616269612180,-0.947770900356774,-0.944605151964964,-0.949965011099178,-0.951558296918110,-0.959706992151603,-0.934147669647518,-0.959913517244191,-0.976789712492956,-0.957643754265247},
 {-0.518554977026420,-0.602825724193184,-0.883181911007378,-0.866976656576412,-0.881653303448664,-0.834429119509439,-0.938506509068625,-0.792206968065827,-0.884123330616924,-0.917397025318987,-0.938798625979835,-0.925986787255497,-0.986438030341222,-0.961106108508390},
 {-0.530140301878371,-0.883934580851869,-0.929208213377834,-0.981337861458516,-0.942509396789582,-0.918370801892608,-0.946368904151541,-0.968727717519249,-0.965415345904235,-0.992420840751352,-0.960290441628204,-0.987263434783806,-0.980777852550863,-0.961027269770681},
 {-0.614065935999483,-0.643092868497660,-0.849915771303324,-0.923684372369931,-0.899325977629591,-0.940079152274114,-0.943645330258078,-0.966640084204524,-0.954120749867146,-0.992492691029133,-0.942907389517172,-0.986160598733704,-0.961571311375914,-0.944437607583134},
 {-0.586207974039630,-0.655562550483140,-0.848822046603218,-0.828032863687348,-0.979545766504300,-0.954849783433112,-0.933180508531547,-0.901952187183437,-0.935767611336519,-0.947717892133932,-0.963983017763248,-0.936129485635805,-0.962853677964312,-0.939892729210301},
 {-0.698562423991206,-0.828928876308795,-0.930529603172751,-0.973583105511949,-0.922780081115147,-0.950411689148607,-0.922089545604029,-0.902482494918462,-0.919077025971580,-0.938762961947185,-0.946683851734027,-0.943899220923818,-0.970751027958274,-0.962890874229321},
 {-0.792352413710960,-0.846807561570503,-0.962463796461496,-0.938280210895608,-0.970676035685350,-0.950577966455638,-0.982653505409229,-0.964264032678215,-0.961530079570332,-0.984175640092749,-0.990259222509500,-0.957261271696928,-0.982531823910805,-0.975962025172037},
 {-0.794841618144870,-0.829566960381545,-0.965210501288073,-0.932270663074643,-0.967556626906079,-0.946620792181095,-0.972488769216231,-0.962127134647906,-0.957393614634659,-0.981727556097064,-0.987503639619946,-0.953217441593240,-0.981375073603447,-0.973405792323495},
 {-0.795020194095386,-0.806888733270744,-0.960369889000445,-0.915515767489692,-0.957828103336507,-0.939683270081732,-0.951942785566158,-0.957422184175696,-0.947345455495148,-0.975149131137862,-0.978221174145014,-0.944545398095925,-0.978853699190608,-0.968099161607423},
 {-0.698839070385112,-0.854584769884228,-0.879448228263050,-0.898303458884004,-0.970834545509510,-0.997729382049760,-0.938912886553759,-0.968614408138659,-0.974484461898617,-0.985571704652593,-0.967328388395865,-0.972452715835938,-0.983660906019555,-0.963564537278949},
 {-0.673302416738159,-0.879272351929407,-0.968223106643735,-0.972084171937861,-0.959896101364386,-0.961700573227355,-0.969790464510721,-0.954916739185306,-0.945985863949909,-0.975300691304921,-0.968364403832397,-0.977561535571141,-0.980589365529592,-0.954447517556441},
 {-0.637045925923046,-0.710061083800907,-0.936826613792305,-0.859638718802183,-0.912322897550303,-0.981683944934587,-0.890113781116241,-0.913234535285272,-0.894395484221828,-0.922010414470385,-0.957815677576098,-0.941998783974119,-0.969077948566397,-0.955456380822368},
 {-0.0464553899974760,-0.662925986991806,-0.833828153044336,-0.929089542429105,-0.837654390767010,-0.945247889228093,-0.957871446601941,-0.960270138903518,-0.965707812000886,-0.958450094695355,-0.968893174805499,-0.975892896458684,-0.882317284020699,-0.784076824928733},
 {0.168450404584060,-0.438611610872580,-0.739305838353202,-0.753469051869701,-0.872053346050208,-0.902328666401733,-0.875296732403390,-0.891944157498292,-0.875131611862177,-0.876570070893988,-0.916492079359415,-0.892474870559755,-0.880173712101710,-0.818840278283343},
 {0.214956796965889,-0.463100108992908,-0.795731268208176,-0.892232485332773,-0.796178277611433,-0.876064110052591,-0.917887824420658,-0.933514902536318,-0.906487752914575,-0.906161558178618,-0.963182144556198,-0.927398731670949,-0.880132272769419,-0.776628206791729},
 {-0.0355148259693545,-0.103832635363957,-0.642826483479963,-0.675170193621003,-0.726663088806811,-0.743780040787059,-0.831794948409108,-0.812381272649148,-0.818233308995815,-0.936764748241986,-0.927791786953338,-0.946337910236447,-0.865122830148352,-0.803850525738294},
 {-0.0375370422771995,-0.714446611429583,-0.817139932455997,-0.861863433965497,-0.801308409717709,-0.912671943149429,-0.902056680948667,-0.924358383893747,-0.930365403512554,-0.933505439717915,-0.907344668404472,-0.962516466348439,-0.888667439601752,-0.759379503762919},
 {-0.0996422526625035,-0.569498829531724,-0.785394421709639,-0.775105653598853,-0.896482238814758,-0.792471179311656,-0.893821172610422,-0.919322542815255,-0.929090887568931,-0.947222968505341,-0.941521326987315,-0.939564066437628,-0.886581473928985,-0.854622228969523},
 {-0.157947246037774,-0.746922906626790,-0.755491702134737,-0.884559880628624,-0.926822302167037,-0.892694279049245,-0.880997501268835,-0.960323416980551,-0.931254655744972,-0.929470986910981,-0.910748517978109,-0.956965233219925,-0.892806218692971,-0.824323609583577},
 {0.0143100845225228,-0.296971046115063,-0.756037633627588,-0.763254487870567,-0.853796813421072,-0.903855283273275,-0.932880202365020,-0.920300138069262,-0.937750780107648,-0.931802164909103,-0.938127043278968,-0.936648786420969,-0.897396787074019,-0.841443684643823},
 {0.126406089554415,-0.553436242221630,-0.878529200298623,-0.811481080953497,-0.858597903016569,-0.858187238247150,-0.929425420879273,-0.898856593831970,-0.954706925783214,-0.905919892252836,-0.955668439276137,-0.938058984422267,-0.859062344153360,-0.781233364834173},
 {-0.126055537585803,-0.545552869682677,-0.731986017810449,-0.886554196997008,-0.843484118770908,-0.933727925913333,-0.929494256217181,-0.949857908445841,-0.933022166519305,-0.955371701911967,-0.945336532486260,-0.958137376491658,-0.907276661798547,-0.823729901317309},
 {0.0145717851732077,-0.533090337648005,-0.839692084485777,-0.895485971838661,-0.928205663722173,-0.925860301792440,-0.929578060336248,-0.960552985114785,-0.949903531077579,-0.934632681448160,-0.968632836944857,-0.950189964823872,-0.879233119136866,-0.785002723370355},
 {-0.178891784381271,-0.399532717894635,-0.669385253177598,-0.727133395461031,-0.751773861739512,-0.852940528963974,-0.888222736607932,-0.865518628517857,-0.904806207358640,-0.896746617989777,-0.933151592845165,-0.903824933251927,-0.892900090292400,-0.850301284686282},
 {0.339342751347667,-0.168658832220281,-0.701126807517342,-0.705317306144173,-0.766727960954685,-0.805058424745359,-0.908411767678567,-0.850936664511331,-0.938429790986132,-0.897160305989233,-0.966173046779846,-0.901648919962718,-0.923592942739536,-0.812147836977765},
 {-0.165273390468733,-0.202594882499135,-0.685271591575949,-0.641279617027603,-0.810903427104329,-0.721277680480091,-0.878931073742658,-0.770692553521093,-0.915436309034622,-0.845750173546187,-0.920759281404426,-0.849039794164389,-0.883592352877391,-0.786060658867459},
 {-0.174398260956424,-0.628964902893240,-0.851345814848046,-0.929633727074964,-0.912288496191548,-0.952393561588859,-0.957556620703674,-0.966293462428000,-0.967979236795410,-0.967761734377952,-0.968514139800528,-0.966000184471383,-0.873900925904829,-0.804602844673793},
 {0.0912987881509080,-0.562348503567656,-0.544977227135293,-0.496953610164791,-0.665280698891481,-0.825516237438271,-0.764714736496212,-0.825266477368957,-0.778124049781793,-0.889578890948835,-0.860510945808230,-0.889449590530369,-0.899510852733607,-0.817813916256618},
 {-0.159278240258134,-0.562350349373472,-0.672010009362750,-0.702971077603283,-0.791579089506330,-0.773580188614902,-0.868797839368800,-0.901404564649279,-0.883359902797464,-0.882538284811406,-0.902504051837194,-0.888858485690590,-0.907802404057984,-0.860390254926969},
 {-0.115571783442574,-0.364989767126751,-0.715693202021139,-0.720794054845607,-0.734368283253484,-0.821024371768553,-0.864273592837283,-0.884637763632675,-0.905128610959545,-0.911052662127927,-0.934668657036883,-0.959498348008793,-0.948659165025090,-0.857302848890063},
 {-0.119022287702128,-0.435263305220441,-0.674278713268148,-0.717147325691312,-0.786355896498330,-0.803730904718690,-0.918533634832367,-0.871846660926452,-0.930289987345790,-0.945177344298286,-0.948345725996483,-0.900852637961356,-0.927660822404464,-0.829129813555718},
 {-0.243582392888872,-0.456156540815826,-0.882025256314901,-0.878826799838538,-0.875702181196543,-0.952037299706992,-0.922147237385639,-0.953195599137228,-0.988774455168753,-0.956906724025646,-0.990803722658199,-0.962527534612586,-0.917165742920258,-0.857395436225837},
 {0.399888144165083,0.187596602167405,-0.571206951482556,-0.630021295932159,-0.732918080832751,-0.782042578842550,-0.884501484522094,-0.862443525574920,-0.907782413800503,-0.879582251780713,-0.875536974905776,-0.912451877893607,-0.922455195733535,-0.902359364047133},
 {0.556284386426115,0.314036089555063,-0.519960698533138,-0.646049325780951,-0.741233326065650,-0.712137290320001,-0.795024298435714,-0.727879833200862,-0.853933696711804,-0.789936654005493,-0.895739890390449,-0.834987182855880,-0.931084212245965,-0.785223030050557},
 {0.144327924856347,-0.00175945025183155,-0.764123925530958,-0.788116589181975,-0.815023410153421,-0.765757055388867,-0.819440340310641,-0.832834974075190,-0.889065353427949,-0.879626121154264,-0.955003504819721,-0.886941582940570,-0.951457072822665,-0.838292308039416},
 {0.423517043395152,0.207103229391809,-0.537337037899986,-0.719082296323729,-0.730712289172267,-0.803970667494681,-0.776968241650566,-0.770243671002982,-0.870732435883177,-0.790184354464107,-0.849528556769068,-0.857417938148147,-0.914235935637580,-0.862839599386109},
 {0.673400833910405,0.263687282928186,-0.468684958192597,-0.555004829882917,-0.597759466034923,-0.879943048249649,-0.759647494885421,-0.842498114781129,-0.795476315407791,-0.874613706944541,-0.825569610343889,-0.906032284945689,-0.959418030250979,-0.845363247476606},
 {0.183271855620944,0.0211381514220783,-0.502683851137181,-0.636454841163429,-0.786437592022666,-0.805282205840683,-0.813868765137396,-0.807502478689115,-0.789136059855138,-0.787535977735564,-0.823588573107538,-0.833053461976117,-0.925414212506851,-0.879916140090418},
 {0.295845138886807,-0.00395006804240183,-0.548896710154673,-0.673532260911150,-0.743809959983556,-0.766709087110313,-0.792579121413211,-0.812789970935862,-0.888809512385073,-0.865512371317576,-0.866483384552372,-0.910365914309237,-0.922859275559095,-0.805741791608307},
 {0.382230322025496,-0.100544388585754,-0.288045792305930,-0.462878731933967,-0.733635653289924,-0.810774775566528,-0.784311635942323,-0.824278283823241,-0.837674642235770,-0.820294633519681,-0.930289366057359,-0.880333683094064,-0.914809932792345,-0.733615286641321},
 {0.515086084868621,-0.0118463200641755,-0.681312282108688,-0.721728766135035,-0.896943193457623,-0.892492731672196,-0.900895034581712,-0.958202884169137,-0.890317876836114,-0.925894485203484,-0.887102514104963,-0.925150645540907,-0.951009285936294,-0.828633953324099},
 {0.218939003616403,-0.219908089866804,-0.554543937993146,-0.697744593495449,-0.817644527591940,-0.815044931936388,-0.835611927342840,-0.863014952910201,-0.870015506961933,-0.924498109016286,-0.861738324469650,-0.888798266919434,-0.963003761418040,-0.752728018190114},
 {0.379801716860667,0.0803934635748880,-0.348489273860588,-0.443364836987716,-0.686210071710231,-0.749012364568597,-0.868160795860281,-0.905931730794798,-0.827560530714372,-0.843130513494941,-0.874882850617447,-0.898079375435337,-0.958923408320119,-0.826200545619004},
 {0.499909795739691,0.0624123264063490,-0.257162655088657,-0.474302401472459,-0.717398057495245,-0.792006768091720,-0.765814288840469,-0.795160131332406,-0.817978992797693,-0.871336925999567,-0.907076913192798,-0.851666096922091,-0.932313438565331,-0.778005802680850},
 {0.269368264824844,0.0215786140194887,-0.476977706904142,-0.647680815543785,-0.700462589073132,-0.788128770460292,-0.835354852471012,-0.862240914525829,-0.860676230010876,-0.845117177334758,-0.912670838989494,-0.867405287746421,-0.973060275185485,-0.823505423592852},
 {0.179006934566610,0.0585770863310706,-0.729516278647376,-0.736020711155540,-0.833340421570685,-0.863888272177564,-0.858242670121925,-0.908051906398737,-0.888570941463165,-0.900872325708206,-0.872080362074863,-0.886372519170446,-0.948853071328778,-0.841226487206630},
 {0.255490817526987,0.0983271005342115,-0.506833291130341,-0.651349940443935,-0.756337911242788,-0.786870364249337,-0.799083430523079,-0.798476951216588,-0.930360503515967,-0.961047836742245,-0.950977568316625,-0.966198529200948,-0.944896563690946,-0.877086968426192},
 {0.244696633497264,0.124742610239186,-0.00974949294211636,-0.527185835802341,-0.669863996792797,-0.660506846176490,-0.777882938739871,-0.741441779984189,-0.863181488070075,-0.798643774891844,-0.919225101825890,-0.838533769615936,-0.900125302373132,-0.798067298811813},
 {0.154383004639343,-0.135587455441821,-0.474282157787074,-0.545456066636011,-0.647593724862076,-0.755085065020264,-0.761876996351167,-0.835705857964857,-0.887714636576169,-0.869061999970453,-0.882416185426200,-0.923607732584544,-0.959373168720827,-0.838276040824778},
 {0.504849989457597,0.214254376963237,-0.486090671351638,-0.601583503221537,-0.696568826469689,-0.752801035520086,-0.811002254524322,-0.825807713677726,-0.833769846610573,-0.855476282988971,-0.883160491267595,-0.962853439329057,-0.902581371883451,-0.743974014417838},
 {0.445145614467157,-0.0889240542286259,-0.251341749130795,-0.325574329282160,-0.661040242281816,-0.652164091731617,-0.813620922276726,-0.807485140580725,-0.856971911757818,-0.756592971519269,-0.864973897574650,-0.840655456848447,-0.920416268675231,-0.746278678613040},
 {0.434793037813971,-0.0492388032158161,-0.365397844714972,-0.528993051702485,-0.685064834479619,-0.737413635953856,-0.799290876511762,-0.850728865215625,-0.825002878399477,-0.891118614677671,-0.870372516784281,-0.902812350877063,-0.922480285663246,-0.885180878798811}};




 struct model
 {
  double parameters[5][1]; //={{1},{1},{1},{10},{0.150000000000000}};

  double nr_class[1][1];//={ { new double(3) } }; /* number of classes, = 2 in regression/one class svm */
  double totalSV[1][1];//= { { new double(38) } };   /* total #SV */
  //double svm_node **SV=SVs=
              double rho[3][1];//= {{3.85250072056665},{1.98260813354295},{-9.85381777928213}};


           double label[3][1];//= {{1},{2},{3}}; /* label of each class (label[k]) */
        double sv_indices[38][1];//= {{1},{3},{11},{18},{20},{22},{25},{26},{29},{30},{42},{43},{45},{49},{50},{51},{55},{56},{60},{63},{65},{69},{70},{71},{72},{73},{75},{82},{83},{90},{94},{98},{102},{104},{107},{110},{113},{119}};       /* sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set */


        double probA[3][1];//:= {{-3.04020468884611},{-3.02985537320699},{-1.22838128162279}};  /* pariwise probability information */
        double probB[3][1];//= {{-0.143832034298135},{-0.331592706939798},{-0.317353460209991}};
               double sv_coef [38][2];//= {
     /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */

    /* constants in decision functions (rho[k*(k-1)/2]) */
  /* for classification only */

  //double *label= [1;2;3]; /* label of each class (label[k]) */
  double nSV[3][1];// ={{10},{17},{11}}; /* number of SVs for each class (nSV[k]) */
     /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
     double SVs[38][14];//={

  /* XXX */
  //int free_sv;  /* 1 if svm_model is created by svm_load_model*/
     /* 0 if svm_model is created by svm_train */
 };
 struct res
  {
  double predict_label1[3][1];
  double precision1[60][1];
  double prob_estimates_t1[60][3];

  };
  //(predict_label1,precision1,prob_estimates_t1)=res;
   res = SVMPredict(LabelS1,SStest1, model);


   return;

   }


// --------------------------------------------------------
// actual multiplication algorithm


template <typename T, int DIM1,int DIM2,int DIMa,int DIMb,int DIMc,int DIMd,int DIMe,int DIMf>
void pavilion_hw(T LabelS1[DIM1][DIM2], T out predict_label1[DIMa][DIMb], T precision1[DIMc][DIMd],T prob_estimates_t1[DIMe][DIMf])
{

 // partition with half dimension size b/c BRAM has two ports

#pragma HLS INLINE off
#pragma HLS array_partition variable=LabelS1 dim=1

 double SStest1[60][14]={
  {-0.674090537952796,-0.967913560624215,-0.946607312926616,-0.949789832193271,-0.955656497278097,-0.938898706383114,-0.961972723505885,-0.943158564395126,-0.924258334652885,-0.987130021868515,-0.961224433510270,-0.979509038935985,-0.982841580894078,-0.968786461033008},
  {-0.661420074510186,-0.953582957005305,-0.976667803306075,-0.852024795662031,-0.923684241437988,-0.908602156779947,-0.961480830721390,-0.943819721336063,-0.961645084746726,-0.975901524455997,-0.964617784738062,-0.985199969033792,-0.979709442173101,-0.949066533256159},
  {-0.796228139367668,-0.761729500498894,-0.922254078572498,-0.835053436355116,-0.927209479313798,-0.955333905733235,-0.924794123637238,-0.959289492589635,-0.930944373099572,-0.938536988120820,-0.976986907828858,-0.949164123093526,-0.970737156105474,-0.947698751805312},
  {-0.760572782759851,-0.831771980500142,-0.945585944378708,-0.908125723416015,-0.942297850129234,-0.938465946137737,-0.968103420998903,-0.977193895073700,-0.969825462569338,-0.981781833938995,-0.975225320029628,-0.966562487844290,-0.979385622636404,-0.969916779098183},
  {-0.682062208785592,-0.901993333331962,-0.911439298246093,-0.995583382410982,-0.950515197199961,-0.939916724225237,-0.951278160425057,-0.951056228844938,-0.962461853366129,-0.977169060764356,-0.975068659001004,-1,-0.981383502203534,-0.960140644534363},
  {-0.764153524047345,-0.782068868778498,-0.930585958249904,-0.899522666144618,-0.961023627518624,-0.905380199817116,-0.931424494746754,-0.911851616413864,-0.955101420749475,-0.978391738284877,-0.977733347990399,-0.957980914548860,-0.987159688960536,-0.958296510208874},
  {-0.741980614232449,-0.708911988880729,-0.854515153854522,-0.844481728371788,-0.939444864580808,-0.921581100661191,-0.931215822177604,-0.924511727085001,-0.934842760732822,-0.944799003697996,-0.949046456708687,-0.969530645790348,-0.981557594662755,-0.966214670867448},
  {-0.373792542593349,-0.520278392032748,-0.703829741405612,-0.811632538345339,-0.843860131190612,-0.867918184900834,-0.861425053147186,-0.921678622630629,-0.848207919776101,-0.952149873411277,-0.933584801186523,-0.956270474264593,-0.972592914683167,-0.953500986248213},
  {-0.661229877813482,-0.663476191336492,-0.875946105955396,-0.813599831284167,-0.927616269612180,-0.947770900356774,-0.944605151964964,-0.949965011099178,-0.951558296918110,-0.959706992151603,-0.934147669647518,-0.959913517244191,-0.976789712492956,-0.957643754265247},
  {-0.518554977026420,-0.602825724193184,-0.883181911007378,-0.866976656576412,-0.881653303448664,-0.834429119509439,-0.938506509068625,-0.792206968065827,-0.884123330616924,-0.917397025318987,-0.938798625979835,-0.925986787255497,-0.986438030341222,-0.961106108508390},
  {-0.530140301878371,-0.883934580851869,-0.929208213377834,-0.981337861458516,-0.942509396789582,-0.918370801892608,-0.946368904151541,-0.968727717519249,-0.965415345904235,-0.992420840751352,-0.960290441628204,-0.987263434783806,-0.980777852550863,-0.961027269770681},
  {-0.614065935999483,-0.643092868497660,-0.849915771303324,-0.923684372369931,-0.899325977629591,-0.940079152274114,-0.943645330258078,-0.966640084204524,-0.954120749867146,-0.992492691029133,-0.942907389517172,-0.986160598733704,-0.961571311375914,-0.944437607583134},
  {-0.586207974039630,-0.655562550483140,-0.848822046603218,-0.828032863687348,-0.979545766504300,-0.954849783433112,-0.933180508531547,-0.901952187183437,-0.935767611336519,-0.947717892133932,-0.963983017763248,-0.936129485635805,-0.962853677964312,-0.939892729210301},
  {-0.698562423991206,-0.828928876308795,-0.930529603172751,-0.973583105511949,-0.922780081115147,-0.950411689148607,-0.922089545604029,-0.902482494918462,-0.919077025971580,-0.938762961947185,-0.946683851734027,-0.943899220923818,-0.970751027958274,-0.962890874229321},
  {-0.792352413710960,-0.846807561570503,-0.962463796461496,-0.938280210895608,-0.970676035685350,-0.950577966455638,-0.982653505409229,-0.964264032678215,-0.961530079570332,-0.984175640092749,-0.990259222509500,-0.957261271696928,-0.982531823910805,-0.975962025172037},
  {-0.794841618144870,-0.829566960381545,-0.965210501288073,-0.932270663074643,-0.967556626906079,-0.946620792181095,-0.972488769216231,-0.962127134647906,-0.957393614634659,-0.981727556097064,-0.987503639619946,-0.953217441593240,-0.981375073603447,-0.973405792323495},
  {-0.795020194095386,-0.806888733270744,-0.960369889000445,-0.915515767489692,-0.957828103336507,-0.939683270081732,-0.951942785566158,-0.957422184175696,-0.947345455495148,-0.975149131137862,-0.978221174145014,-0.944545398095925,-0.978853699190608,-0.968099161607423},
  {-0.698839070385112,-0.854584769884228,-0.879448228263050,-0.898303458884004,-0.970834545509510,-0.997729382049760,-0.938912886553759,-0.968614408138659,-0.974484461898617,-0.985571704652593,-0.967328388395865,-0.972452715835938,-0.983660906019555,-0.963564537278949},
  {-0.673302416738159,-0.879272351929407,-0.968223106643735,-0.972084171937861,-0.959896101364386,-0.961700573227355,-0.969790464510721,-0.954916739185306,-0.945985863949909,-0.975300691304921,-0.968364403832397,-0.977561535571141,-0.980589365529592,-0.954447517556441},
  {-0.637045925923046,-0.710061083800907,-0.936826613792305,-0.859638718802183,-0.912322897550303,-0.981683944934587,-0.890113781116241,-0.913234535285272,-0.894395484221828,-0.922010414470385,-0.957815677576098,-0.941998783974119,-0.969077948566397,-0.955456380822368},
  {-0.0464553899974760,-0.662925986991806,-0.833828153044336,-0.929089542429105,-0.837654390767010,-0.945247889228093,-0.957871446601941,-0.960270138903518,-0.965707812000886,-0.958450094695355,-0.968893174805499,-0.975892896458684,-0.882317284020699,-0.784076824928733},
  {0.168450404584060,-0.438611610872580,-0.739305838353202,-0.753469051869701,-0.872053346050208,-0.902328666401733,-0.875296732403390,-0.891944157498292,-0.875131611862177,-0.876570070893988,-0.916492079359415,-0.892474870559755,-0.880173712101710,-0.818840278283343},
  {0.214956796965889,-0.463100108992908,-0.795731268208176,-0.892232485332773,-0.796178277611433,-0.876064110052591,-0.917887824420658,-0.933514902536318,-0.906487752914575,-0.906161558178618,-0.963182144556198,-0.927398731670949,-0.880132272769419,-0.776628206791729},
  {-0.0355148259693545,-0.103832635363957,-0.642826483479963,-0.675170193621003,-0.726663088806811,-0.743780040787059,-0.831794948409108,-0.812381272649148,-0.818233308995815,-0.936764748241986,-0.927791786953338,-0.946337910236447,-0.865122830148352,-0.803850525738294},
  {-0.0375370422771995,-0.714446611429583,-0.817139932455997,-0.861863433965497,-0.801308409717709,-0.912671943149429,-0.902056680948667,-0.924358383893747,-0.930365403512554,-0.933505439717915,-0.907344668404472,-0.962516466348439,-0.888667439601752,-0.759379503762919},
  {-0.0996422526625035,-0.569498829531724,-0.785394421709639,-0.775105653598853,-0.896482238814758,-0.792471179311656,-0.893821172610422,-0.919322542815255,-0.929090887568931,-0.947222968505341,-0.941521326987315,-0.939564066437628,-0.886581473928985,-0.854622228969523},
  {-0.157947246037774,-0.746922906626790,-0.755491702134737,-0.884559880628624,-0.926822302167037,-0.892694279049245,-0.880997501268835,-0.960323416980551,-0.931254655744972,-0.929470986910981,-0.910748517978109,-0.956965233219925,-0.892806218692971,-0.824323609583577},
  {0.0143100845225228,-0.296971046115063,-0.756037633627588,-0.763254487870567,-0.853796813421072,-0.903855283273275,-0.932880202365020,-0.920300138069262,-0.937750780107648,-0.931802164909103,-0.938127043278968,-0.936648786420969,-0.897396787074019,-0.841443684643823},
  {0.126406089554415,-0.553436242221630,-0.878529200298623,-0.811481080953497,-0.858597903016569,-0.858187238247150,-0.929425420879273,-0.898856593831970,-0.954706925783214,-0.905919892252836,-0.955668439276137,-0.938058984422267,-0.859062344153360,-0.781233364834173},
  {-0.126055537585803,-0.545552869682677,-0.731986017810449,-0.886554196997008,-0.843484118770908,-0.933727925913333,-0.929494256217181,-0.949857908445841,-0.933022166519305,-0.955371701911967,-0.945336532486260,-0.958137376491658,-0.907276661798547,-0.823729901317309},
  {0.0145717851732077,-0.533090337648005,-0.839692084485777,-0.895485971838661,-0.928205663722173,-0.925860301792440,-0.929578060336248,-0.960552985114785,-0.949903531077579,-0.934632681448160,-0.968632836944857,-0.950189964823872,-0.879233119136866,-0.785002723370355},
  {-0.178891784381271,-0.399532717894635,-0.669385253177598,-0.727133395461031,-0.751773861739512,-0.852940528963974,-0.888222736607932,-0.865518628517857,-0.904806207358640,-0.896746617989777,-0.933151592845165,-0.903824933251927,-0.892900090292400,-0.850301284686282},
  {0.339342751347667,-0.168658832220281,-0.701126807517342,-0.705317306144173,-0.766727960954685,-0.805058424745359,-0.908411767678567,-0.850936664511331,-0.938429790986132,-0.897160305989233,-0.966173046779846,-0.901648919962718,-0.923592942739536,-0.812147836977765},
  {-0.165273390468733,-0.202594882499135,-0.685271591575949,-0.641279617027603,-0.810903427104329,-0.721277680480091,-0.878931073742658,-0.770692553521093,-0.915436309034622,-0.845750173546187,-0.920759281404426,-0.849039794164389,-0.883592352877391,-0.786060658867459},
  {-0.174398260956424,-0.628964902893240,-0.851345814848046,-0.929633727074964,-0.912288496191548,-0.952393561588859,-0.957556620703674,-0.966293462428000,-0.967979236795410,-0.967761734377952,-0.968514139800528,-0.966000184471383,-0.873900925904829,-0.804602844673793},
  {0.0912987881509080,-0.562348503567656,-0.544977227135293,-0.496953610164791,-0.665280698891481,-0.825516237438271,-0.764714736496212,-0.825266477368957,-0.778124049781793,-0.889578890948835,-0.860510945808230,-0.889449590530369,-0.899510852733607,-0.817813916256618},
  {-0.159278240258134,-0.562350349373472,-0.672010009362750,-0.702971077603283,-0.791579089506330,-0.773580188614902,-0.868797839368800,-0.901404564649279,-0.883359902797464,-0.882538284811406,-0.902504051837194,-0.888858485690590,-0.907802404057984,-0.860390254926969},
  {-0.115571783442574,-0.364989767126751,-0.715693202021139,-0.720794054845607,-0.734368283253484,-0.821024371768553,-0.864273592837283,-0.884637763632675,-0.905128610959545,-0.911052662127927,-0.934668657036883,-0.959498348008793,-0.948659165025090,-0.857302848890063},
  {-0.119022287702128,-0.435263305220441,-0.674278713268148,-0.717147325691312,-0.786355896498330,-0.803730904718690,-0.918533634832367,-0.871846660926452,-0.930289987345790,-0.945177344298286,-0.948345725996483,-0.900852637961356,-0.927660822404464,-0.829129813555718},
  {-0.243582392888872,-0.456156540815826,-0.882025256314901,-0.878826799838538,-0.875702181196543,-0.952037299706992,-0.922147237385639,-0.953195599137228,-0.988774455168753,-0.956906724025646,-0.990803722658199,-0.962527534612586,-0.917165742920258,-0.857395436225837},
  {0.399888144165083,0.187596602167405,-0.571206951482556,-0.630021295932159,-0.732918080832751,-0.782042578842550,-0.884501484522094,-0.862443525574920,-0.907782413800503,-0.879582251780713,-0.875536974905776,-0.912451877893607,-0.922455195733535,-0.902359364047133},
  {0.556284386426115,0.314036089555063,-0.519960698533138,-0.646049325780951,-0.741233326065650,-0.712137290320001,-0.795024298435714,-0.727879833200862,-0.853933696711804,-0.789936654005493,-0.895739890390449,-0.834987182855880,-0.931084212245965,-0.785223030050557},
  {0.144327924856347,-0.00175945025183155,-0.764123925530958,-0.788116589181975,-0.815023410153421,-0.765757055388867,-0.819440340310641,-0.832834974075190,-0.889065353427949,-0.879626121154264,-0.955003504819721,-0.886941582940570,-0.951457072822665,-0.838292308039416},
  {0.423517043395152,0.207103229391809,-0.537337037899986,-0.719082296323729,-0.730712289172267,-0.803970667494681,-0.776968241650566,-0.770243671002982,-0.870732435883177,-0.790184354464107,-0.849528556769068,-0.857417938148147,-0.914235935637580,-0.862839599386109},
  {0.673400833910405,0.263687282928186,-0.468684958192597,-0.555004829882917,-0.597759466034923,-0.879943048249649,-0.759647494885421,-0.842498114781129,-0.795476315407791,-0.874613706944541,-0.825569610343889,-0.906032284945689,-0.959418030250979,-0.845363247476606},
  {0.183271855620944,0.0211381514220783,-0.502683851137181,-0.636454841163429,-0.786437592022666,-0.805282205840683,-0.813868765137396,-0.807502478689115,-0.789136059855138,-0.787535977735564,-0.823588573107538,-0.833053461976117,-0.925414212506851,-0.879916140090418},
  {0.295845138886807,-0.00395006804240183,-0.548896710154673,-0.673532260911150,-0.743809959983556,-0.766709087110313,-0.792579121413211,-0.812789970935862,-0.888809512385073,-0.865512371317576,-0.866483384552372,-0.910365914309237,-0.922859275559095,-0.805741791608307},
  {0.382230322025496,-0.100544388585754,-0.288045792305930,-0.462878731933967,-0.733635653289924,-0.810774775566528,-0.784311635942323,-0.824278283823241,-0.837674642235770,-0.820294633519681,-0.930289366057359,-0.880333683094064,-0.914809932792345,-0.733615286641321},
  {0.515086084868621,-0.0118463200641755,-0.681312282108688,-0.721728766135035,-0.896943193457623,-0.892492731672196,-0.900895034581712,-0.958202884169137,-0.890317876836114,-0.925894485203484,-0.887102514104963,-0.925150645540907,-0.951009285936294,-0.828633953324099},
  {0.218939003616403,-0.219908089866804,-0.554543937993146,-0.697744593495449,-0.817644527591940,-0.815044931936388,-0.835611927342840,-0.863014952910201,-0.870015506961933,-0.924498109016286,-0.861738324469650,-0.888798266919434,-0.963003761418040,-0.752728018190114},
  {0.379801716860667,0.0803934635748880,-0.348489273860588,-0.443364836987716,-0.686210071710231,-0.749012364568597,-0.868160795860281,-0.905931730794798,-0.827560530714372,-0.843130513494941,-0.874882850617447,-0.898079375435337,-0.958923408320119,-0.826200545619004},
  {0.499909795739691,0.0624123264063490,-0.257162655088657,-0.474302401472459,-0.717398057495245,-0.792006768091720,-0.765814288840469,-0.795160131332406,-0.817978992797693,-0.871336925999567,-0.907076913192798,-0.851666096922091,-0.932313438565331,-0.778005802680850},
  {0.269368264824844,0.0215786140194887,-0.476977706904142,-0.647680815543785,-0.700462589073132,-0.788128770460292,-0.835354852471012,-0.862240914525829,-0.860676230010876,-0.845117177334758,-0.912670838989494,-0.867405287746421,-0.973060275185485,-0.823505423592852},
  {0.179006934566610,0.0585770863310706,-0.729516278647376,-0.736020711155540,-0.833340421570685,-0.863888272177564,-0.858242670121925,-0.908051906398737,-0.888570941463165,-0.900872325708206,-0.872080362074863,-0.886372519170446,-0.948853071328778,-0.841226487206630},
  {0.255490817526987,0.0983271005342115,-0.506833291130341,-0.651349940443935,-0.756337911242788,-0.786870364249337,-0.799083430523079,-0.798476951216588,-0.930360503515967,-0.961047836742245,-0.950977568316625,-0.966198529200948,-0.944896563690946,-0.877086968426192},
  {0.244696633497264,0.124742610239186,-0.00974949294211636,-0.527185835802341,-0.669863996792797,-0.660506846176490,-0.777882938739871,-0.741441779984189,-0.863181488070075,-0.798643774891844,-0.919225101825890,-0.838533769615936,-0.900125302373132,-0.798067298811813},
  {0.154383004639343,-0.135587455441821,-0.474282157787074,-0.545456066636011,-0.647593724862076,-0.755085065020264,-0.761876996351167,-0.835705857964857,-0.887714636576169,-0.869061999970453,-0.882416185426200,-0.923607732584544,-0.959373168720827,-0.838276040824778},
  {0.504849989457597,0.214254376963237,-0.486090671351638,-0.601583503221537,-0.696568826469689,-0.752801035520086,-0.811002254524322,-0.825807713677726,-0.833769846610573,-0.855476282988971,-0.883160491267595,-0.962853439329057,-0.902581371883451,-0.743974014417838},
  {0.445145614467157,-0.0889240542286259,-0.251341749130795,-0.325574329282160,-0.661040242281816,-0.652164091731617,-0.813620922276726,-0.807485140580725,-0.856971911757818,-0.756592971519269,-0.864973897574650,-0.840655456848447,-0.920416268675231,-0.746278678613040},
  {0.434793037813971,-0.0492388032158161,-0.365397844714972,-0.528993051702485,-0.685064834479619,-0.737413635953856,-0.799290876511762,-0.850728865215625,-0.825002878399477,-0.891118614677671,-0.870372516784281,-0.902812350877063,-0.922480285663246,-0.885180878798811}};




  struct model
  {
   double parameters[5][1] ;//={{1},{1},{1},{10},{0.150000000000000}};



   double nr_class[1][1];//={3}; /* number of classes, = 2 in regression/one class svm */
   double totalSV[1][1];//;;= {38};   /* total #SV */
   //double svm_node **SV=SVs=
               double rho[3][1];//= {

            double label[3][1];//= {{1},{2},{3}}; /* label of each class (label[k]) */
         double sv_indices[38][1];//= {{1},{3},{11},{18},{20},{22},{25},{26},{29},{30},{42},{43},{45},{49},{50},{51},{55},{56},{60},{63},{65},{69},{70},{71},{72},{73},{75},{82},{83},{90},{94},{98},{102},{104},{107},{110},{113},{119}};       /* sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set */


         double probA[3][1];//= {{-3.04020468884611},{-3.02985537320699},{-1.22838128162279}};  /* pariwise probability information */
         double probB[3][1];//= {{-0.143832034298135},{-0.331592706939798},{-0.317353460209991}};
                double sv_coef [38][2];//= {
       /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */

     /* constants in decision functions (rho[k*(k-1)/2]) */
   /* for classification only */

   //double *label= [1;2;3]; /* label of each class (label[k]) */
   double nSV[3][1] ;//={{10},{17},{11}}; /* number of SVs for each class (nSV[k]) */
      /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
      double SVs[38][14];//={

   /* XXX */
   //int free_sv;  /* 1 if svm_model is created by svm_load_model*/
      /* 0 if svm_model is created by svm_train */
;

  //[predict_label1,precision1,prob_estimates_t1]=SVMPredict(LabelS1,SStest1, model);
struct res
  {
  double predict_label1[3][1];
  double precision1[60][1];
  double prob_estimates_t1[60][3];

  };
  //(predict_label1,precision1,prob_estimates_t1)=res;
   res = SVMPredict(LabelS1,SStest1, model);

    return;



}
/////////////////////////////////
template <typename T, int U, int TI, int TD>
inline T pop_stream(ap_axiu <sizeof(T)*8,U,TI,TD> const &e)
{
#pragma HLS INLINE off
 // does not work b/c of:
 //  unsupported pointer reinterpretation
 //T ret = *reinterpret_cast<T const *> (&e.data);

 // instead use a union
 assert(sizeof(T) == sizeof(int));
 union
 {
  int ival;
  T oval;
 } converter;
 converter.ival = e.data;
 T ret = converter.oval;

 volatile ap_uint<sizeof(T)> strb = e.strb;
 volatile ap_uint<sizeof(T)> keep = e.keep;
 volatile ap_uint<U> user = e.user;
 volatile ap_uint<1> last = e.last;
 volatile ap_uint<TI> id = e.id;
 volatile ap_uint<TD> dest = e.dest;

 return ret;
}

template <typename T, int U, int TI, int TD>;
inline ap_axiu <sizeof(T)*8,U,TI,TD> push_stream(T const &v, bool last = false)
{
#pragma HLS INLINE off
 ap_axiu<sizeof(T)*8,U,TI,TD> e;

 // use a union, b/c reinterpret_cast not supported
 assert(sizeof(T) == sizeof(int));
 union
 {
  int oval;
  T ival;
 } converter;
 converter.ival = v;
 e.data = converter.oval;

 // set it to sizeof(T) ones
 e.strb = -1;
 e.keep = 15; //e.strb;
 e.user = 0;
 e.last = last ? 1 : 0;
 e.id = 0;
 e.dest = 0;
 return e;
}
///////////////////////////////////////////////////
template <typename T, int DIM1,int DIM2,int DIMa,int DIMb,int DIMc,int DIMd,int DIMe,int DIMf, int SIZE, int U, int TI, int TD>
void dut_mmult_accel_core (
 AXI_VAL in_stream[SIZE],
 AXI_VAL out_stream[3*SIZE],
 //volatile ap_uint<1> *hw_trig)
  volatile   ap_uint<1> *predict_label1_hw_trig;
  volatile ap_uint<1> *precision1_hw_trig;
  volatile ap_uint<1> *prob_estimates_t1_hw;
{

// Map ports to Vivado HLS interfaces
#pragma HLS INTERFACE ap_fifo port=in_stream
#pragma HLS INTERFACE ap_fifo port=out_stream

 // Map HLS ports to AXI interfaces
#pragma HLS RESOURCE variable=in_stream  core=AXIS metadata="-bus_bundle INPUT_STREAM"
#pragma HLS RESOURCE variable=out_stream core=AXIS metadata="-bus_bundle OUTPUT_STREAM"
#pragma HLS RESOURCE variable=return core=AXI4LiteS metadata="-bus_bundle CONTROL_BUS"

 ap_uint<1> logic_zero = 0;
 ap_uint<1> logic_one = 1;
 T LabelS [DIM1][DIM2];
    T predict_label1[DIMa][DIMb];
 T precision1[DIMc][DIMd];
 T prob_estimates_t1[DIMe][DIMf];


*predict_label1_trig = logic_zero; *precision1_trig = logic_zero; *prob_estimates_t1_trig = logic_zero;  assert(sizeof(T)*8 == 32);  *predict_label1_trig = logic_one; *precision1_trig = logic_one; *prob_estimates_t1_trig = logic_one; // stream in first matrix for(int i=0; i<DIM1; i++)  for(int j=0; j<DIM2; j++)  {#pragma HLS PIPELINE II=1   int k = i*DIM+j;   //a[i][j] = pop_stream<T,1,1,1>(in_stream[k]);   LabelS[i][j] = pop_stream<T,U,TI,TD>(in_stream[k]);  }     // do multiplicationpredict   //matrix_multiply_hw<T, DIM>(a,b,out);   pavilion_hw < T,  DIM1, DIM2, DIMa, DIMb, DIMc, DIMd, DIMe, DIMf>(LabelS1[,  out predict_label1,  precision1, prob_estimates_t1);   // stream out1 result matrix   for(int i=0; i<DIMa; i++)    for(int j=0; j<DIMb; j++)    {#pragma HLS PIPELINE II=1     int k = i*DIM+j;     //out_stream[k] = push_stream<T,1,1,1>(out[i][j],k == (SIZE-1));     out_stream[k] = push_stream<T,U,TI,TD>(out[i][j],k == (SIZE-1));    }   *predict_label1_trig = logic_zero; //*hw_trig = false;//*(bool *) hw_trig = false;   return ;      // stream out2 result matrix   for(int i=0; i<DIMc; i++)    for(int j=0; j<DIMd; j++)    {#pragma HLS PIPELINE II=1     int k = i*DIM+j;     //out_stream[k] = push_stream<T,1,1,1>(out[i][j],k == (SIZE-1));     out_stream[k] = push_stream<T,U,TI,TD>(out[i][j],k == (SIZE-2));    }   *precision1_trig = logic_zero; //*hw_trig = false;//*(bool *) hw_trig = false;   return ;            // stream out3 result matrix   for(int i=0; i<DIMe; i++)    for(int j=0; j<DIMf; j++)    {#pragma HLS PIPELINE II=1     int k = i*DIM+j;     //out_stream[k] = push_stream<T,1,1,1>(out[i][j],k == (SIZE-1));     out_stream[k] = push_stream<T,U,TI,TD>(out[i][j],k == (SIZE-3));    }   *prob_estimates_t1_trig = logic_zero; //*hw_trig = false;//*(bool *) hw_trig = false;   return ;}/////////////////////// should be template parameters at top level function#include <ap_int.h>template <typename T, int DIM1,int DIM2,int DIMa,int DIMb,int DIMc,int DIMd,int DIMe,int DIMf, int SIZE, int U, int TI, int TD>int test_pavilion(void){ int i,j, err;    T LabelS [DIM1][DIM2]; T predict_label1_sw[DIMa][DIMb]; T precision1_sw[DIMc][DIMd]; T prob_estimates_t1_sw[DIMe][DIMf]; T predict_label1_hw[DIMa][DIMb]; T precision1_hw[DIMc][DIMd]; T prob_estimates_t1_hw[DIMe][DIMf]; /** Matrix Initiation */ for(i = 0; i<DIM1; i++)  for(j = 0; j<DIM2; j++)   LabelS[i][j] = (float)(i+j);  /** End of Initiation */#ifdef DB_DEBUGo printf("DEBUGGING AXI4 STREAMING DATA TYPES!\r\n"); // prepare data for the DUT AXI_VAL inp_stream[SIZE]; AXI_VAL out_stream[3*SIZE]; assert(sizeof(T)*8 == 32); // stream in the first input  matrix for(int i=0; i<DIM1; i++)  for(int j=0; j<DIM2; j++)  {   int k = i*DIM+j;   inp_stream[k]      = push_stream<T,U,TI,TD>(LabelS[i][j],0);  }     }   //call the DUT   ap_uint<1> predict_label1_hw_trig;   ap_uint<1> precision1_hw_trig;   ap_uint<1> prob_estimates_t1_hw;      //dut_mmult_accel_core<T, DIM, SIZE, U, TI, TD>(inp_stream, out_stream, &hw_trig);   mmult_accel_core (inp_stream, out_stream,&predict_label1_hw_trig,&precision1_hw_trig,&prob_estimates_t1_hw);   // extract the output matrix 1 from the out stream    for(int i=0; i<DIMa; i++)    for(int j=0; j<DIMb; j++)    {     int k = i*DIM+j;     predict_label1_hw[i][j] = pop_stream<T,U,TI,TD>(out_stream[k]);    }        // extract the output matrix 2 from the out stream    for(int i=0; i<DIMc; i++)    for(int j=0; j<DIMd; j++)    {     int k = i*DIM+j;     precision1_hw[i][j] = pop_stream<T,U,TI,TD>(out_stream[k]);    }        // extract the output matrix 3 from the out stream    for(int i=0; i<DIMe; i++)    for(int j=0; j<DIMf; j++)    {     int k = i*DIM+j;     prob_estimates_t1_hw[i][j] = pop_stream<T,U,TI,TD>(out_stream[k]);    }#else printf("NORMAL MODE\r\n"); pavilion_hw<T,  DIM1, DIM2, DIMa, DIMb, DIMc, DIMd, DIMe, DIMf>(LabelS, predict_label1_hw,precision1_hw,prob_estimates_t1_hw);#endif /* reference Matrix Multiplication */ pavilion_ref<T,  DIM1, DIM2, DIMa, DIMb, DIMc, DIMd, DIMe, DIMf>(LabelS, predict_label1_sw,precision1_sw,prob_estimates_t1_sw); /** Matrix 1 comparison */ err = 0; for (i = 0; (i<DIMa && !err); i++)  for (j = 0; (j<DIMb && !err); j++)   if (predict_label1_sw[i][j] != predict_label1_hw[i][j])     err++; if (err == 0)  printf("Matrixes 1 identical ... Test successful!\r\n"); else  printf("Test 1 failed!\r\n"); return err;  /** Matrix 2 comparison */ err = 0; for (i = 0; (i<DIMc && !err); i++)  for (j = 0; (j<DIMd && !err); j++)   if (precision1_sw[i][j] != precision1_hw[i][j])     err++; if (err == 0)  printf("Matrixes 2 identical ... Test successful!\r\n"); else  printf("Test  2 failed!\r\n"); return err;  /** Matrix 3 comparison */ err = 0; for (i = 0; (i<DIMe && !err); i++)  for (j = 0; (j<DIMf && !err); j++)   if (prob_estimates_t1_sw[i][j] != prob_estimates_t1_hw[i][j])     err++; if (err == 0)  printf("Matrixes 3 identical ... Test successful!\r\n"); else  printf("Test 3 failed!\r\n"); return err;}////////////////////////// THIS IS THE TOP LEVEL DESIGN THAT WILL BE SYNTHESIZED#define MCR_SIZE 1024void mmult_accel_core(AXI_VAL in_stream[MCR_SIZE],AXI_VAL out_stream[3 * MCR_SIZE],volatile ap_uint<1>* predict_label1_hw_trig,volatile ap_uint<1>* precision1_hw_trig,volatile ap_uint<1>* prob_estimates_t1_hw_trig){ // Map ports to Vivado HLS interfaces #pragma HLS INTERFACE ap_fifo port=in_stream #pragma HLS INTERFACE ap_fifo port=out_stream // Map HLS ports to AXI interfaces #pragma HLS RESOURCE variable=in_stream  core=AXIS metadata="-bus_bundle INPUT_STREAM" #pragma HLS RESOURCE variable=out_stream core=AXIS metadata="-bus_bundle OUTPUT_STREAM" #pragma HLS RESOURCE variable=return core=AXI4LiteS metadata="-bus_bundle CONTROL_BUS" #pragma HLS INTERFACE ap_none register port=predict_label1_hw_trig #pragma HLS INTERFACE ap_none register port=precision1_hw_trig #pragma HLS INTERFACE ap_none register port=prob_estimates_t1_hw_trig dut_mmult_accel_core <float, 60, 1*60, 4, 5, 5>(in_stream, out_stream, predict_label1_hw_trig,precision1_hw_trig,prob_estimates_t1_hw_trig); return;}/////////////int main(const double LabelS[60]){ typedef float T; int const DIM1 = 1; int const DIM2 = 60; int const SIZE = DIM1*DIM2; int ret_val = 0; ret_val = test_pavilion<T, DIM1, DIM2, DIMa, DIMb, DIMc, DIMd, DIMe, DIMf, SIZE, 4,5,5>;pavilion_terminate();//main_pavilion();pavilion_initialize(); return ret_val;};
0
Dalfab Messages postés 706 Date d'inscription dimanche 7 février 2016 Statut Membre Dernière intervention 2 novembre 2023 101
6 nov. 2017 à 18:17
Bonjour,

Le compilateur n'aime pas du tout ce qu'il lit, et pour cause.

Quand tu écris
res = SVMPredict(LabelS1,SStest1, model);
, le
res
à gauche du égal est un type local. La valeur de retour d'une fonction ne peut être affectée qu'à une instance, certainement pas un type qui plus est local.

Ensuite, le compilateur est en train de s'étrangler et indique ce qu'il peut.
0