Index: Makefile
===================================================================
--- Makefile	(revision 07b8f66180ad7960652521ea67db525d21f99c71)
+++ Makefile	(revision 37dd9aacdf152f8c76d2dfa299159c12713b9cd8)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: SMSAM
-# Generated by qmake (2.01a) (Qt 4.8.2) on: Wed Sep 23 11:12:13 2015
+# Generated by qmake (2.01a) (Qt 4.8.2) on: lun sep 28 10:36:38 2015
 # Project:  SMSAM.pro
 # Template: app
Index: mainwindow.C
===================================================================
--- mainwindow.C	(revision 32f758e101513f37dc08adbd7d491289a4106fa1)
+++ mainwindow.C	(revision 37dd9aacdf152f8c76d2dfa299159c12713b9cd8)
@@ -1870,4 +1870,7 @@
         connect(&actionEncadenamiento,SIGNAL(triggered()),this,SLOT(slotEncadenamientos()));
         actionEncadenamiento.setEnabled(true);
+        //Clasificador de Cuentas
+        connect(&actionClasificarCuentas,SIGNAL(triggered()),this,SLOT(slotClasificarCuentas()));
+        actionClasificarCuentas.setEnabled(true);
 
         //Se activa la opción de modelo clásico
@@ -2921,4 +2924,151 @@
 }
 
+//Clasificador de cuentas
+void MainWindow::slotClasificarCuentas()
+{
+    QTableWidget *An = findChild<QTableWidget *>("MatrizAn");
+    QTableWidget *Ma = findChild<QTableWidget *>("MatrizMa");
+    int count = An->rowCount()-1;
+    QTableWidget *CC = new QTableWidget;
+    CC->setObjectName("Clasificador de Cuentas");
+    crearTablaVaciaEncadenamiento(count,CC,8);
+    cuentacomponentesResultado(CC,count-1,true);
+    QVector<double> vectorFila;
+    QVector<double> vectorColumna;
+    obtenerUiUj(An,vectorFila,vectorColumna);
+    calcularClasificador(CC,vectorFila,vectorColumna);
+    vectorFila.clear();
+    vectorColumna.clear();
+    obtenerUiUj(Ma,vectorFila,vectorColumna);
+    calcularClasificador(CC,vectorFila,vectorColumna,5);
+    CC->resizeColumnsToContents();//Ajuste de Columnas
+    agregarPrimeraCelda(CC);
+
+    tabWidget->addTab(new QWidget,"Clasificador");
+    int indice=ObtenerIndice("Clasificador");
+    QHBoxLayout * layoutCentralWidget = new QHBoxLayout;
+    layoutCentralWidget->addWidget(CC);
+    QWidget *widget = tabWidget->widget(indice);
+    widget->setLayout(layoutCentralWidget);//Se añade el widget y layout a la pestaña creada
+    actionClasificarCuentas.setDisabled(true);
+    tabWidget->setCurrentIndex(indice);
+}
+
+/*      Funcion que calcular los Ui y Uj para los clasificadores    */
+void MainWindow::obtenerUiUj(QTableWidget *tw, QVector<double> &ui, QVector<double> &uj)
+{
+    int contador = tw->rowCount();
+    double totalFila = 0;
+    double totalColumna = 0;
+    QVector<double> vectorFila;
+    QVector<double> vectorColumna;
+    for(int i=2;i<contador;i++)
+    {
+        double sumaFila = 0;
+        double sumaColumna = 0;
+        for(int j=2;j<contador;j++)
+        {
+            QString itemFila = Separador(tw->item(i,j),true);
+            QString itemColumna = Separador(tw->item(j,i),true);
+            double fila = itemFila.toDouble();
+            double columna = itemColumna.toDouble();
+            sumaFila+=fila;
+            sumaColumna+=columna;
+            totalFila+=fila;
+            totalColumna+=columna;
+        }
+        vectorFila.append(sumaFila);
+        vectorColumna.append(sumaColumna);
+    }
+    int cantidad = vectorFila.count();
+    for(int i=0;i<cantidad;i++)
+    {
+        double fila = vectorFila.at(i)/totalFila;
+        ui.append(fila);
+        double columna = vectorColumna.at(i)/totalColumna;
+        uj.append(columna);
+    }
+}
+
+/*          Funcion que hace los cálculos de los clasificadores            */
+void MainWindow::calcularClasificador(QTableWidget *tw, QVector<double> ui, QVector<double> uj,int init)
+{
+    int count = tw->rowCount()-1;
+    //Fuente Negrita
+    QFont font;
+    font.setBold(true);
+    //Titulos Ui, Uj y Tipo de Cuenta
+    QTableWidgetItem *uiItem = new QTableWidgetItem("Ui");
+    uiItem->setFlags(uiItem->flags() ^ Qt::ItemIsEditable);
+    uiItem->setFont(font);
+    tw->setItem(0,init,uiItem);
+    QTableWidgetItem *ujItem = new QTableWidgetItem("Uj");
+    ujItem->setFlags(ujItem->flags() ^ Qt::ItemIsEditable);
+    ujItem->setFont(font);
+    tw->setItem(0,init+1,ujItem);
+    QTableWidgetItem *tcItem = new QTableWidgetItem("Tipo de Cuenta");
+    tcItem->setFlags(tcItem->flags() ^ Qt::ItemIsEditable);
+    tcItem->setFont(font);
+    tw->setItem(0,init+2,tcItem);
+    for(int i=0;i<count;i++)
+    {
+        QTableWidgetItem *vFila = new QTableWidgetItem(QString::number(ui.at(i),'f',precission));
+        vFila->setFlags(vFila->flags() ^ Qt::ItemIsEditable);
+        QString itemFila = Separador(vFila,false);
+        vFila->setText(itemFila);
+        tw->setItem(i+1,init,vFila);
+        QTableWidgetItem *vColumna = new QTableWidgetItem(QString::number(uj.at(i),'f',precission));
+        vColumna->setFlags(vColumna->flags() ^ Qt::ItemIsEditable);
+        QString itemColumna = Separador(vColumna,false);
+        vColumna->setText(itemColumna);
+        tw->setItem(i+1,init+1,vColumna);
+        QTableWidgetItem *tipo = new QTableWidgetItem;
+        tipo->setFlags(tipo->flags() ^ Qt::ItemIsEditable);
+        //Se determina que tipo de cuenta es
+        if(ui.at(i)<1 and uj.at(i)<1)
+        {
+            tipo->setText("Independiente");
+        }
+        else if(ui.at(i)>1 and uj.at(i)<1)
+        {
+            tipo->setText("Impulsor de Economía");
+        }
+        else if(ui.at(i)<1 and uj.at(i)>1)
+        {
+            tipo->setText("Base");
+        }
+        else if(ui.at(i)>1 and uj.at(i)>1)
+        {
+            tipo->setText("Clave");
+        }
+        tw->setItem(i+1,init+2,tipo);
+    }
+}
+
+void MainWindow::agregarPrimeraCelda(QTableWidget *tw)
+{
+    tw->insertRow(0);
+    //Se colocan no editables la celda 0 y 1
+    noEditColZero(tw);
+    QTableWidgetItem *one = new QTableWidgetItem;
+    one->setFlags(one->flags() ^ Qt::ItemIsEditable);
+    tw->setItem(0,1,one);
+    for(int i=0;i<3;i++)
+    {
+        QTableWidgetItem *cAn = new QTableWidgetItem("Clasificador por An");
+        cAn->setTextAlignment(Qt::AlignCenter);
+        cAn->setFlags(cAn->flags() ^ Qt::ItemIsEditable);
+        CellStyleExEn(cAn);
+        tw->setItem(0,i+2,cAn);
+        QTableWidgetItem *cMa = new QTableWidgetItem("Clasificador por Ma");
+        cMa->setTextAlignment(Qt::AlignCenter);
+        cMa->setFlags(cMa->flags() ^ Qt::ItemIsEditable);
+        CellStyleExEn(cMa);
+        tw->setItem(0,5+i,cMa);
+    }
+    tw->setSpan(0,2,1,3);
+    tw->setSpan(0,5,1,3);
+}
+
 //FH_005
 void MainWindow::slotModeloClasico()
@@ -4921,5 +5071,5 @@
     int index = tabWidget->currentIndex();
     QString tabName = tabWidget->tabText(index);
-    if(tabName.contains("Inicio") or tabName.contains("Encadenamiento") or tabName.contains("Escenario")
+    if(tabName.contains("Inicio") or tabName.contains("Encadenamiento") or tabName.contains("Escenario") or tabName.contains("Clasificador")
             or tabName.contains("Resultado") or tabName.contains("Comparacion") or tabName.contains("Seleccion"))
     {
@@ -5017,4 +5167,5 @@
                 }
             }
+            ItemsNoEditable(nuevaTabla,0,2,1);
 
             titleSeleccionar(nuevaTabla);
Index: mainwindow.H
===================================================================
--- mainwindow.H	(revision 32f758e101513f37dc08adbd7d491289a4106fa1)
+++ mainwindow.H	(revision 37dd9aacdf152f8c76d2dfa299159c12713b9cd8)
@@ -204,4 +204,7 @@
     void encademientosStyle(QTableWidgetItem *);
     void cuentacomponentesEncadenamiento(QTableWidget *, int count);
+    void obtenerUiUj(QTableWidget *, QVector<double> &, QVector<double> &);
+    void calcularClasificador(QTableWidget *, QVector<double>, QVector<double>, int init = 2);
+    void agregarPrimeraCelda(QTableWidget *);
 
     void calcularSubtotal(QTableWidget *,int inicio, int fin,int exogena);
@@ -282,4 +285,5 @@
     void slotAgregarEncadenamiento();
     void slotVerEncadenamiento();
+    void slotClasificarCuentas();
 
     void slotCloseExport();
Index: moc_mainwindow.cpp
===================================================================
--- moc_mainwindow.cpp	(revision 32f758e101513f37dc08adbd7d491289a4106fa1)
+++ moc_mainwindow.cpp	(revision 37dd9aacdf152f8c76d2dfa299159c12713b9cd8)
@@ -2,5 +2,5 @@
 ** Meta object code from reading C++ file 'mainwindow.H'
 **
-** Created: Fri Sep 25 11:00:29 2015
+** Created: Mon Sep 28 11:46:38 2015
 **      by: The Qt Meta Object Compiler version 63 (Qt 4.8.2)
 **
@@ -24,5 +24,5 @@
        0,       // classname
        0,    0, // classinfo
-      56,   14, // methods
+      57,   14, // methods
        0,    0, // properties
        0,    0, // enums/sets
@@ -55,37 +55,38 @@
      475,   11,   11,   11, 0x08,
      499,   11,   11,   11, 0x08,
-     517,   11,   11,   11, 0x08,
-     534,   11,   11,   11, 0x08,
-     553,   11,   11,   11, 0x08,
-     581,  573,   11,   11, 0x08,
-     605,   11,   11,   11, 0x28,
-     625,   11,   11,   11, 0x08,
-     646,   11,   11,   11, 0x08,
-     668,   11,   11,   11, 0x08,
-     690,   11,   11,   11, 0x08,
-     713,   11,   11,   11, 0x08,
-     741,   11,   11,   11, 0x08,
-     763,   11,   11,   11, 0x08,
-     786,   11,   11,   11, 0x08,
-     813,   11,   11,   11, 0x08,
-     848,   11,   11,   11, 0x08,
-     879,   11,   11,   11, 0x08,
-     918,   11,   11,   11, 0x08,
-     943,   11,   11,   11, 0x08,
-     962,   11,   11,   11, 0x08,
+     523,   11,   11,   11, 0x08,
+     541,   11,   11,   11, 0x08,
+     558,   11,   11,   11, 0x08,
+     577,   11,   11,   11, 0x08,
+     605,  597,   11,   11, 0x08,
+     629,   11,   11,   11, 0x28,
+     649,   11,   11,   11, 0x08,
+     670,   11,   11,   11, 0x08,
+     692,   11,   11,   11, 0x08,
+     714,   11,   11,   11, 0x08,
+     737,   11,   11,   11, 0x08,
+     765,   11,   11,   11, 0x08,
+     787,   11,   11,   11, 0x08,
+     810,   11,   11,   11, 0x08,
+     837,   11,   11,   11, 0x08,
+     872,   11,   11,   11, 0x08,
+     903,   11,   11,   11, 0x08,
+     942,   11,   11,   11, 0x08,
+     967,   11,   11,   11, 0x08,
      986,   11,   11,   11, 0x08,
-    1014,   11,   11,   11, 0x08,
-    1050,   11,   11,   11, 0x08,
-    1082,   11,   11,   11, 0x08,
-    1122,   11,   11,   11, 0x08,
-    1145,   11,   11,   11, 0x08,
-    1164,   11,   11,   11, 0x08,
-    1180,   11,   11,   11, 0x08,
-    1207,   11,   11,   11, 0x08,
-    1238,   11,   11,   11, 0x08,
-    1255,   11,   11,   11, 0x08,
-    1290,   11,   11,   11, 0x08,
-    1308,   11,   11,   11, 0x08,
-    1347,   11,   11,   11, 0x08,
+    1010,   11,   11,   11, 0x08,
+    1038,   11,   11,   11, 0x08,
+    1074,   11,   11,   11, 0x08,
+    1106,   11,   11,   11, 0x08,
+    1146,   11,   11,   11, 0x08,
+    1169,   11,   11,   11, 0x08,
+    1188,   11,   11,   11, 0x08,
+    1204,   11,   11,   11, 0x08,
+    1231,   11,   11,   11, 0x08,
+    1262,   11,   11,   11, 0x08,
+    1279,   11,   11,   11, 0x08,
+    1314,   11,   11,   11, 0x08,
+    1332,   11,   11,   11, 0x08,
+    1371,   11,   11,   11, 0x08,
 
        0        // eod
@@ -105,10 +106,11 @@
     "slotEncadenamientos()\0slotCloseEncadenamiento()\0"
     "slotAgregarEncadenamiento()\0"
-    "slotVerEncadenamiento()\0slotCloseExport()\0"
-    "slotSaveExport()\0slotSearchExport()\0"
-    "slotModeloClasico()\0clasico\0"
-    "calcularEscenario(bool)\0calcularEscenario()\0"
-    "finalizarEscenario()\0slotModeloNoClasico()\0"
-    "calcularEscenarioNC()\0finalizarEscenarioNC()\0"
+    "slotVerEncadenamiento()\0slotClasificarCuentas()\0"
+    "slotCloseExport()\0slotSaveExport()\0"
+    "slotSearchExport()\0slotModeloClasico()\0"
+    "clasico\0calcularEscenario(bool)\0"
+    "calcularEscenario()\0finalizarEscenario()\0"
+    "slotModeloNoClasico()\0calcularEscenarioNC()\0"
+    "finalizarEscenarioNC()\0"
     "slotCompararResultadosMNC()\0"
     "slotVerResultadoMNC()\0slotPHCIncidencia100()\0"
@@ -160,38 +162,39 @@
         case 20: _t->slotAgregarEncadenamiento(); break;
         case 21: _t->slotVerEncadenamiento(); break;
-        case 22: _t->slotCloseExport(); break;
-        case 23: _t->slotSaveExport(); break;
-        case 24: _t->slotSearchExport(); break;
-        case 25: _t->slotModeloClasico(); break;
-        case 26: _t->calcularEscenario((*reinterpret_cast< bool(*)>(_a[1]))); break;
-        case 27: _t->calcularEscenario(); break;
-        case 28: _t->finalizarEscenario(); break;
-        case 29: _t->slotModeloNoClasico(); break;
-        case 30: _t->calcularEscenarioNC(); break;
-        case 31: _t->finalizarEscenarioNC(); break;
-        case 32: _t->slotCompararResultadosMNC(); break;
-        case 33: _t->slotVerResultadoMNC(); break;
-        case 34: _t->slotPHCIncidencia100(); break;
-        case 35: _t->slotPHCIncidenciaiCuenta(); break;
-        case 36: _t->slotCalcularPHCIncidenciaiCuenta(); break;
-        case 37: _t->slotPHCIncidenciaiComponente(); break;
-        case 38: _t->slotCalcularPHCIncidenciaiComponente(); break;
-        case 39: _t->slotCompararResultados(); break;
-        case 40: _t->slotVerResultado(); break;
-        case 41: _t->slotPHNCIncidencia100(); break;
-        case 42: _t->slotPHNCIncidenciaiCuenta(); break;
-        case 43: _t->slotCalcularPHNCIncidenciaiCuenta(); break;
-        case 44: _t->slotPHNCIncidenciaiComponente(); break;
-        case 45: _t->slotCalcularPHNCIncidenciaiComponente(); break;
-        case 46: _t->slotPNHIncudencia100(); break;
-        case 47: _t->slotCloseformPNH(); break;
-        case 48: _t->slotSelectPNH(); break;
-        case 49: _t->slotPNHIncidenciaiCuenta(); break;
-        case 50: _t->slotPNHIncidenciaiComponente(); break;
-        case 51: _t->slotSelectPNHi(); break;
-        case 52: _t->slotCalcularPNHIncidenciaiCuenta(); break;
-        case 53: _t->slotSelectPNHic(); break;
-        case 54: _t->slotCalcularPNHIncidenciaiComponente(); break;
-        case 55: _t->slotSeleccionarTabla(); break;
+        case 22: _t->slotClasificarCuentas(); break;
+        case 23: _t->slotCloseExport(); break;
+        case 24: _t->slotSaveExport(); break;
+        case 25: _t->slotSearchExport(); break;
+        case 26: _t->slotModeloClasico(); break;
+        case 27: _t->calcularEscenario((*reinterpret_cast< bool(*)>(_a[1]))); break;
+        case 28: _t->calcularEscenario(); break;
+        case 29: _t->finalizarEscenario(); break;
+        case 30: _t->slotModeloNoClasico(); break;
+        case 31: _t->calcularEscenarioNC(); break;
+        case 32: _t->finalizarEscenarioNC(); break;
+        case 33: _t->slotCompararResultadosMNC(); break;
+        case 34: _t->slotVerResultadoMNC(); break;
+        case 35: _t->slotPHCIncidencia100(); break;
+        case 36: _t->slotPHCIncidenciaiCuenta(); break;
+        case 37: _t->slotCalcularPHCIncidenciaiCuenta(); break;
+        case 38: _t->slotPHCIncidenciaiComponente(); break;
+        case 39: _t->slotCalcularPHCIncidenciaiComponente(); break;
+        case 40: _t->slotCompararResultados(); break;
+        case 41: _t->slotVerResultado(); break;
+        case 42: _t->slotPHNCIncidencia100(); break;
+        case 43: _t->slotPHNCIncidenciaiCuenta(); break;
+        case 44: _t->slotCalcularPHNCIncidenciaiCuenta(); break;
+        case 45: _t->slotPHNCIncidenciaiComponente(); break;
+        case 46: _t->slotCalcularPHNCIncidenciaiComponente(); break;
+        case 47: _t->slotPNHIncudencia100(); break;
+        case 48: _t->slotCloseformPNH(); break;
+        case 49: _t->slotSelectPNH(); break;
+        case 50: _t->slotPNHIncidenciaiCuenta(); break;
+        case 51: _t->slotPNHIncidenciaiComponente(); break;
+        case 52: _t->slotSelectPNHi(); break;
+        case 53: _t->slotCalcularPNHIncidenciaiCuenta(); break;
+        case 54: _t->slotSelectPNHic(); break;
+        case 55: _t->slotCalcularPNHIncidenciaiComponente(); break;
+        case 56: _t->slotSeleccionarTabla(); break;
         default: ;
         }
@@ -231,7 +234,7 @@
         return _id;
     if (_c == QMetaObject::InvokeMetaMethod) {
-        if (_id < 56)
+        if (_id < 57)
             qt_static_metacall(this, _c, _id, _a);
-        _id -= 56;
+        _id -= 57;
     }
     return _id;
