added a few UML diagrams.

The diagrams are not used in the documentation yet, they are only kept for reference and may be removed later.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1383287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2012-09-11 08:37:52 +00:00
parent 5998035a9f
commit e0557c2c89
6 changed files with 577 additions and 0 deletions

View File

@ -0,0 +1,105 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3 #ECEBD8
interface "FieldElement<T>" as FieldElement_T_ {
T add(T a)
T subtract(T a)
T negate()
T multiply(int n)
T multiply(T a)
T divide(T a)
T reciprocal()
Field<T> getField()
}
package analysis #DDEBD8
interface UnivariateFunction {
double value(double x)
}
package differentiation #DDDBD8
class DerivativeStructure {
-DerivativeStructure(DSCompiler compiler)
+DerivativeStructure(int parameters, int order, double value)
+DerivativeStructure(int parameters, int order, int index, double value)
+int getFreeParameters()
+int getOrder()
+double getValue()
+double getPartialDerivative(int[] orders)
+double taylor(double[] delta)
+int getExponent()
+DerivativeStructure compose(double[] f)
+DerivativeStructure cos()
+DerivativeStructure sin()
+DerivativeStructure exp()
+DerivativeStructure sqrt()
}
note bottom
lots of mathematical methods
and constructors ommitted for clarity
end note
class DSCompiler {
{static} +DSCompiler getCompiler(int parameters, int order)
+int getPartialDerivativeIndex(int[] orders)
+int[] getPartialDerivativeOrders(int index)
+int getFreeParameters()
+int getOrder()
+int getSize()
+void checkCompatibility(DSCompiler compiler)
+void compose(double[] operand, int operandOffset, double[] f, double[] result, int resultOffset)
+double taylor(double[] ds, int dsOffset, double[] delta)
+void add(double[] lhs, int lhsOffset, double[] rhs, int rhsOffset, double[] result, int resultOffset)
+void exp(double[] operand, int operandOffset, double[] result, int resultOffset)
}
note bottom
one compiler is built for each pair
(number of parameters, derivation order)
they are cached for efficiency
end note
interface UnivariateDifferentiable {
DerivativeStructure value(DerivativeStructure t)
}
interface UnivariateDifferentiator {
UnivariateDifferentiable differentiate(UnivariateFunction function)
}
FieldElement_T_ <.. DerivativeStructure
DerivativeStructure o--> "1" DSCompiler : delegates computation
UnivariateFunction <|.. UnivariateDifferentiable
UnivariateDifferentiable <-- UnivariateDifferentiator : creates
UnivariateDifferentiable --> DerivativeStructure : uses
end package
end package
end package
@enduml

81
src/site/design/oneD.puml Normal file
View File

@ -0,0 +1,81 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3.geometry #ECEBD8
interface Space {
+int getDimension()
+Space getSubSpace()
}
note top
Space is mainly used as a parameter
for generics and to link d-dimensional
space with (d-1)-dimensional space
end note
interface "Vector<S extends Space>" as Vector_S_ {
+Space getSpace()
+Vector getZero()
+double getNorm()
+Vector add()
+Vector subtract()
+Vector negate()
+Vector normalize()
+Vector scalarMultiply()
+boolean isNaN()
+boolean isInfinite()
+double distance()
+double dotProduct()
}
Space <-- Vector_S_
package partitioning #DDEBD8
interface "Region<S extends Space>" as Region_S_
interface "Hyperplane<S extends Space>" as Hyperplane_S_
interface "SubHyperplane<S extends Space>" as SubHyperplane_S_
end package
package euclidean #DDEBD8
package oned #DDDBD8
class Euclidean1D
class OrientedPoint
class Interval
class IntervalSet
Space <|.. Euclidean1D
Vector_S_ <|.. OrientedPoint
Region_S_ <|.. IntervalSet
end package
end package
end package
@enduml

View File

@ -0,0 +1,119 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3.geometry #ECEBD8
package partitioning #DDEBD8
abstract "AbstractSubHyperplane<S extends Space, T extends Space>" as AbstractSubHyperplane_S_T_
note left
an abstract sub-hyperplane contains
- an hyperplane defined in space S
- a region defined in space T
T being a sub-space of S
end note
interface "Hyperplane<S extends Space>" as Hyperplane_S_ {
+double getOffset(Vector point)
+boolean sameOrientationAs(Hyperplane other)
+SubHyperplane wholeHyperplane()
+Region wholeSpace()
}
interface "SubHyperplane<S extends Space>" as SubHyperplane_S_ {
+Hyperplane getHyperplane()
+boolean isEmpty()
+double getSize()
+Side side(Hyperplane hyperplane)
+SplitSubHyperplane split(Hyperplane hyperplane)
+SubHyperplane reunite(SubHyperplane other)
}
class "BSPTree<S extends Space>" as BSPTree_S_ {
+boolean insertCut(Hyperplane hyperplane)
+void setAttribute(Object attribute)
+Object getAttribute()
+void visit(BSPTreeVisitor visitor)
+BSPTree getCell(Vector point)
+BSPTree split(SubHyperplane sub)
}
interface "BSPTreeVisitor<S extends Space>" as BSPTreeVisitor_S_ {
+Order visitOrder(BSPTree node)
+void visitInternalNode(BSPTree node)
+void visitLeafNode(BSPTree node)
}
interface "Region<S extends Space>" as Region_S_ {
+boolean isEmpty()
+boolean contains(Region region)
+Location checkPoint(Vector point)
+double getBoundarySize()
+double getSize()
+Vector getBarycenter()
+Side side(Hyperplane hyperplane)
+SubHyperplane intersection(SubHyperplane sub)
}
note top
a region is a part of the space
it may be empty,
it may cover the whole space,
it may have infinite non-closed boudaries,
it may be in several disconnected sub-parts,
it may contain holes
end note
enum Location {
+INSIDE
+OUTSIDE
+BOUNDARY
}
enum Side {
+PLUS
+MINUS
+BOTH
+HYPER
}
Hyperplane_S_ "1" <--* "1" SubHyperplane_S_
SubHyperplane_S_ "0..1" <--* BSPTree_S_ : cut
BSPTree_S_ <--o BSPTree_S_ : "parent "
BSPTree_S_ o--> BSPTree_S_ : "children"
Region_S_ *--> "1" BSPTree_S_
Hyperplane_S_ <-- Region_S_
AbstractSubHyperplane_S_T_ ..|> SubHyperplane_S_
AbstractSubHyperplane_S_T_ *--> "1" Hyperplane_S_ : hyperplane
AbstractSubHyperplane_S_T_ *--> "1" Region_S_ : region
Region_S_ --> Location
Region_S_ --> Side
BSPTree_S_ <-- BSPTreeVisitor_S_ : visits
end package
end package
@enduml

102
src/site/design/solver.puml Normal file
View File

@ -0,0 +1,102 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3.differentiation.solvers #ECEBD8
enum AllowedSolution {
ANY_SIDE
LEFT_SIDE
RIGHT_SIDE
BELOW_SIDE
ABOVE_SIDE
}
interface "BaseUnivariateSolver<FUNC extends UnivariateFunction>" as BaseUnivariateSolver_FUNC_ {
+int getMaxEvaluations()
+int getEvaluations()
+double getAbsoluteAccuracy()
+double getRelativeAccuracy()
+double getFunctionValueAccuracy()
+double solve(int maxEval, FUNC f, double min, double max)
+double solve(int maxEval, FUNC f, double min, double max, double startValue)
+double solve(int maxEval, FUNC f, double startValue)
}
abstract class "BaseAbstractUnivariateSolver<FUNC extends UnivariateFunction>" as BaseAbstractUnivariateSolver_FUNC_ {
#{Abstract} double doSolve()
}
interface UnivariateSolver
abstract class AbstractUnivariateSolver
interface DifferentiableUnivariateSolver
abstract class AbstractDifferentiableUnivariateSolver
interface PolynomialSolver
abstract class AbstractPolynomialSolver
BaseUnivariateSolver_FUNC_ <|.. BaseAbstractUnivariateSolver_FUNC_
BaseUnivariateSolver_FUNC_ <|.. UnivariateSolver
UnivariateSolver <|.. AbstractUnivariateSolver
BaseAbstractUnivariateSolver_FUNC_ <|-- AbstractUnivariateSolver
BaseUnivariateSolver_FUNC_ <|.. DifferentiableUnivariateSolver
DifferentiableUnivariateSolver <|.. AbstractDifferentiableUnivariateSolver
BaseAbstractUnivariateSolver_FUNC_ <|-- AbstractDifferentiableUnivariateSolver
BaseUnivariateSolver_FUNC_ <|.. PolynomialSolver
PolynomialSolver <|.. AbstractPolynomialSolver
BaseAbstractUnivariateSolver_FUNC_ <|-- AbstractPolynomialSolver
interface "BracketedUnivariateSolver<FUNC extends UnivariateFunction>" as BracketedUnivariateSolver_FUNC_
AllowedSolution <-- BracketedUnivariateSolver_FUNC_ : solution side selector
BaseUnivariateSolver_FUNC_ <|.. BracketedUnivariateSolver_FUNC_
abstract class BaseSecantSolver
AbstractUnivariateSolver <|-- BaseSecantSolver
BracketedUnivariateSolver_FUNC_ <|.. BaseSecantSolver
BaseSecantSolver <|-- IllinoisSolver
BaseSecantSolver <|-- PegasusSolver
BaseSecantSolver <|-- RegulaFalsiSolver
AbstractUnivariateSolver <|-- BracketingNthOrderBrentSolver
BracketedUnivariateSolver_FUNC_ <|.. BracketingNthOrderBrentSolver
AbstractUnivariateSolver <|-- BrentSolver
AbstractUnivariateSolver <|-- SecantSolver
AbstractUnivariateSolver <|-- RiddersSolver
AbstractUnivariateSolver <|-- MullerSolver
AbstractUnivariateSolver <|-- MullerSolver2
AbstractDifferentiableUnivariateSolver <|-- NewtonSolver
AbstractPolynomialSolver <|-- LaguerreSolver
AbstractUnivariateSolver <|-- BisectionSolver
end package
@enduml

View File

@ -0,0 +1,86 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3.geometry #ECEBD8
interface Space {
+int getDimension()
+Space getSubSpace()
}
note top
Space is mainly used as a parameter
for generics and to link d-dimensional
space with (d-1)-dimensional space
end note
interface "Vector<S extends Space>" as Vector_S_ {
+Space getSpace()
+Vector getZero()
+double getNorm()
+Vector add()
+Vector subtract()
+Vector negate()
+Vector normalize()
+Vector scalarMultiply()
+boolean isNaN()
+boolean isInfinite()
+double distance()
+double dotProduct()
}
Space <-- Vector_S_
package partitioning #DDEBD8
interface "Region<S extends Space>" as Region_S_
interface "Hyperplane<S extends Space>" as Hyperplane_S_
interface "SubHyperplane<S extends Space>" as SubHyperplane_S_
end package
package euclidean #DDEBD8
package threed #DDDBD8
class Euclidean3D
class Vector3D
class Line
class SubLine
class Plane
class SubPlane
class PolyhedronsSet
Space <|.. Euclidean3D
Vector_S_ <|.. Vector3D
Hyperplane_S_ <|.. Plane
SubHyperplane_S_ <|.. SubPlane
Region_S_ <|.. PolyhedronsSet
end package
end package
end package
@enduml

84
src/site/design/twoD.puml Normal file
View File

@ -0,0 +1,84 @@
' Licensed to the Apache Software Foundation (ASF) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' The ASF licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
package org.apache.commons.math3.geometry #ECEBD8
interface Space {
+int getDimension()
+Space getSubSpace()
}
note top
Space is mainly used as a parameter
for generics and to link d-dimensional
space with (d-1)-dimensional space
end note
interface "Vector<S extends Space>" as Vector_S_ {
+Space getSpace()
+Vector getZero()
+double getNorm()
+Vector add()
+Vector subtract()
+Vector negate()
+Vector normalize()
+Vector scalarMultiply()
+boolean isNaN()
+boolean isInfinite()
+double distance()
+double dotProduct()
}
Space <-- Vector_S_
package partitioning #DDEBD8
interface "Region<S extends Space>" as Region_S_
interface "Hyperplane<S extends Space>" as Hyperplane_S_
interface "SubHyperplane<S extends Space>" as SubHyperplane_S_
end package
package euclidean #DDEBD8
package twod #DDDBD8
class Euclidean2D
class Vector2D
class Line
class SubLine
class PolygonsSet
Space <|.. Euclidean2D
Vector_S_ <|.. Vector2D
Hyperplane_S_ <|.. Line
SubHyperplane_S_ <|.. SubLine
Region_S_ <|.. PolygonsSet
end package
end package
end package
@enduml