From: Peter Vanroose <peter_vanroose@ya...>  20101222 17:22:40

Sure: since the two square roots of a complex number c are the two solutions of the equation x^2  c = 0, you can use class vnl_cpoly_roots. Example: To find the two complex square roots of 3+4i (which are 2+i and 2i), compile&run the following: #include <vnl/algo/vnl_cpoly_roots.h> #include <vcl_iostream.h> int main() { vcl_complex<double> c(3.0,4.0); vnl_vector<vcl_complex<double> > equation(2); // Note: the coefficient in x^2 of the equation must be 1 // (not to be placed in the equation vector); // equation[0] is the second highest coefficient, etc. equation[0] = 0; equation[1] = c; vnl_cpoly_roots r(equation); vcl_cout << "First square root of 3+4i is " << r.solns[0] << "\nSecond square root is " << r.solns[1] << vcl_endl; return 0; }  Peter.   Den ons 20101222 skrev Martin Reuter <mreuter@...>: > Från: Martin Reuter <mreuter@...> > Ämne: [Vxlusers] complex squareroot? > Till: vxlusers@... > Datum: onsdag 22 december 2010 01:40 > Hi, > > is there a way to compute a squareroot of a complex number > in vnl? > > Actually what I am trying to achieve is to use > vnl_complex_eigensystem > on a real matrix to compute eigenvectors and complex > eigenvalues, then > compute the squareroot of the eigenvalues and finally the > squareroot of > the original matrix. Of course it would be nice to have a > sqrtm > functions (see matlab) to do all this for me. > > > Thanks for any hints, Martin > > >  > Forrester recently released a report on the Return on > Investment (ROI) of > Google Apps. They found a 300% ROI, 38%56% cost savings, > and breakeven > within 7 months. Over 3 million businesses have gone > Google with Google Apps: > an online email calendar, and document program that's > accessible from your > browser. Read the Forrester report: http://p.sf.net/sfu/googleappssfnew > _______________________________________________ > Vxlusers mailing list > Vxlusers@... > https://lists.sourceforge.net/lists/listinfo/vxlusers > 