• Matrix in C++ : Strassen Algorithm

    MarkGrillo Member

    Matrix in C++ Strassen Algorithum

    Did anyone know how to implement the above using C++?

    Currently the matrix is store inside a 2-d dimension.

  • Adelaid Member

    Remember all matrix use a double for, so use it for the input and output

       for (int i = 0; i < n; i++) {
          for (int j = 0; i < n; j++) {
             //the multiplication process here
          }
       }
    
  • Abhey Member
    #define maxdim 10
    typedef float TRealMatrica[maxdim][maxdim];
             .
             .
             .
    TRealMatrica A,B;                         
             .
             .
             .
    void ProizvodMatrica(float (*A)[maxdim],float (*B)[maxdim],int NA,int NB)
    {
    TRealMatrica P;
    int i,j,k;
    
    clrscr();
    if(NA != NB)
      {
        printf("\nERROR: Rows must be same!");
      }
    else
      {
        for(i=0;i
        
Viewing 2 reply threads
  • You must be logged in to reply to this topic.