My Project
Loading...
Searching...
No Matches
factory
include
factory
templates
ftmpl_matrix.h
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
#ifndef INCL_MATRIX_H
4
#define INCL_MATRIX_H
5
6
#ifndef NOSTREAMIO
7
#ifdef HAVE_IOSTREAM
8
#include <iostream>
9
#define OSTREAM std::ostream
10
#elif defined(HAVE_IOSTREAM_H)
11
#include <iostream.h>
12
#define OSTREAM ostream
13
#endif
14
#endif
/* NOSTREAMIO */
15
16
template
<
class
T>
17
class
SubMatrix
;
18
19
template
<
class
T>
20
class
Matrix
;
21
22
#ifndef NOSTREAMIO
23
template
<
class
T>
24
OSTREAM
&
operator<<
(
OSTREAM
&,
const
Matrix<T>
&);
25
#endif
26
27
template
<
class
T>
28
class
FACTORY_PUBLIC
Matrix
29
{
30
private
:
31
int
NR,
NC
;
32
T
**
elems
;
33
#ifndef NOSTREAMIO
34
void
printrow (
OSTREAM
&
s
,
int
i
)
const
;
35
#endif
/* NOSTREAMIO */
36
typedef
T
*
T_ptr
;
37
public
:
38
Matrix
() : NR(0), NC(0), elems(0) {}
39
Matrix
(
int
nr,
int
nc );
40
Matrix
(
const
Matrix<T>
&
M
);
41
~Matrix
();
42
Matrix<T>
&
operator=
(
const
Matrix<T>
&
M
);
43
int
rows
()
const
{
return
NR; }
44
int
columns
()
const
{
return
NC; }
45
SubMatrix<T>
operator[]
(
int
i
);
46
const
SubMatrix<T>
operator[]
(
int
i
)
const
;
47
T
&
operator()
(
int
row,
int
col );
48
T
operator()
(
int
row,
int
col )
const
;
49
SubMatrix<T>
operator()
(
int
rmin
,
int
rmax
,
int
cmin
,
int
cmax
);
50
const
SubMatrix<T>
operator()
(
int
rmin
,
int
rmax
,
int
cmin
,
int
cmax
)
const
;
51
void
swapRow(
int
i
,
int
j
);
52
void
swapColumn(
int
i
,
int
j
);
53
#ifndef NOSTREAMIO
54
void
print(
OSTREAM
&
s
)
const
;
55
friend
OSTREAM
&
operator<< <T>
(
OSTREAM
&
s
,
const
Matrix<T>
&
M
);
56
#endif
/* NOSTREAMIO */
57
friend
class
SubMatrix
<
T
>;
58
};
59
/*template <class T>
60
Matrix<T> operator+ ( const Matrix<T>& lhs, const Matrix<T>& rhs );
61
template <class T>
62
Matrix<T> operator- ( const Matrix<T>& lhs, const Matrix<T>& rhs );
63
template <class T>
64
Matrix<T> operator* ( const Matrix<T>& lhs, const Matrix<T>& rhs );
65
template <class T>
66
Matrix<T> operator* ( const Matrix<T>& lhs, const T& rhs );
67
template <class T>
68
Matrix<T> operator* ( const T& lhs, const Matrix<T>& rhs );*/
69
70
template
<
class
T>
71
class
SubMatrix
72
{
73
private
:
74
int
r_min
,
r_max
,
c_min
,
c_max
;
75
Matrix<T>
&
M
;
76
// we do not provide a default ctor, so nobody can declare an empty SubMatrix
77
SubMatrix
(
int
rmin
,
int
rmax
,
int
cmin
,
int
cmax
,
const
Matrix<T>
&
m
);
78
public
:
79
SubMatrix
(
const
SubMatrix<T>
& S );
80
SubMatrix<T>
&
operator=
(
const
SubMatrix<T>
& S );
81
SubMatrix<T>
&
operator=
(
const
Matrix<T>
& S );
82
operator
Matrix<T>
()
const
;
83
T
operator[]
(
int
i
)
const
;
84
T
&
operator[]
(
int
i
);
85
friend
class
Matrix
<
T
>;
86
};
87
88
#ifndef NOSTREAMIO
89
template
<
class
T>
90
OSTREAM
&
operator<<
(
OSTREAM
&
s
,
const
Matrix<T>
&
M
);
91
#endif
/* NOSTREAMIO */
92
93
#endif
/* ! INCL_MATRIX_H */
OSTREAM
#define OSTREAM
Definition
canonicalform.h:16
m
int m
Definition
cfEzgcd.cc:128
i
int i
Definition
cfEzgcd.cc:132
List
Definition
ftmpl_list.h:52
Matrix
Definition
ftmpl_matrix.h:29
Matrix::T_ptr
T * T_ptr
Definition
ftmpl_matrix.h:36
Matrix::rows
int rows() const
Definition
ftmpl_matrix.h:43
Matrix::elems
T ** elems
Definition
ftmpl_matrix.h:32
Matrix::Matrix
Matrix()
Definition
ftmpl_matrix.h:38
Matrix::NC
int NC
Definition
ftmpl_matrix.h:31
Matrix::columns
int columns() const
Definition
ftmpl_matrix.h:44
SubMatrix
Definition
ftmpl_matrix.h:72
SubMatrix::Matrix< T >
friend class Matrix< T >
Definition
ftmpl_matrix.h:85
SubMatrix::r_max
int r_max
Definition
ftmpl_matrix.h:74
SubMatrix::c_min
int c_min
Definition
ftmpl_matrix.h:74
SubMatrix::c_max
int c_max
Definition
ftmpl_matrix.h:74
SubMatrix::operator[]
T operator[](int i) const
Definition
ftmpl_matrix.cc:299
SubMatrix::operator=
SubMatrix< T > & operator=(const SubMatrix< T > &S)
Definition
ftmpl_matrix.cc:250
SubMatrix::M
Matrix< T > & M
Definition
ftmpl_matrix.h:75
SubMatrix::r_min
int r_min
Definition
ftmpl_matrix.h:74
s
const CanonicalForm int s
Definition
facAbsFact.cc:51
j
int j
Definition
facHensel.cc:110
operator<<
OSTREAM & operator<<(OSTREAM &, const Matrix< T > &)
Definition
ftmpl_matrix.cc:314
OSTREAM
#define OSTREAM
Definition
ftmpl_matrix.h:9
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition
globaldefs.h:25
T
STATIC_VAR jList * T
Definition
janet.cc:30
M
#define M
Definition
sirandom.c:25
Generated on Sat Apr 27 2024 21:48:23 for My Project by
doxygen 1.9.8
for
Singular