source: git/factory/templates/ftmpl_array.h @ 684544

spielwiese
Last change on this file since 684544 was 684544, checked in by Rüdiger Stobbe <stobbe@…>, 27 years ago
Initial revision git-svn-id: file:///usr/local/Singular/svn/trunk@7 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.2 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id: ftmpl_array.h,v 1.0 1996-05-17 11:06:32 stobbe Exp $
3
4#ifndef INCL_ARRAY_H
5#define INCL_ARRAY_H
6
7/*
8$Log: not supported by cvs2svn $
9*/
10
11#include <iostream.h>
12
13template <class T>
14class Array {
15private:
16    T * data;
17    int _min;
18    int _max;
19    int _size;
20public:
21    Array();
22    Array( const Array<T>& );
23    Array( int size );
24    Array( int min, int max );
25    ~Array();
26    Array<T>& operator= ( const Array<T>& );
27    T& operator[] ( int i ) const;
28    int size() const;
29    int min() const;
30    int max() const;
31    Array<T>& operator*= ( const T& );
32    Array<T>& operator+= ( const T& );
33    Array<T>& operator+= ( const Array<T>& );
34    void print ( ostream& ) const;
35};
36
37template <class T>
38ostream& operator<< ( ostream & os, const Array<T> & a );
39
40template <class T>
41T sum ( const Array<T>&, int f, int l );
42
43template <class T>
44T prod ( const Array<T>&, int f, int l );
45
46// and because HP CC does not support default arguments in templates:
47
48template <class T>
49T sum ( const Array<T>& );
50
51template <class T>
52T prod ( const Array<T>& );
53
54template <class T>
55T crossprod ( const Array<T>&, const Array<T>& );
56
57#endif /* INCL_ARRAY_H */
Note: See TracBrowser for help on using the repository browser.