00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef THYRA_SERIAL_VECTOR_SPACE_CONVERTED_BASE_HPP
00030 #define THYRA_SERIAL_VECTOR_SPACE_CONVERTED_BASE_HPP
00031
00032 #include "Thyra_SerialVectorSpaceConverterBaseDecl.hpp"
00033 #include "Thyra_MultiVectorBase.hpp"
00034 #include "Thyra_DetachedMultiVectorView.hpp"
00035 #include "Teuchos_Workspace.hpp"
00036 #include "Teuchos_TestForException.hpp"
00037
00038 namespace Thyra {
00039
00040 template<class ScalarFrom, class ScalarTo>
00041 void SerialVectorSpaceConverterBase<ScalarFrom,ScalarTo>::convert(
00042 const MultiVectorBase<ScalarFrom> &mv_from
00043 ,MultiVectorBase<ScalarTo> *mv_to
00044 ) const
00045 {
00046 #ifdef TEUCHOS_DEBUG
00047 TEST_FOR_EXCEPT(mv_to==NULL);
00048 #endif
00049 ConstDetachedMultiVectorView<ScalarFrom> emv_from(mv_from);
00050 DetachedMultiVectorView<ScalarTo> emv_to(*mv_to);
00051 #ifdef TEUCHOS_DEBUG
00052 TEST_FOR_EXCEPT(emv_from.subDim() != emv_to.subDim());
00053 TEST_FOR_EXCEPT(emv_from.numSubCols() != emv_to.numSubCols());
00054 #endif
00055 for( Index j = 0; j < emv_from.numSubCols(); ++j ) {
00056 for( Index i = 0; i < emv_from.subDim(); ++i ) {
00057 emv_to(i,j) = emv_from(i,j);
00058 }
00059 }
00060 }
00061
00062 }
00063
00064 #endif // THYRA_SERIAL_VECTOR_SPACE_CONVERTED_BASE_HPP