Loading src/solvers/linear/CMakeLists.txt +7 −2 Original line number Diff line number Diff line INCLUDE_DIRECTORIES( krylov ) ADD_SUBDIRECTORY( implementation ) ADD_SUBDIRECTORY( krylov ) ADD_SUBDIRECTORY( stationary ) SET( headers tnlLinearResidueGetter.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear ) No newline at end of file src/solvers/linear/implementation/CMakeLists.txt 0 → 100644 +4 −0 Original line number Diff line number Diff line SET( headers tnlLinearResidueGetter_impl.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/implementation ) src/solvers/linear/implementation/tnlLinearResidueGetter_impl.h 0 → 100644 +40 −0 Original line number Diff line number Diff line /*************************************************************************** tnlLinearResidueGetter_impl.h - description ------------------- begin : Nov 25, 2012 copyright : (C) 2012 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TNLLINEARRESIDUEGETTER_IMPL_H_ #define TNLLINEARRESIDUEGETTER_IMPL_H_ template< typename Matrix, typename Vector > typename tnlLinearResidueGetter :: RealType tnlResidueGetter< Matrix, Vector > :: getResidue( const Matrix& matrix, const Vector& x, const Vector& b, RealType bNorm ) { const IndexType size = matrix. getSize(); RealType res( 0.0 ); if( bNorm == 0.0 ) bNorm = b. lpNorm( 2.0 ); for( IndexType i = 0; i < size; i ++ ) { RealType err = fabs( matrix. rowProduct( i, x ) - b[ i ] ); res += err * err; } return sqrt( res ) / b_norm; } #endif /* TNLLINEARRESIDUEGETTER_IMPL_H_ */ src/solvers/linear/krylov/CMakeLists.txt +3 −1 Original line number Diff line number Diff line ADD_SUBDIRECTORY( implementation ) SET( headers tnlGMRESSolver.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solver ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov ) src/solvers/linear/krylov/implementation/CMakeLists.txt 0 → 100644 +4 −0 Original line number Diff line number Diff line SET( headers tnlGMRESSolver_impl.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov/implementation ) Loading
src/solvers/linear/CMakeLists.txt +7 −2 Original line number Diff line number Diff line INCLUDE_DIRECTORIES( krylov ) ADD_SUBDIRECTORY( implementation ) ADD_SUBDIRECTORY( krylov ) ADD_SUBDIRECTORY( stationary ) SET( headers tnlLinearResidueGetter.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear ) No newline at end of file
src/solvers/linear/implementation/CMakeLists.txt 0 → 100644 +4 −0 Original line number Diff line number Diff line SET( headers tnlLinearResidueGetter_impl.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/implementation )
src/solvers/linear/implementation/tnlLinearResidueGetter_impl.h 0 → 100644 +40 −0 Original line number Diff line number Diff line /*************************************************************************** tnlLinearResidueGetter_impl.h - description ------------------- begin : Nov 25, 2012 copyright : (C) 2012 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TNLLINEARRESIDUEGETTER_IMPL_H_ #define TNLLINEARRESIDUEGETTER_IMPL_H_ template< typename Matrix, typename Vector > typename tnlLinearResidueGetter :: RealType tnlResidueGetter< Matrix, Vector > :: getResidue( const Matrix& matrix, const Vector& x, const Vector& b, RealType bNorm ) { const IndexType size = matrix. getSize(); RealType res( 0.0 ); if( bNorm == 0.0 ) bNorm = b. lpNorm( 2.0 ); for( IndexType i = 0; i < size; i ++ ) { RealType err = fabs( matrix. rowProduct( i, x ) - b[ i ] ); res += err * err; } return sqrt( res ) / b_norm; } #endif /* TNLLINEARRESIDUEGETTER_IMPL_H_ */
src/solvers/linear/krylov/CMakeLists.txt +3 −1 Original line number Diff line number Diff line ADD_SUBDIRECTORY( implementation ) SET( headers tnlGMRESSolver.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solver ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov )
src/solvers/linear/krylov/implementation/CMakeLists.txt 0 → 100644 +4 −0 Original line number Diff line number Diff line SET( headers tnlGMRESSolver_impl.h ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov/implementation )