Changeset 2585 in Sophya for trunk/SophyaLib/TArray/tmatrix.cc


Ignore:
Timestamp:
Jul 30, 2004, 3:11:51 PM (21 years ago)
Author:
cmv
Message:

Correction bug Multiply segment gault cmv 30/07/04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/tmatrix.cc

    r2583 r2585  
    1 // $Id: tmatrix.cc,v 1.27 2004-07-30 10:24:12 cmv Exp $
     1// $Id: tmatrix.cc,v 1.28 2004-07-30 13:11:51 cmv Exp $
    22//                         C.Magneville          04/99
    33#include "machdefs.h"
     
    405405}
    406406
    407 ////////////////////////////////////////////////////////////////
    408 //****  Multiplication matricielle  *****
    409 ////////////////////////////////////////////////////////////////
     407//////////////////////////////////////////////////////////
     408/////////////// Multiplication matricielle ///////////////
     409//////////////////////////////////////////////////////////
    410410
    411411//! Return the matrix product C = (*this)*B
     
    454454
    455455  // Commentaire: pas de difference de vitesse notable selon le mapping de la matrice produit "rm"
    456   if (mm == SameMemoryMapping) mm = GetMemoryMapping(); 
     456  if (mm == SameMemoryMapping) mm = GetMemoryMapping();
    457457  TMatrix<T> rm(NRows(), b.NCols(), mm);
    458458
     
    515515
    516516  if(stepa==1 && stepb==1) {
    517     //cout<<"A.col packed && B.row not packed "<<stepa<<" "<<stepb<<endl;
    518      T * pea = new T[rm.NCols()];
     517    //cout<<"A.col packed && B.row packed "<<stepa<<" "<<stepb<<endl;
     518     T * pea = new T[NCols()];
    519519    const T * peb;
    520520    for(r=0; r<rm.NRows(); r++) {     // Boucle sur les lignes de A
     
    540540    //cout<<"A.col packed && B.row not packed "<<stepa<<" "<<stepb<<endl;
    541541    const T * pea;
    542     T * peb = new T[rm.NCols()];
     542    T * peb = new T[NCols()];
    543543    for(c=0; c<rm.NCols(); c++) {     // Boucle sur les colonnes de B
    544544      pe = &(b(0,c));
     
    562562  if(stepa!=1 && stepb==1) {
    563563    //cout<<"A.col not packed && B.row packed "<<stepa<<" "<<stepb<<endl;
    564     T * pea = new T[rm.NCols()];
     564    T * pea = new T[NCols()];
    565565    const T * peb;
    566566    for(r=0; r<rm.NRows(); r++) {     // Boucle sur les lignes de A
     
    608608    //cout<<"A.col not packed && B.row not packed ==> optimize on B "<<stepa<<" "<<stepb<<endl;
    609609    const T * pea;
    610     T * peb = new T[rm.NCols()];
     610    T * peb = new T[NCols()];
    611611    for(c=0; c<rm.NCols(); c++) {     // Boucle sur les colonnes de B
    612612      pe = &(b(0,c));
     
    627627  if(stepa!=1 && stepb!=1) {
    628628    //cout<<"A.col not packed && B.row not packed ==> optimize on A "<<stepa<<" "<<stepb<<endl;
    629     T * pea = new T[rm.NCols()];
     629    T * pea = new T[NCols()];
    630630    const T * peb;
    631631    for(r=0; r<rm.NRows(); r++) {     // Boucle sur les lignes de A
     
    650650  throw(SzMismatchError("TMatrix<T>::Multiply(b) Optimize case not treated... Please report BUG !!! ") );
    651651  return rm;
    652 }
     652
     653}
     654
    653655
    654656///////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.