Changeset 0bf9a2 in git


Ignore:
Timestamp:
Mar 27, 1997, 11:28:51 AM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
ddbd52d9793a0ad6b9a8810352e986750b07488b
Parents:
68873b1078dfc6dbd821efacf909f29bc8ed2048
Message:
error check changed to ASSERT


git-svn-id: file:///usr/local/Singular/svn/trunk@110 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/templates/ftmpl_array.cc

    r68873b r0bf9a2  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: ftmpl_array.cc,v 1.1 1996-07-16 12:24:56 stobbe Exp $
     2// $Id: ftmpl_array.cc,v 1.2 1997-03-27 10:28:51 schmidt Exp $
    33
    44/*
    55$Log: not supported by cvs2svn $
     6Revision 1.1  1996/07/16 12:24:56  stobbe
     7"operators += and *= deleted sincethey are not needed in an general
     8array class als well as the functions sum, prod, crossprod.
     9"
     10
    611Revision 1.0  1996/05/17 11:06:32  stobbe
    712Initial revision
    813
    914*/
     15
     16#include <templates/assert.h>
    1017
    1118#include <templates/array.h>
     
    93100T& Array<T>::operator[] ( int i ) const
    94101{
    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];
    101104}
    102105
     
    139142Array<T>& Array<T>::operator+= ( const Array<T> & a )
    140143{
    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];
    146147    return *this;
    147148}
    148149*/
    149150
     151#ifndef NOSTREAMIO
    150152template <class T>
    151153void Array<T>::print ( ostream & os ) const
     
    167169    return os;
    168170}
    169 
     171#endif /* NOSTREAMIO */
Note: See TracChangeset for help on using the changeset viewer.