square root of a matrix

This is a discussion on square root of a matrix within the C Programming forums, part of the General Programming Boards category; Hi, I want to find the square root of a matrix in C. I know there is command like "dpotrf" ...

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    16

    square root of a matrix

    Hi,
    I want to find the square root of a matrix in C. I know there is command like "dpotrf" in C to find the cholesky decomposition, which gives us X, where XX' = A. But this method fails when A is positive semidefinite or negative definite. However, there is a command "sqrtm" in MATLAB which gives the square root of even a positive semidefinite or negative definite matrix such that YY = A, where Y is the square root of matrix A. Is there any thing similar to "sqrtm" in C???

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Once you write it, there will be.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    > I know there is command like "dpotrf" in C to find the cholesky decomposition
    No there isn't.
    What there is is a library with a 'C' interface you can call from your C programs,

    > However, there is a command "sqrtm" in MATLAB
    So use a matlab C library binding then
    matlab c api - Google Search
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Square Root ?!?
    By Tm687 in forum C++ Programming
    Replies: 1
    Last Post: 02-29-2004, 03:38 PM
  2. Square Root
    By Kyoto Oshiro in forum C++ Programming
    Replies: 5
    Last Post: 09-05-2002, 01:22 AM
  3. Square root
    By Unregistered in forum C Programming
    Replies: 8
    Last Post: 07-05-2002, 06:35 AM
  4. Square Root??
    By Dangerous Dave in forum C Programming
    Replies: 5
    Last Post: 10-18-2001, 10:34 PM
  5. square root
    By help in forum C Programming
    Replies: 5
    Last Post: 08-29-2001, 05:46 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21