Changeset b9d5f5e in mmcs


Ignore:
Timestamp:
Nov 4, 2016, 8:31:15 AM (8 years ago)
Author:
rudmanmrrod <rudman22@…>
Branches:
master
Children:
f6d90ed
Parents:
37012be
Message:

Solventado problema de funcionalidad en la descomposicion

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mainwindow.C

    r37012be rb9d5f5e  
    61186118            list.append(formdescomposicion->ui->listSeleccionado->item(i)->text());
    61196119        }
    6120         if(validarDescomposicion(list))
    6121         {
    6122             QTableWidget *tw = findChild<QTableWidget *>("MatrizAn");
    6123             int filas = tw->rowCount();
    6124             Eigen::MatrixXd M1 = extractSubMatriz(tw,list.at(0),list.at(0),An);
    6125             Eigen::MatrixXd M2 = extractSubMatriz(tw,list.at(1),list.at(1),An);
    6126             QVector<double> V1 = extractDiagonal(M1);
    6127             QVector<double> V2 = extractDiagonal(M2);
    6128             QVector<double> diagonal;
    6129             appendElements(V1,diagonal);
    6130             appendElements(V2,diagonal);
    6131             for (int i = 2; i<filas;i++)
    6132             {
    6133                 for(int j=2; j<filas;j++)
     6120        QTableWidget *tw = findChild<QTableWidget *>("MatrizAn");
     6121        int filas = tw->rowCount();
     6122        Eigen::MatrixXd M1 = extractSubMatriz(tw,list.at(0),list.at(0),An);
     6123        Eigen::MatrixXd M2 = extractSubMatriz(tw,list.at(1),list.at(1),An);
     6124        QVector<double> V1 = extractDiagonal(M1);
     6125        QVector<double> V2 = extractDiagonal(M2);
     6126        QVector<double> diagonal;
     6127        appendElements(V1,diagonal);
     6128        appendElements(V2,diagonal);
     6129        for (int i = 2; i<filas;i++)
     6130        {
     6131            for(int j=2; j<filas;j++)
     6132            {
     6133                if(tw->item(0,j)->text()!=list.at(0) and tw->item(0,j)->text()!=list.at(1))
    61346134                {
    6135                     if(tw->item(0,j)->text()!=list.at(0) and tw->item(0,j)->text()!=list.at(1))
     6135                    if(i==j)
    61366136                    {
    6137                         if(i==j)
    6138                         {
    6139                             diagonal.append(An(i-2,j-2));
    6140                         }
     6137                        diagonal.append(An(i-2,j-2));
    61416138                    }
    61426139                }
    61436140            }
    6144             calcularA0(diagonal);
    6145             calcularAuxiliares();
    6146             calcularMatricesDescomposicion();
    6147         }
    6148         else
    6149         {
    6150             QMessageBox::warning(this,"Error","La cuenta Producto y Actividad\ndeben ser simétricas, ajuste la matriz\ne intente de nuevo");
    6151         }
     6141        }
     6142        calcularA0(diagonal);
     6143        calcularAuxiliares();
     6144        calcularMatricesDescomposicion();
    61526145    }
    61536146    else
     
    61566149    }
    61576150
    6158 }
    6159 
    6160 /**
    6161     @brief Función para validar que las cuentas producto y actividad sean simétricas
    6162     @date 28/09/2015
    6163     @author Rodrigo Boet
    6164     @param <cuentas> Recibe la lista con las cuentas
    6165     @return <valores> Retorna verdadera si son simétricas, falso en caso contrario
    6166 */
    6167 bool MainWindow::validarDescomposicion(QStringList cuentas)
    6168 {
    6169     QStringList valores;
    6170     foreach (int key, diccCuentasEndogenas.keys()) {
    6171        if (diccCuentasEndogenas[key][0]==cuentas.at(0) or diccCuentasEndogenas[key][0]==cuentas.at(1))
    6172        {
    6173            valores.append(diccCuentasEndogenas[key][1]);
    6174        }
    6175     }
    6176     if(valores.at(0)==valores.at(1))
    6177     {
    6178         return true;
    6179     }
    6180     else
    6181     {
    6182         return false;
    6183     }
    61846151}
    61856152
     
    62546221    int cantidad = diccCuentasEndogenas.count()-2;
    62556222    MatrixXd ant = aux;
     6223    MatrixXd A1 = aux;
    62566224    for(int i=0;i<cantidad;i++)
    62576225    {
    6258         aux *= ant;
     6226        aux = ant*A1;
    62596227        ant = aux;
    62606228        if(i<cantidad-1)
Note: See TracChangeset for help on using the changeset viewer.