[Fwd: Re: [Fwd: covariance matrix in jama]]





-------- Original Message --------
Subject: 	Re: [Fwd: covariance matrix in jama]
Date: 	Tue, 26 May 2009 11:17:42 -0400
From: 	Sam Wilson <samwilson001@gmail.com>
Reply-To: 	samwilson001@gmail.com
To: 	boisvert@nist.gov
References: 	<4A1BED20.1030408@nist.gov>



They are private to prevent them being called by subclasses, there are a 
few solutions to your problem.

    * You could change the access modifier to protected which allows
      access to those method by subclasses.
    * You could just add the method to the matrix class.
    * You could just calculate it on the fly in your application as i am
      sure the co variance of a matrix can e calculated from partial
      answer provided by the existing method in the class.


2009/5/26 Ron Boisvert <boisvert@nist.gov <mailto:boisvert@nist.gov>>



    -------- Original Message --------
    Subject:        covariance matrix in jama
    Date:   Tue, 26 May 2009 05:31:26 -0400
    From:   Alexandros Altis <alexandros.altis@googlemail.com
    <mailto:alexandros.altis@googlemail.com>>
    Reply-To:       alexandros.altis@googlemail.com
    <mailto:alexandros.altis@googlemail.com>
    To:     boisvert@nist.gov <mailto:boisvert@nist.gov>



    Dear discussion group,

    I am new to Java/Jama. Simple task: I would like to calculate the
    covariance by "B.covar()" of a given matrix B in JAMA.

    How can I extend the Matrix class by my own method "covar()"?

    I tried inheritance. I created the class myMatrix as an extension of
    Matrix There I wanted to add the method covar(). But A,m,n of Matrix
    are not visible. Is it because A,m,n in the Matrix class are
    private? Why are they private? Do I always have to use getArray(),
    getColumnsDimension(), etc. for access?

    Thanks for your help,

    Alex









Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov