Changeset 0bf9a2 in git
- Timestamp:
- Mar 27, 1997, 11:28:51 AM (27 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- ddbd52d9793a0ad6b9a8810352e986750b07488b
- Parents:
- 68873b1078dfc6dbd821efacf909f29bc8ed2048
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/templates/ftmpl_array.cc
r68873b r0bf9a2 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: ftmpl_array.cc,v 1. 1 1996-07-16 12:24:56 stobbeExp $2 // $Id: ftmpl_array.cc,v 1.2 1997-03-27 10:28:51 schmidt Exp $ 3 3 4 4 /* 5 5 $Log: not supported by cvs2svn $ 6 Revision 1.1 1996/07/16 12:24:56 stobbe 7 "operators += and *= deleted sincethey are not needed in an general 8 array class als well as the functions sum, prod, crossprod. 9 " 10 6 11 Revision 1.0 1996/05/17 11:06:32 stobbe 7 12 Initial revision 8 13 9 14 */ 15 16 #include <templates/assert.h> 10 17 11 18 #include <templates/array.h> … … 93 100 T& Array<T>::operator[] ( int i ) const 94 101 { 95 if ( i >= _min && i <= _max ) 96 return data[i-_min]; 97 else { 98 cerr << "warning: array size mismatch." << endl; 99 return data[0]; 100 } 102 ASSERT( i >= _min && i <= _max, "warning: array size mismatch." ); 103 return data[i-_min]; 101 104 } 102 105 … … 139 142 Array<T>& Array<T>::operator+= ( const Array<T> & a ) 140 143 { 141 if ( _size != a._size ) 142 cerr << "warning: array size mismatch." << endl; 143 else 144 for ( int i = 0; i < _size; i++ ) 145 data[i] += a.data[i]; 144 ASSERT ( _size == a._size, "warning: array size mismatch." ); 145 for ( int i = 0; i < _size; i++ ) 146 data[i] += a.data[i]; 146 147 return *this; 147 148 } 148 149 */ 149 150 151 #ifndef NOSTREAMIO 150 152 template <class T> 151 153 void Array<T>::print ( ostream & os ) const … … 167 169 return os; 168 170 } 169 171 #endif /* NOSTREAMIO */
Note: See TracChangeset
for help on using the changeset viewer.