Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–176 unchanged (176 lines)
177 public double density(final double[] vals) throws DimensionMismatchException {
178 final int dim = getDimension();
179 if (vals.length != dim) {
180 throw new DimensionMismatchException(vals.length, dim);
181 }
182
183 return FastMath.pow(2 * FastMath.PI, -dim / 2) *
184 FastMath.pow(covarianceMatrixDeterminant, -0.5) *
185 getExponentTerm(vals);
186 }
187
188 /**
189 * Gets the square root of each element on the diagonal of the covariance
…lines 190–241 unchanged (52 lines)

After

…lines 1–176 unchanged (176 lines)
177 public double density(final double[] vals) throws DimensionMismatchException {
178 final int dim = getDimension();
179 if (vals.length != dim) {
180 throw new DimensionMismatchException(vals.length, dim);
181 }
182
183 return FastMath.pow(2 * FastMath.PI, -0.5 * dim) *
184 FastMath.pow(covarianceMatrixDeterminant, -0.5) *
185 getExponentTerm(vals);
186 }
187
188 /**
189 * Gets the square root of each element on the diagonal of the covariance
…lines 190–241 unchanged (52 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "distribution"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "exception"
. "."
identifier "DimensionMismatchException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "Array2DRowRealMatrix"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "EigenDecomposition"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "NonPositiveDefiniteMatrixException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "RealMatrix"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "SingularMatrixException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "random"
. "."
identifier "RandomGenerator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "random"
. "."
identifier "Well19937c"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "FastMath"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "MathArrays"
; ";"
block_comment "/**\n * Implementation of the multivariate normal (Gaussian) "...
class_declaration
modifiers
public "public"
class "class"
identifier "MultivariateNormalDistribution"
superclass
extends "extends"
type_identifier "AbstractMultivariateRealDistribution"
class_body
{ "{"
block_comment "/** Vector of means. */"
field_declaration
modifiers
private "private"
final "final"
array_type
floating_point_type
double "double"
dimensions
[ "["
] "]"
variable_declarator
identifier "means"
; ";"
block_comment "/** Covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "covarianceMatrix"
; ";"
block_comment "/** The matrix inverse of the covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "covarianceMatrixInverse"
; ";"
block_comment "/** The determinant of the covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
floating_point_type
double "double"
variable_declarator
identifier "covarianceMatrixDeterminant"
; ";"
block_comment "/** Matrix used in computation of samples. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "samplingMatrix"
; ";"
block_comment "/**\n * Creates a multivariate normal distribution with t"...
constructor_declaration (+56 nodes collapsed)
block_comment "/**\n * Creates a multivariate normal distribution with t"...
constructor_declaration (+507 nodes collapsed)
block_comment "/**\n * Gets the mean vector.\n *\n * @return the m"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Gets the covariance matrix.\n *\n * @return"...
method_declaration (+21 nodes collapsed)
block_comment "/** {@inheritDoc} */"
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "density"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
array_type
floating_point_type
double "double"
dimensions
[ "["
] "]"
identifier "vals"
) ")"
throws
throws "throws"
type_identifier "DimensionMismatchException"
block
{ "{"
local_variable_declaration
modifiers
final "final"
integral_type
int "int"
variable_declarator
identifier "dim"
= "="
method_invocation
identifier "getDimension"
argument_list
( "("
) ")"
; ";"
if_statement (+30 nodes collapsed)
return_statement
return "return"
binary_expression
binary_expression
method_invocation
identifier "FastMath"
. "."
identifier "pow"
argument_list
( "("
binary_expression
decimal_integer_literal "2"
* "*"
field_access
identifier "FastMath"
. "."
identifier "PI"
, ","
binary_expression
unary_expression
- "-"
identifier "dim"
/ "/"
decimal_integer_literal "2"
) ")"
* "*"
method_invocation
identifier "FastMath"
. "."
identifier "pow"
argument_list
( "("
identifier "covarianceMatrixDeterminant"
, ","
unary_expression
- "-"
decimal_floating_point_literal "0.5"
) ")"
* "*"
method_invocation
identifier "getExponentTerm"
argument_list
( "("
identifier "vals"
) ")"
; ";"
} "}"
block_comment "/**\n * Gets the square root of each element on the diago"...
method_declaration (+125 nodes collapsed)
block_comment "/** {@inheritDoc} */"
method_declaration (+152 nodes collapsed)
block_comment "/**\n * Computes the term used in the exponent (see defin"...
method_declaration (+185 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "distribution"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "exception"
. "."
identifier "DimensionMismatchException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "Array2DRowRealMatrix"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "EigenDecomposition"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "NonPositiveDefiniteMatrixException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "RealMatrix"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "linear"
. "."
identifier "SingularMatrixException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "random"
. "."
identifier "RandomGenerator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "random"
. "."
identifier "Well19937c"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "FastMath"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "math3"
. "."
identifier "util"
. "."
identifier "MathArrays"
; ";"
block_comment "/**\n * Implementation of the multivariate normal (Gaussian) "...
class_declaration
modifiers
public "public"
class "class"
identifier "MultivariateNormalDistribution"
superclass
extends "extends"
type_identifier "AbstractMultivariateRealDistribution"
class_body
{ "{"
block_comment "/** Vector of means. */"
field_declaration
modifiers
private "private"
final "final"
array_type
floating_point_type
double "double"
dimensions
[ "["
] "]"
variable_declarator
identifier "means"
; ";"
block_comment "/** Covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "covarianceMatrix"
; ";"
block_comment "/** The matrix inverse of the covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "covarianceMatrixInverse"
; ";"
block_comment "/** The determinant of the covariance matrix. */"
field_declaration
modifiers
private "private"
final "final"
floating_point_type
double "double"
variable_declarator
identifier "covarianceMatrixDeterminant"
; ";"
block_comment "/** Matrix used in computation of samples. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "RealMatrix"
variable_declarator
identifier "samplingMatrix"
; ";"
block_comment "/**\n * Creates a multivariate normal distribution with t"...
constructor_declaration (+56 nodes collapsed)
block_comment "/**\n * Creates a multivariate normal distribution with t"...
constructor_declaration (+507 nodes collapsed)
block_comment "/**\n * Gets the mean vector.\n *\n * @return the m"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Gets the covariance matrix.\n *\n * @return"...
method_declaration (+21 nodes collapsed)
block_comment "/** {@inheritDoc} */"
method_declaration
modifiers
public "public"
floating_point_type
double "double"
identifier "density"
formal_parameters
( "("
formal_parameter
modifiers
final "final"
array_type
floating_point_type
double "double"
dimensions
[ "["
] "]"
identifier "vals"
) ")"
throws
throws "throws"
type_identifier "DimensionMismatchException"
block
{ "{"
local_variable_declaration
modifiers
final "final"
integral_type
int "int"
variable_declarator
identifier "dim"
= "="
method_invocation
identifier "getDimension"
argument_list
( "("
) ")"
; ";"
if_statement (+30 nodes collapsed)
return_statement
return "return"
binary_expression
binary_expression
method_invocation
identifier "FastMath"
. "."
identifier "pow"
argument_list
( "("
binary_expression
decimal_integer_literal "2"
* "*"
field_access
identifier "FastMath"
. "."
identifier "PI"
, ","
binary_expression
unary_expression
- "-"
decimal_floating_point_literal "0.5"
* "*"
identifier "dim"
) ")"
* "*"
method_invocation
identifier "FastMath"
. "."
identifier "pow"
argument_list
( "("
identifier "covarianceMatrixDeterminant"
, ","
unary_expression
- "-"
decimal_floating_point_literal "0.5"
) ")"
* "*"
method_invocation
identifier "getExponentTerm"
argument_list
( "("
identifier "vals"
) ")"
; ";"
} "}"
block_comment "/**\n * Gets the square root of each element on the diago"...
method_declaration (+125 nodes collapsed)
block_comment "/** {@inheritDoc} */"
method_declaration (+152 nodes collapsed)
block_comment "/**\n * Computes the term used in the exponent (see defin"...
method_declaration (+185 nodes collapsed)
} "}"