Yurttas/PL/OOL/Cplusplus/F/03/02/03/01/matrix.h

From ZCubes Wiki
Revision as of 23:14, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : January 1, 1998.
11   author : Salih Yurttas.
12
13   matrix.h
14*/
15
16
17class matrix {
18public:
19  matrix(const int,
20         const int);
21  matrix(const matrix&);
22
23  ~matrix();
24
25  matrix& operator=(const matrix&);
26
27  matrix& operator+=(const matrix&);
28  matrix& operator-=(const matrix&);
29  matrix& operator*=(const matrix&);
30
31  friend matrix operator+(const matrix&,
32                          const matrix&);
33  friend matrix operator-(const matrix&,
34                          const matrix&);
35  friend matrix operator*(const matrix&,
36                          const matrix&);
37
38  friend matrix operator*(const int,
39                          const matrix&);
40  friend matrix operator*(const matrix&,
41                          const int);
42
43  int retrieve_element(const int,
44                       const int) const;
45  void assign_element(const int, 
46                      const int,
47                      const int);
48
49  void negate();
50 
51  void put_matrix() const;
52
53private:
54  int r_size,
55      c_size;
56  int **m;
57};