Errpr in using norm function

  • Furqan

    Furqan - 2013-07-08

    Hi Everybody, I am a newb in IT++. But I found a really strange problem for two months . I used the norm function in IT++.but following problem

    i want to use vec norm(itpp::cmat&)

    error: no matching function for call to ‘norm(itpp::Vec<std::complex<double> >)

    error:no known conversion for argument 1 from ‘itpp::Vec<std::complex<double> >’ to ‘itpp::cmat& {aka itpp::Mat<std::complex<double> >&}’

  • Bogdan Cristea

    Bogdan Cristea - 2013-07-08

    The following code compiles and runs fine with IT++ 4.3.1 on Win 8 64 bits with MKL

    #include <itpp itbase.h="">

    #include <itpp itstat.h="">

    using namespace itpp;

    using namespace std;

    int main() {

    cmat m = "1.0+1i 2.0+3.0i; 1.0+1i 2.0+1i";

    double n = norm(m);

    cout << n << endl;


    Last edit: Bogdan Cristea 2013-07-08
    • Furqan

      Furqan - 2013-07-09

      Sir,Thanx alot..
      Dear Sir is it possible that return data type is of vec typr instead of double....want to use vec norm(itpp::cmat&)

  • Bogdan Cristea

    Bogdan Cristea - 2013-07-09

    If you want to compute the norm on each column or row you need to use a for loop and compute the norm for each column or row as:
    row_norm(i) = norm(m.get_row(i));


Log in to post a comment.