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

  • SEARCH
  • Home
  • 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 7515871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:57:03+00:00 2026-05-30T00:57:03+00:00

It seems that I can`t use this Apache Commons Math library in my class

  • 0

It seems that I can`t use this Apache Commons Math library in my class because I get unexpected token on matrixSim when I try to use RealMatrix in my consructor like this:

class vecGenUn
{
  double[][] prevMat;
  RealMatrix matrixSim;  //this is problematic
  int dataDim;
  int rowDim;
  double simVecMean;
  double simVecSD;
  double simVecUn;
  double sum;

  vecGenUn (double[][] tempPM)
  {
    prevMat = tempSM;
    matrixSim = new Array2DRowRealMatrix(prevMat);  //and possibly this
    dataDim = new int matrixSim.getColumnDimension();
    rowDim = new int matrixSim.getRowDimension();
    simVecMean = new double[dataDim];
    simVecSD = new double[dataDim];
    simVecUn = new double[dataDim];
    sum = new Sum();
  }

  public void vecGen()
  {
    for (int i = 0; i < dataDim; i++)
    {
      simVecMean[i] = sum.evaluate(matrixSim.getColumn(i), 0, rowDim)/rowDim
    }
  }
}

Now methods are yet to be implemented but how do I use RealMatrix data type here when I need it for all Appache math library methods but also I need to construct it from values (double array) supplied when creating this class instance.

  • 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-05-30T00:57:04+00:00Added an answer on May 30, 2026 at 12:57 am

    In the code provided, you have all sorts of compiler errors unrelated to Apache Commons Math. Fix those before trying to determine if you have problems with that library.

    Correction comments are in-line marked with (*):

    class vecGenUn
    {
      double[][] prevMat;
      RealMatrix matrixSim;  //this is problematic
      int dataDim;
      int rowDim;
      double simVecMean;
      double simVecSD;
      double simVecUn;
      double sum;
    
      vecGenUn (double[][] tempPM)
      {
        prevMat = tempSM; // (*) tempSM is undefined
        matrixSim = new Array2DRowRealMatrix(prevMat);  //and possibly this
        dataDim = new int matrixSim.getColumnDimension(); // (*) 'new int' is invalid
        rowDim = new int matrixSim.getRowDimension(); // (*) ditto
        simVecMean = new double[dataDim]; // (*) assigning an array to a scalar variable
        simVecSD = new double[dataDim]; // (*) ditto
        simVecUn = new double[dataDim]; // (*) ditto
        sum = new Sum(); // (*) assigning object to primitive
      }
    
      public void vecGen()
      {
        for (int i = 0; i < dataDim; i++)
        {
          simVecMean[i] = sum.evaluate(matrixSim.getColumn(i), 0, rowDim)/rowDim // (*) indexing a scalar variable
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that in the future, we can just use the non-beta iPhone SDK
every introduction and sample that I can find seems to use GLUT or some
I tried in Eclipse to use org.apache.commons.lang.NotImplementedException , though it seems from what I
I am trying to get the Apache Commons HttpClient library (version 3.1) to ignore
It seems that anyone can snoop on incoming/outgoing .NET web service SOAP messages just
It seems that I can't control the NSApp delegate from within a System Preferences
It seems that Visual Basic can not reference sheets according to user-modified sheet names.
I'm trying to consume a webmethod but it seems that my application can't resolve
It seems that all of the documentation I can find about OpenGL-ES says something
Mysql has two types that can hold boolean data, bit and bool. Bit(1) seems

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.