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


Ignore:
Timestamp:
Jul 24, 2000, 2:51:27 PM (25 years ago)
Author:
ansari
Message:

Adaptation modifs MuTyV et services de copie entre tableaux de type different - Reza 24/7/2000

File:
1 edited

Legend:

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

    r996 r1081  
    1 // $Id: tmatrix.cc,v 1.12 2000-05-02 15:49:29 ansari Exp $
     1// $Id: tmatrix.cc,v 1.13 2000-07-24 12:51:27 ansari Exp $
    22//                         C.Magneville          04/99
    33#include "machdefs.h"
     
    9999  UpdateMemoryMapping(a, mm);
    100100}
     101
     102template <class T>
     103TMatrix<T>::TMatrix(const BaseArray& a)
     104: TArray<T>()
     105{
     106  SetBA(a);
     107}
     108
     109
    101110
    102111//! Destructor
     
    125134  return(*this);
    126135}
     136
     137template <class T>
     138TArray<T>& TMatrix<T>::SetBA(const BaseArray& a)
     139{
     140  if (a.NbDimensions() > 2)
     141    throw SzMismatchError("TMatrix<T>::SetBA(const BaseArray& a) a.NbDimensions() > 2");
     142  TArray<T>::SetBA(a);
     143  if (NbDimensions() == 1) {
     144    size_[1] = 1;
     145    step_[1] = size_[0]*step_[0];
     146    ndim_ = 2;
     147  }
     148  UpdateMemoryMapping(*this, SameMemoryMapping);
     149  return(*this);
     150}
     151
     152
    127153
    128154//! Resize the matrix
Note: See TracChangeset for help on using the changeset viewer.