Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8966283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:59:37+00:00 2026-06-15T16:59:37+00:00

I need to find a (approximate, numerical) solution to a Legendre polynomial . I

  • 0

I need to find a (approximate, numerical) solution to a Legendre polynomial. I tried several Java libraries, but none have what I am looking for (the closest is commons-math which even has code for finding the solutions in the Laguerre solver, but it does not expose the method). Is there an existing solution or do I need to implement my own?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:59:38+00:00Added an answer on June 15, 2026 at 4:59 pm

    You can use EJML (Efficient Java Matrix Library).

    Please find the below sample example for the same.

    public class PolynomialRootFinder {
    
        /**
         * <p>
         * Given a set of polynomial coefficients, compute the roots of the polynomial.  Depending on
         * the polynomial being considered the roots may contain complex number.  When complex numbers are
         * present they will come in pairs of complex conjugates.
         * </p>
         *
         * @param coefficients Coefficients of the polynomial.
         * @return The roots of the polynomial
         */
        public static Complex64F[] findRoots(double... coefficients) {
            int N = coefficients.length-1;
    
            // Construct the companion matrix
            DenseMatrix64F c = new DenseMatrix64F(N,N);
    
            double a = coefficients[N];
            for( int i = 0; i < N; i++ ) {
                c.set(i,N-1,-coefficients[i]/a);
            }
            for( int i = 1; i < N; i++ ) {
                c.set(i,i-1,1);
            }
    
            // Use generalized eigenvalue decomposition to find the roots
            EigenDecomposition<DenseMatrix64F> evd =  DecompositionFactory.eigGeneral(N, false);
    
            evd.decompose(c);
    
            Complex64F[] roots = new Complex64F[N];
    
            for( int i = 0; i < N; i++ ) {
                roots[i] = evd.getEigenvalue(i);
            }
    
            return roots;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find a flexible solution for access control in PHP. In the
I need to find the mode EXE/DLL was build looking at its headers. (Using
I have a project to build, where I need find some particular installed application
I need find the weeks list between 2 dates. I have startdate and enddate
I need find element position in list (as the built-in predicate nth, but here
I have two CString s1 and CString s2 . I need find the last
I have the html page, and me need find some elements with tag a
Need to find the timestamp for the first minute of the first day of
i need to find out automationid for key board values? how to send keystrokes
I need to find all the occurences of a file Test.TXT in c:\ or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.