Menu

How can make CMat support float type?

Yang Yang
2007-01-27
2012-09-15
  • Yang Yang

    Yang Yang - 2007-01-27

    The cmat use double as default. However, I want to use float, so I want to knwo is there anyway to restrict the type to float. It seems the cvec also cannot support float.

    Is there anyway to solve the problem?

     
    • Adam Piątyszek

      Adam Piątyszek - 2007-01-27

      Have you tried to use Mat<complex<float> > and Vec<complex<float >? You can typedef them if you want to something shorter, e.g.:
      typedef Mat<complex<float> > cfmat;
      typedef Vec<complex<float> > cfvec;

      BR,
      /ediap

       
    • Yang Yang

      Yang Yang - 2007-01-28

      I know this, but all routines in itpp seems only support the double version of cmat and cvec.

      By useing typedef means I have to make those functions support the float version also.

      Why the itpp didn't have built-in support to float version routines?

       
      • Adam Piątyszek

        Adam Piątyszek - 2007-01-28

        > Why the itpp didn't have built-in support to float version routines?

        Because, IT++ developers have not envisioned the need for supporting the float type. Now it is very difficult to change this, because all routines that use complex-based types would have to be implemented as templated routines. The same situation is for double -> float conversion.

        BTW, why complex<double> is not acceptable for you and you need complex<float>?

        BR,
        /ediap

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.