+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
////////////////////////////////////////////////////////////////////////////////
// matrix.h
// Creation : 19/03/2000
*/
//@{
/// Default constructor.
- TMatrix( uint N = 3, uint M = 3, T data = ( T )0 );
+ TMatrix( uint32_t N = 3, uint32_t M = 3, T data = ( T )0 );
/// Copy constructor.
TMatrix( const TMatrix< T >& r );
/// ANSI casting constructor.
- TMatrix( T** block, uint N, uint M );
+ TMatrix( T** block, uint32_t N, uint32_t M );
//@}
/// Destructor.
//@}
/// Reference operator.
- T& operator()( uint i, uint j ) {
+ T& operator()( uint32_t i, uint32_t j ) {
return( _matrix[ i ][ j ] );
};
/// Columns
- uint GetN( ) {
+ uint32_t GetN( ) {
return( _N );
};
/// Rows
- uint GetM( ) {
+ uint32_t GetM( ) {
return( _M );
};
/// Returns the ANSI (C/C++) reference.
/// Memory block.
T** _matrix;
/// Columns.
- uint _N;
+ uint32_t _N;
/// Rows.
- uint _M;
+ uint32_t _M;
//@}
};
template< class T >
TVector< T >& TVector< T >::operator=( TMatrix< T >& r )
{
- uint i, j, k, min;
+ uint32_t i, j, k, min;
// This min calc. avoids to reserve temporary memory, so, be careful.
min = GTM_MIN( r.GetN( ) * r.GetM( ), _N );
// -----------------------------------------------------------------------------
template< class T >
- TMatrix< T >::TMatrix( uint N, uint M, T data )
+ TMatrix< T >::TMatrix( uint32_t N, uint32_t M, T data )
{
_N = N;
_M = M;
// -----------------------------------------------------------------------------
template< class T >
- TMatrix< T >::TMatrix( T** block, uint N, uint M )
+ TMatrix< T >::TMatrix( T** block, uint32_t N, uint32_t M )
{
_N = N;
_M = M;
template< class T >
TMatrix< T >& TMatrix< T >::operator=( TVector< T >& r )
{
- uint i;
- uint n = r.GetN( );
+ uint32_t i;
+ uint32_t n = r.GetN( );
bool column = ( r.GetType( ) == COL_VECTOR );
MatrixFreeMemory< T >( _matrix, _N );
template< class T >
bool TMatrix< T >::operator==( const TMatrix< T >& r )
{
- uint i, j;
+ uint32_t i, j;
bool ret;
for(
template< class T >
bool TMatrix< T >::operator!=( const TMatrix< T >& r )
{
- uint i, j;
+ uint32_t i, j;
bool ret;
for(
TMatrix< T > TMatrix< T >::operator-( )
{
TMatrix< T > ret( _N, _M );
- uint i, j;
+ uint32_t i, j;
for( i = 0; i < _N; i++ )
for( j = 0; j < _M; ret._matrix[ i ][ j ] = ( T )0 - _matrix[ i ][ j ], j++ );