heev

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

heev

Chris Rodgers-3
Dear All,

I am trying to update some code from v1 to the latest numeric bindings,
but cannot see how to make heev() work.

I attach a small test program, which I attempted to compile with Visual
Studio 2010 SP1 on Windows XP 32-bit, with boost 1.51 and the last
revision in the boost SVN repository for the numeric bindings.

Compilation fails with the error message below.

Please could someone advise me how to get this running?

Any help would be much appreciated.

Best wishes,

Chris.

> 1>------ Build started: Project: testBoostJan2014, Configuration:
> Debug Win32 ------
> 1>Build started 23/01/2014 16:25:02.
> 1>InitializeBuildStatus:
> 1>  Touching "Debug\testBoostJan2014.unsuccessfulbuild".
> 1>ClCompile:
> 1>  testBoostJan2014.cpp
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\uplo_tag.hpp(56):
> error C2039: 'type' : is not a member of
> 'boost::numeric::bindings::detail::uplo_tag_impl<DataSide,TransTag>'
> 1>          with
> 1>          [
> 1>              DataSide=boost::mpl::void_,
> 1> TransTag=boost::numeric::bindings::tag::no_transpose
> 1>          ]
> 1>          c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(282)
> : see reference to class template instantiation
> 'boost::numeric::bindings::result_of::uplo_tag<T>' being compiled
> 1>          with
> 1>          [
> 1>              T=cmat
> 1>          ]
> 1>          c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(331)
> : see reference to function template instantiation 'ptrdiff_t
> boost::numeric::bindings::lapack::heev_impl<Value>::invoke<MatrixA,VectorW>(const
> char,MatrixA &,VectorW
> &,boost::numeric::bindings::lapack::optimal_workspace)' being compiled
> 1>          with
> 1>          [
> 1>              Value=std::complex<double>,
> 1>              MatrixA=cmat,
> 1>              VectorW=vec
> 1>          ]
> 1>
> c:\midea\n4_vb17a_latest_20090307\n4\pkg\mrservers\mrspecacq\ice\icespectro_wsvd_v4\testboostjan2014\testboostjan2014.cpp(64)
> : see reference to function template instantiation '__w64 int
> boost::numeric::bindings::lapack::heev<cmat,vec,boost::numeric::bindings::lapack::optimal_workspace>(const
> char,MatrixA &,VectorW &,Workspace)' being compiled
> 1>          with
> 1>          [
> 1>              MatrixA=cmat,
> 1>              VectorW=vec,
> 1> Workspace=boost::numeric::bindings::lapack::optimal_workspace
> 1>          ]
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(286):
> error C2955: 'boost::type' : use of class template requires template
> argument list
> 1>          c:\program files\boost\boost_1_51\boost\type.hpp(14) : see
> declaration of 'boost::type'
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
> error C2780: 'ptrdiff_t
> boost::numeric::bindings::lapack::detail::heev(const char,const
> UpLo,const fortran_int_t,double *,const fortran_int_t,double *,double
> *,const fortran_int_t)' : expects 8 arguments - 9 provided
> 1>          c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(74)
> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
> error C2780: 'ptrdiff_t
> boost::numeric::bindings::lapack::detail::heev(const char,const
> UpLo,const fortran_int_t,float *,const fortran_int_t,float *,float
> *,const fortran_int_t)' : expects 8 arguments - 9 provided
> 1>          c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(59)
> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
> 1>
> 1>Build FAILED.
> 1>
> 1>Time Elapsed 00:00:08.50
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==========

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]

testBoostJan2014.cpp (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: heev

Thomas Klimpel-2
Hi Chris,

your problem is that you don't know how to specify whether upper or lower half of the matrix should be used.

You should decide which one to use, and then define either
> typedef ublas::hermitian_adaptor<cmat, ublas::upper> hermitian_type;
or
> typedef ublas::hermitian_adaptor<cmat, ublas::lower> hermitian_type;
then wrap the matrix eigVec into the adapter via
> hermitian_type eigVec_h(eigVec);
and call heev as
> heev('V',eigVec_h,eigVal);
or
> heev('V',eigVec_h,eigVal,boost::numeric::bindings::lapack::optimal_workspace());
if you prefer to be explicit about the workspace.

I just compared your code with the test from
<https://svn.boost.org/svn/boost/sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp>
so maybe there are more things that need to get modified. However, this should at least fix your current error message.

Regards,
Thomas Klimpel
 
 

Gesendet: Donnerstag, 23. Januar 2014 um 17:31 Uhr
Von: "Chris Rodgers" <[hidden email]>
An: [hidden email]
Betreff: [ublas] heev
Dear All,

I am trying to update some code from v1 to the latest numeric bindings,
but cannot see how to make heev() work.

I attach a small test program, which I attempted to compile with Visual
Studio 2010 SP1 on Windows XP 32-bit, with boost 1.51 and the last
revision in the boost SVN repository for the numeric bindings.

Compilation fails with the error message below.

Please could someone advise me how to get this running?

Any help would be much appreciated.

Best wishes,

Chris.

> 1>------ Build started: Project: testBoostJan2014, Configuration:
> Debug Win32 ------
> 1>Build started 23/01/2014 16:25:02.
> 1>InitializeBuildStatus:
> 1> Touching "Debug\testBoostJan2014.unsuccessfulbuild".
> 1>ClCompile:
> 1> testBoostJan2014.cpp
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\uplo_tag.hpp(56):
> error C2039: 'type' : is not a member of
> 'boost::numeric::bindings::detail::uplo_tag_impl<DataSide,TransTag>'
> 1> with
> 1> [
> 1> DataSide=boost::mpl::void_,
> 1> TransTag=boost::numeric::bindings::tag::no_transpose
> 1> ]
> 1> c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(282)
> : see reference to class template instantiation
> 'boost::numeric::bindings::result_of::uplo_tag<T>' being compiled
> 1> with
> 1> [
> 1> T=cmat
> 1> ]
> 1> c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(331)
> : see reference to function template instantiation 'ptrdiff_t
> boost::numeric::bindings::lapack::heev_impl<Value>::invoke<MatrixA,VectorW>(const
> char,MatrixA &,VectorW
> &,boost::numeric::bindings::lapack::optimal_workspace)' being compiled
> 1> with
> 1> [
> 1> Value=std::complex<double>,
> 1> MatrixA=cmat,
> 1> VectorW=vec
> 1> ]
> 1>
> c:\midea\n4_vb17a_latest_20090307\n4\pkg\mrservers\mrspecacq\ice\icespectro_wsvd_v4\testboostjan2014\testboostjan2014.cpp(64)
> : see reference to function template instantiation '__w64 int
> boost::numeric::bindings::lapack::heev<cmat,vec,boost::numeric::bindings::lapack::optimal_workspace>(const
> char,MatrixA &,VectorW &,Workspace)' being compiled
> 1> with
> 1> [
> 1> MatrixA=cmat,
> 1> VectorW=vec,
> 1> Workspace=boost::numeric::bindings::lapack::optimal_workspace
> 1> ]
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(286):
> error C2955: 'boost::type' : use of class template requires template
> argument list
> 1> c:\program files\boost\boost_1_51\boost\type.hpp(14) : see
> declaration of 'boost::type'
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
> error C2780: 'ptrdiff_t
> boost::numeric::bindings::lapack::detail::heev(const char,const
> UpLo,const fortran_int_t,double *,const fortran_int_t,double *,double
> *,const fortran_int_t)' : expects 8 arguments - 9 provided
> 1> c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(74)
> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
> 1>c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
> error C2780: 'ptrdiff_t
> boost::numeric::bindings::lapack::detail::heev(const char,const
> UpLo,const fortran_int_t,float *,const fortran_int_t,float *,float
> *,const fortran_int_t)' : expects 8 arguments - 9 provided
> 1> c:\program
> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(59)
> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
> 1>
> 1>Build FAILED.
> 1>
> 1>Time Elapsed 00:00:08.50
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==========

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: heev

Rutger ter Borg-2

Hey Thomas,

it seems that bindings::upper and bindings::lower don't work with
Hermitian types, is that correct? i.e., in principle,

heev( 'V', bindings::lower(eigVec), eigVal )
heev( 'V', bindings::upper(eigVec), eigVal )

should also work, shouldn't it?

Cheers,

Rutger





On 2014-01-23 18:05, Thomas Klimpel wrote:

> Hi Chris,
>
> your problem is that you don't know how to specify whether upper or lower half of the matrix should be used.
>
> You should decide which one to use, and then define either
>> typedef ublas::hermitian_adaptor<cmat, ublas::upper> hermitian_type;
> or
>> typedef ublas::hermitian_adaptor<cmat, ublas::lower> hermitian_type;
> then wrap the matrix eigVec into the adapter via
>> hermitian_type eigVec_h(eigVec);
> and call heev as
>> heev('V',eigVec_h,eigVal);
> or
>> heev('V',eigVec_h,eigVal,boost::numeric::bindings::lapack::optimal_workspace());
> if you prefer to be explicit about the workspace.
>
> I just compared your code with the test from
> <https://svn.boost.org/svn/boost/sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp>
> so maybe there are more things that need to get modified. However, this should at least fix your current error message.
>
> Regards,
> Thomas Klimpel
>
>
>
> Gesendet: Donnerstag, 23. Januar 2014 um 17:31 Uhr
> Von: "Chris Rodgers" <[hidden email]>
> An: [hidden email]
> Betreff: [ublas] heev
> Dear All,
>
> I am trying to update some code from v1 to the latest numeric bindings,
> but cannot see how to make heev() work.
>
> I attach a small test program, which I attempted to compile with Visual
> Studio 2010 SP1 on Windows XP 32-bit, with boost 1.51 and the last
> revision in the boost SVN repository for the numeric bindings.
>
> Compilation fails with the error message below.
>
> Please could someone advise me how to get this running?
>
> Any help would be much appreciated.
>
> Best wishes,
>
> Chris.
>
>> 1>------ Build started: Project: testBoostJan2014, Configuration:
>> Debug Win32 ------
>> 1>Build started 23/01/2014 16:25:02.
>> 1>InitializeBuildStatus:
>> 1> Touching "Debug\testBoostJan2014.unsuccessfulbuild".
>> 1>ClCompile:
>> 1> testBoostJan2014.cpp
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\uplo_tag.hpp(56):
>> error C2039: 'type' : is not a member of
>> 'boost::numeric::bindings::detail::uplo_tag_impl<DataSide,TransTag>'
>> 1> with
>> 1> [
>> 1> DataSide=boost::mpl::void_,
>> 1> TransTag=boost::numeric::bindings::tag::no_transpose
>> 1> ]
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(282)
>> : see reference to class template instantiation
>> 'boost::numeric::bindings::result_of::uplo_tag<T>' being compiled
>> 1> with
>> 1> [
>> 1> T=cmat
>> 1> ]
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(331)
>> : see reference to function template instantiation 'ptrdiff_t
>> boost::numeric::bindings::lapack::heev_impl<Value>::invoke<MatrixA,VectorW>(const
>> char,MatrixA &,VectorW
>> &,boost::numeric::bindings::lapack::optimal_workspace)' being compiled
>> 1> with
>> 1> [
>> 1> Value=std::complex<double>,
>> 1> MatrixA=cmat,
>> 1> VectorW=vec
>> 1> ]
>> 1>
>> c:\midea\n4_vb17a_latest_20090307\n4\pkg\mrservers\mrspecacq\ice\icespectro_wsvd_v4\testboostjan2014\testboostjan2014.cpp(64)
>> : see reference to function template instantiation '__w64 int
>> boost::numeric::bindings::lapack::heev<cmat,vec,boost::numeric::bindings::lapack::optimal_workspace>(const
>> char,MatrixA &,VectorW &,Workspace)' being compiled
>> 1> with
>> 1> [
>> 1> MatrixA=cmat,
>> 1> VectorW=vec,
>> 1> Workspace=boost::numeric::bindings::lapack::optimal_workspace
>> 1> ]
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(286):
>> error C2955: 'boost::type' : use of class template requires template
>> argument list
>> 1> c:\program files\boost\boost_1_51\boost\type.hpp(14) : see
>> declaration of 'boost::type'
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
>> error C2780: 'ptrdiff_t
>> boost::numeric::bindings::lapack::detail::heev(const char,const
>> UpLo,const fortran_int_t,double *,const fortran_int_t,double *,double
>> *,const fortran_int_t)' : expects 8 arguments - 9 provided
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(74)
>> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
>> error C2780: 'ptrdiff_t
>> boost::numeric::bindings::lapack::detail::heev(const char,const
>> UpLo,const fortran_int_t,float *,const fortran_int_t,float *,float
>> *,const fortran_int_t)' : expects 8 arguments - 9 provided
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(59)
>> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
>> 1>
>> 1>Build FAILED.
>> 1>
>> 1>Time Elapsed 00:00:08.50
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>> ==========
>
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]
>


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: heev

Thomas Klimpel-2
Hi Rutger,
 
you are right,

heev( 'V', bindings::lower(eigVec), eigVal )
heev( 'V', bindings::upper(eigVec), eigVal )
 
will work, and is nicer than the solution I posted. I had just looked at the tests for heev without thinking about the nicest solution. The test passes ublas::lower and ublas::upper as template parameters, and hence uses the uglier version.
 
Regards,
Thomas
Gesendet: Donnerstag, 23. Januar 2014 um 22:12 Uhr
Von: "Rutger ter Borg" <[hidden email]>
An: [hidden email]
Betreff: Re: [ublas] heev

Hey Thomas,

it seems that bindings::upper and bindings::lower don't work with
Hermitian types, is that correct? i.e., in principle,

heev( 'V', bindings::lower(eigVec), eigVal )
heev( 'V', bindings::upper(eigVec), eigVal )

should also work, shouldn't it?

Cheers,

Rutger





On 2014-01-23 18:05, Thomas Klimpel wrote:
> Hi Chris,
>
> your problem is that you don't know how to specify whether upper or lower half of the matrix should be used.
>
> You should decide which one to use, and then define either
>> typedef ublas::hermitian_adaptor<cmat, ublas::upper> hermitian_type;
> or
>> typedef ublas::hermitian_adaptor<cmat, ublas::lower> hermitian_type;
> then wrap the matrix eigVec into the adapter via
>> hermitian_type eigVec_h(eigVec);
> and call heev as
>> heev('V',eigVec_h,eigVal);
> or
>> heev('V',eigVec_h,eigVal,boost::numeric::bindings::lapack::optimal_workspace());
> if you prefer to be explicit about the workspace.
>
> I just compared your code with the test from
> <https://svn.boost.org/svn/boost/sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp>
> so maybe there are more things that need to get modified. However, this should at least fix your current error message.
>
> Regards,
> Thomas Klimpel
>
>
>
> Gesendet: Donnerstag, 23. Januar 2014 um 17:31 Uhr
> Von: "Chris Rodgers" <[hidden email]>
> An: [hidden email]
> Betreff: [ublas] heev
> Dear All,
>
> I am trying to update some code from v1 to the latest numeric bindings,
> but cannot see how to make heev() work.
>
> I attach a small test program, which I attempted to compile with Visual
> Studio 2010 SP1 on Windows XP 32-bit, with boost 1.51 and the last
> revision in the boost SVN repository for the numeric bindings.
>
> Compilation fails with the error message below.
>
> Please could someone advise me how to get this running?
>
> Any help would be much appreciated.
>
> Best wishes,
>
> Chris.
>
>> 1>------ Build started: Project: testBoostJan2014, Configuration:
>> Debug Win32 ------
>> 1>Build started 23/01/2014 16:25:02.
>> 1>InitializeBuildStatus:
>> 1> Touching "Debug\testBoostJan2014.unsuccessfulbuild".
>> 1>ClCompile:
>> 1> testBoostJan2014.cpp
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\uplo_tag.hpp(56):
>> error C2039: 'type' : is not a member of
>> 'boost::numeric::bindings::detail::uplo_tag_impl<DataSide,TransTag>'
>> 1> with
>> 1> [
>> 1> DataSide=boost::mpl::void_,
>> 1> TransTag=boost::numeric::bindings::tag::no_transpose
>> 1> ]
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(282)
>> : see reference to class template instantiation
>> 'boost::numeric::bindings::result_of::uplo_tag<T>' being compiled
>> 1> with
>> 1> [
>> 1> T=cmat
>> 1> ]
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(331)
>> : see reference to function template instantiation 'ptrdiff_t
>> boost::numeric::bindings::lapack::heev_impl<Value>::invoke<MatrixA,VectorW>(const
>> char,MatrixA &,VectorW
>> &,boost::numeric::bindings::lapack::optimal_workspace)' being compiled
>> 1> with
>> 1> [
>> 1> Value=std::complex<double>,
>> 1> MatrixA=cmat,
>> 1> VectorW=vec
>> 1> ]
>> 1>
>> c:\midea\n4_vb17a_latest_20090307\n4\pkg\mrservers\mrspecacq\ice\icespectro_wsvd_v4\testboostjan2014\testboostjan2014.cpp(64)
>> : see reference to function template instantiation '__w64 int
>> boost::numeric::bindings::lapack::heev<cmat,vec,boost::numeric::bindings::lapack::optimal_workspace>(const
>> char,MatrixA &,VectorW &,Workspace)' being compiled
>> 1> with
>> 1> [
>> 1> MatrixA=cmat,
>> 1> VectorW=vec,
>> 1> Workspace=boost::numeric::bindings::lapack::optimal_workspace
>> 1> ]
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(286):
>> error C2955: 'boost::type' : use of class template requires template
>> argument list
>> 1> c:\program files\boost\boost_1_51\boost\type.hpp(14) : see
>> declaration of 'boost::type'
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
>> error C2780: 'ptrdiff_t
>> boost::numeric::bindings::lapack::detail::heev(const char,const
>> UpLo,const fortran_int_t,double *,const fortran_int_t,double *,double
>> *,const fortran_int_t)' : expects 8 arguments - 9 provided
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(74)
>> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
>> 1>c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(289):
>> error C2780: 'ptrdiff_t
>> boost::numeric::bindings::lapack::detail::heev(const char,const
>> UpLo,const fortran_int_t,float *,const fortran_int_t,float *,float
>> *,const fortran_int_t)' : expects 8 arguments - 9 provided
>> 1> c:\program
>> files\boost\numeric_bindings\boost\numeric\bindings\lapack\driver\heev.hpp(59)
>> : see declaration of 'boost::numeric::bindings::lapack::detail::heev'
>> 1>
>> 1>Build FAILED.
>> 1>
>> 1>Time Elapsed 00:00:08.50
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>> ==========
>
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]
>


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]