X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Finclude%2Fmatrix.h;h=2dbd7a90be93c80cb5270cbd368a04e3ef8b318d;hb=11fb2128dca305d77b8a852f46bbb5b173cb27df;hp=9689f5968abecca9da9951b55c0f06cd2c008790;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/include/matrix.h b/lib/maracasVisuLib/include/matrix.h index 9689f59..2dbd7a9 100644 --- a/lib/maracasVisuLib/include/matrix.h +++ b/lib/maracasVisuLib/include/matrix.h @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# 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 @@ -50,11 +75,11 @@ namespace gtm */ //@{ /// 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. @@ -87,15 +112,15 @@ namespace gtm //@} /// 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. @@ -178,9 +203,9 @@ namespace gtm /// Memory block. T** _matrix; /// Columns. - uint _N; + uint32_t _N; /// Rows. - uint _M; + uint32_t _M; //@} }; @@ -189,7 +214,7 @@ namespace gtm 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 ); @@ -211,7 +236,7 @@ namespace gtm // ----------------------------------------------------------------------------- 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; @@ -232,7 +257,7 @@ namespace gtm // ----------------------------------------------------------------------------- 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; @@ -260,8 +285,8 @@ namespace gtm 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 ); @@ -286,7 +311,7 @@ namespace gtm template< class T > bool TMatrix< T >::operator==( const TMatrix< T >& r ) { - uint i, j; + uint32_t i, j; bool ret; for( @@ -306,7 +331,7 @@ namespace gtm template< class T > bool TMatrix< T >::operator!=( const TMatrix< T >& r ) { - uint i, j; + uint32_t i, j; bool ret; for( @@ -393,7 +418,7 @@ namespace gtm 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++ );