/usr/include/singular/factory/templates/ftmpl_matrix.h is in libsingular4-dev-common 4.0.3+ds-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | /* emacs edit mode for this file is -*- C++ -*- */
#ifndef INCL_MATRIX_H
#define INCL_MATRIX_H
// #include <factory/factoryconf.h>
#ifndef NOSTREAMIO
#ifdef HAVE_IOSTREAM
#include <iostream>
#define OSTREAM std::ostream
#elif defined(HAVE_IOSTREAM_H)
#include <iostream.h>
#define OSTREAM ostream
#endif
#endif /* NOSTREAMIO */
template <class T>
class SubMatrix;
template <class T>
class Matrix;
#ifndef NOSTREAMIO
template <class T>
OSTREAM& operator<< (OSTREAM &, const Matrix<T> &);
#endif
template <class T>
class Matrix
{
private:
int NR, NC;
T ** elems;
#ifndef NOSTREAMIO
void printrow ( OSTREAM & s, int i ) const;
#endif /* NOSTREAMIO */
typedef T* T_ptr;
public:
Matrix() : NR(0), NC(0), elems(0) {}
Matrix( int nr, int nc );
Matrix( const Matrix<T>& M );
~Matrix();
Matrix<T>& operator= ( const Matrix<T>& M );
int rows() const { return NR; }
int columns() const { return NC; }
SubMatrix<T> operator[] ( int i );
const SubMatrix<T> operator[] ( int i ) const;
T& operator() ( int row, int col );
T operator() ( int row, int col ) const;
SubMatrix<T> operator() ( int rmin, int rmax, int cmin, int cmax );
const SubMatrix<T> operator() ( int rmin, int rmax, int cmin, int cmax ) const;
void swapRow( int i, int j );
void swapColumn( int i, int j );
#ifndef NOSTREAMIO
void print( OSTREAM& s ) const;
friend OSTREAM & operator<< <T>( OSTREAM & s, const Matrix<T>& M );
#endif /* NOSTREAMIO */
friend class SubMatrix<T>;
};
/*template <class T>
Matrix<T> operator+ ( const Matrix<T>& lhs, const Matrix<T>& rhs );
template <class T>
Matrix<T> operator- ( const Matrix<T>& lhs, const Matrix<T>& rhs );
template <class T>
Matrix<T> operator* ( const Matrix<T>& lhs, const Matrix<T>& rhs );
template <class T>
Matrix<T> operator* ( const Matrix<T>& lhs, const T& rhs );
template <class T>
Matrix<T> operator* ( const T& lhs, const Matrix<T>& rhs );*/
template <class T>
class SubMatrix
{
private:
int r_min, r_max, c_min, c_max;
Matrix<T>& M;
// we do not provide a default ctor, so nobody can declare an empty SubMatrix
SubMatrix( int rmin, int rmax, int cmin, int cmax, const Matrix<T> & m );
public:
SubMatrix( const SubMatrix<T> & S );
SubMatrix<T>& operator= ( const SubMatrix<T>& S );
SubMatrix<T>& operator= ( const Matrix<T>& S );
operator Matrix<T>() const;
T operator[] ( int i ) const;
T& operator[] ( int i );
friend class Matrix<T>;
};
#ifndef NOSTREAMIO
template <class T>
OSTREAM & operator<< ( OSTREAM & s, const Matrix<T>& M );
#endif /* NOSTREAMIO */
#endif /* ! INCL_MATRIX_H */
|