Package gov.nih.mipav.model.algorithms
Class CeresSolver
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.CeresSolver
-
- Direct Known Subclasses:
CeresSolver2
,CeresSolverNISTTest
,CeresSolverTest
,DSC_MRI_toolbox
,WeibullDistribution
public abstract class CeresSolver extends java.lang.Object
This is a port of the C++ files in ceres-solver-1.14.0 under the BSD license: Ceres Solver - A fast non-linear least squares minimizer Copyright 2015 Google Inc. All rights reserved. http://ceres-solver.org/ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems. 1. Non-linear Least Squares problems with bounds constraints. 2. General unconstrained optimization problems. Please see [ceres-solver.org](http://ceres-solver.org/) for more information.- Author:
- aailb
-
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CeresSolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
AppendArrayToString(int size, double[] x, java.lang.String[] result)
boolean
ApplyOrdering(java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.OrderedGroups<double[]> ordering, CeresSolver.Program program, java.lang.String[] error)
void
BuildResidualLayout(CeresSolver.Program program, java.util.Vector<java.lang.Integer> residual_layout)
void
ComputeHouseholderVector(double[] x, double[] v, double[] beta)
void
ComputeRecursiveIndependentSetOrdering(CeresSolver.Program program, CeresSolver.OrderedGroups<double[]> ordering)
int
ComputeSchurOrdering(CeresSolver.Program program, java.util.Vector<CeresSolver.ParameterBlock> ordering)
int
ComputeStableSchurOrdering(CeresSolver.Program program, java.util.Vector<CeresSolver.ParameterBlock> ordering)
void
copyFunctionSample(CeresSolver.FunctionSample dst, CeresSolver.FunctionSample src)
CeresSolver.Evaluator
Create(CeresSolver.EvaluatorOptions options, CeresSolver.Program program, java.lang.String[] error)
CeresSolver.LinearSolver
Create(CeresSolver.LinearSolverOptions options)
CeresSolver.LineSearchDirection
Create(CeresSolver.LineSearchDirectionOptions options)
CeresSolver.LineSearch
Create(CeresSolver.LineSearchType line_search_type, CeresSolver.LineSearchOptions options, java.lang.String[] error)
CeresSolver.Minimizer
Create(CeresSolver.MinimizerType minimizer_type)
CeresSolver.ScratchEvaluatePreparer[]
Create(CeresSolver.Program program, int num_threads)
CeresSolver.TrustRegionStrategy
Create(CeresSolver.TrustRegionStrategyOptions options)
CeresSolver.BlockSparseMatrix
CreateDiagonalMatrix(double[] diagonal, java.util.Vector<CeresSolver.Block> column_blocks)
CeresSolver.EvaluateScratch[]
CreateEvaluatorScratch(CeresSolver.Program program, int num_threads)
CeresSolver.CostFunction
CreateGradientCheckingCostFunction(CeresSolver.CostFunction cost_function, java.util.Vector<CeresSolver.LocalParameterization> local_parameterizations, double relative_step_size, double relative_precision, java.lang.String extra_info, CeresSolver.GradientCheckingIterationCallback callback)
CeresSolver.ProblemImpl
CreateGradientCheckingProblemImpl(CeresSolver.ProblemImpl problem_impl, double relative_step_size, double relative_precision, CeresSolver.GradientCheckingIterationCallback callback)
CeresSolver.Graph<CeresSolver.ParameterBlock>
CreateHessianGraph(CeresSolver.Program program)
CeresSolver.LinearLeastSquaresProblem
CreateLinearLeastSquaresProblemFromId(int id)
CeresSolver.OrderedGroups<double[]>
CreateOrdering(CeresSolver.Program program)
CeresSolver.PartitionedMatrixView
createPartitionedMatrixView(CeresSolver.LinearSolverOptions options, CeresSolver.BlockSparseMatrix matrix)
(package private) CeresSolver.Preprocessor
CreatePreprocessor(CeresSolver.MinimizerType minimizer_type)
CeresSolver.BlockSparseMatrix
CreateRandomMatrix(CeresSolver.BlockSparseMatrixRandomMatrixOptions options)
CeresSolver.TripletSparseMatrix
CreateRandomMatrix(CeresSolver.TripletSparseMatrixRandomMatrixOptions options)
CeresSolver.SchurEliminatorBase
createSchurEliminatorBase(CeresSolver.LinearSolverOptions options)
CeresSolver.TripletSparseMatrix
CreateSparseDiagonalMatrix(double[] values, int num_rows)
void
DetectStructure(CeresSolver.CompressedRowBlockStructure bs, int num_eliminate_blocks, int[] row_block_size, int[] e_block_size, int[] f_block_size)
(package private) java.util.Vector<java.lang.Double>
DifferentiatePolynomial(java.util.Vector<java.lang.Double> polynomial)
boolean
DumpLinearLeastSquaresProblem(java.lang.String filename_base, CeresSolver.DumpFormatType dump_format_type, CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
boolean
DumpLinearLeastSquaresProblemToConsole(CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
boolean
DumpLinearLeastSquaresProblemToTextFile(java.lang.String filename_base, CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
void
EigenQuaternionProduct(double[] a, double[] b, double[] ab)
Constructs and initializes the quaternion \f$ w+xi+yj+zk \f$ from its four coefficients \a w, \a x, \a y and \a z.private int
EstimateWorkSizeForQR(int num_rows, int num_cols)
boolean
EvaluateCostFunction(CeresSolver.CostFunction function, java.util.Vector<double[]> parameters, java.util.Vector<CeresSolver.LocalParameterization> local_parameterizations, java.util.Vector<java.lang.Double> residuals, java.util.Vector<Jama.Matrix> jacobians, java.util.Vector<Jama.Matrix> local_jacobians)
<CostFunctor>
booleanEvaluateJacobianColumn(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int kParameterBlockSize, CostFunctor functor, int parameter_index, double delta, int num_residuals, int parameter_block_index, int parameter_block_size, double[] x_ptr, double[] residuals_at_eval_point, double[][] parameters, double[] x_plus_delta_ptr, double[] temp_residuals_ptr, double[] residuals_ptr)
<CostFunctor>
booleanEvaluateJacobianForParameterBlock(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int N0, int N1, int N2, int N3, int N4, int N5, int N6, int N7, int N8, int N9, int kParameterBlock, int kParameterBlockSize, CostFunctor functor, double[] residuals_at_eval_point, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[][] parameters, double[] jacobian)
<CostFunctor>
booleanEvaluateJacobianForParameterBlock(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int N0, int N1, int N2, int N3, int N4, int N5, int N6, int N7, int N8, int N9, int kParameterBlock, int kParameterBlockSize, CostFunctor functor, double[] residuals_at_eval_point, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[][] parameters, double[] jacobian, int jacobian_offset)
(package private) double
EvaluatePolynomial(java.util.Vector<java.lang.Double> polynomial, double x)
<CostFunctor>
booleanEvaluateRiddersJacobianColumn(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int kParameterBlockSize, CostFunctor functor, int parameter_index, double delta, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[] x_ptr, double[] residuals_at_eval_point, double[][] parameters, double[] x_plus_delta_ptr, double[] temp_residuals_ptr, double[] residuals_ptr)
boolean
ExpectClose(double x, double y, double max_abs_relative_difference)
(package private) java.util.Vector<java.lang.Double>
FindInterpolatingPolynomial(java.util.Vector<CeresSolver.FunctionSample> samples)
(package private) int
FindInvalidValue(int size, double[] x)
void
FindLinearPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> real, java.util.Vector<java.lang.Double> imaginary)
boolean
FindPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> roots_real, java.util.Vector<java.lang.Double> roots_imag)
void
FindQuadraticPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> real, java.util.Vector<java.lang.Double> imaginary)
(package private) CeresSolver.ParameterBlock
FindWithDefault(java.util.HashMap<double[],CeresSolver.ParameterBlock> collection, double[] key, CeresSolver.ParameterBlock value)
(package private) CeresSolver.CallStatistics
FindWithDefault(java.util.HashMap<java.lang.String,CeresSolver.CallStatistics> collection, java.lang.String key, CeresSolver.CallStatistics value)
abstract boolean
fitToExternalFunction(double[] a, double[] residuals, double[][] jacobian)
void
GetBestSchurTemplateSpecialization(int[] row_block_size, int[] e_block_size, int[] f_block_size)
CeresSolver.SolverOptions
GradientProblemSolverOptionsToSolverOptions(CeresSolver.GradientProblemSolverOptions options)
<Vertex> int
IndependentSetOrdering(CeresSolver.Graph<Vertex> graph, java.util.Vector<Vertex> ordering)
void
InvalidateArray(int size, double[] x)
void
InvalidateArray(int size, double[] x, int x_offset)
void
InvalidateArray(int row, int col, double[][] x)
void
InvalidateArray(int size, java.util.Vector<java.lang.Double> x)
double[][]
InvertPSDMatrix(boolean assume_full_rank, double[][] arr)
boolean
IsArrayValid(int size, double[] x)
boolean
IsArrayValid(int size, double[] x, int x_offset)
boolean
IsArrayValid(int row, int col, double[][] x)
boolean
IsArrayValid(int size, java.util.Vector<java.lang.Double> x)
boolean
IsClose(double x, double y, double relative_precision, double[] relative_error, double[] absolute_error)
boolean
IsOrderingValid(CeresSolver.Program program, CeresSolver.OrderedGroups<double[]> ordering, java.lang.String[] message)
boolean
IsSchurType(CeresSolver.LinearSolverType type)
boolean
IsSolutionUsable(CeresSolver.GradientProblemSolverSummary sum)
boolean
IsSolutionUsable(CeresSolver.SolverSummary sum)
boolean
LexicographicallyOrderResidualBlocks(int size_of_first_elimination_group, CeresSolver.Program program, java.lang.String[] error)
CeresSolver.LinearLeastSquaresProblem
LinearLeastSquaresProblem0()
CeresSolver.LinearLeastSquaresProblem
LinearLeastSquaresProblem1()
CeresSolver.LinearLeastSquaresProblem
LinearLeastSquaresProblem2()
CeresSolver.LinearLeastSquaresProblem
LinearLeastSquaresProblem3()
CeresSolver.LinearLeastSquaresProblem
LinearLeastSquaresProblem4()
CeresSolver.LinearSolverType
LinearSolverForZeroEBlocks(CeresSolver.LinearSolverType linear_solver_type)
java.lang.String
LinearSolverTypeToString(CeresSolver.LinearSolverType type)
java.lang.String
LineSearchDirectionTypeToString(CeresSolver.LineSearchDirectionType type)
(package private) java.lang.String
LineSearchInterpolationTypeToString(CeresSolver.LineSearchInterpolationType type)
(package private) java.lang.String
LineSearchTypeToString(CeresSolver.LineSearchType type)
void
MatrixMatrixMultiply(int kOperation, double[] A, int NUM_ROW_A, int NUM_COL_A, double[][] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
void
MatrixMatrixMultiply(int kOperation, double[] A, int NUM_ROW_A, int NUM_COL_A, double[] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
void
MatrixMatrixMultiply(int kOperation, double[] A, int A_start, int NUM_ROW_A, int NUM_COL_A, double[][] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
void
MatrixMatrixMultiply(int kRowA, int kColA, int kRowB, int kColB, int kOperation, double[] A, int A_start, int num_row_a, int num_col_a, double[] B, int B_start, int num_row_b, int num_col_b, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
void
MatrixTransposeMatrixMultiply(int kRowA, int kColA, int kRowB, int kColB, int kOperation, double[] A, int A_start, int num_row_a, int num_col_a, double[] B, int B_start, int num_row_b, int num_col_b, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
void
MatrixTransposeVectorMultiply(int kRowA, int kColA, int kOperation, double[] A, int Astart, int num_row_a, int num_col_a, double[] b, int bstart, double[] c, int cstart)
void
MatrixVectorMultiply(int kRowA, int kColA, int kOperation, double[] A, int Astart, int num_row_a, int num_col_a, double[] b, int bstart, double[] c, int cstart)
void
MaybeReorderSchurComplementColumnsUsingEigen(int size_of_first_elimination_group, java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.Program program)
void
MaybeReorderSchurComplementColumnsUsingSuiteSparse(CeresSolver.OrderedGroups<double[]> parameter_block_ordering, CeresSolver.Program program)
void
Minimize(CeresSolver.PreprocessedProblem pp, CeresSolver.SolverSummary summary)
void
MinimizeInterpolatingPolynomial(java.util.Vector<CeresSolver.FunctionSample> samples, double x_min, double x_max, double[] optimal_x, double[] optimal_value)
void
MinimizePolynomial(java.util.Vector<java.lang.Double> polynomial, double x_min, double x_max, double[] optimal_x, double[] optimal_value)
int
MinParameterBlock(CeresSolver.ResidualBlock residual_block, int size_of_first_elimination_group)
java.lang.String
NonlinearConjugateGradientTypeToString(CeresSolver.NonlinearConjugateGradientType type)
CeresSolver.TripletSparseMatrix
operator(CeresSolver.TripletSparseMatrix lhs, CeresSolver.TripletSparseMatrix rhs)
private void
OrderingToGroupSizes(CeresSolver.OrderedGroups<double[]> ordering, java.util.Vector<java.lang.Integer> group_sizes)
void
PostSolveSummarize(CeresSolver.PreprocessedProblem pp, CeresSolver.SolverSummary summary)
CeresSolver.PreconditionerType
PreconditionerForZeroEBlocks(CeresSolver.PreconditionerType preconditioner_type)
java.lang.String
PreconditionerTypeToString(CeresSolver.PreconditionerType type)
private void
PreSolveSummarize(CeresSolver.SolverOptions options, CeresSolver.ProblemImpl problem, CeresSolver.SolverSummary summary)
void
QuaternionProduct(double[] z, double[] w, double[] zw)
double
RandDouble()
double
RandDouble(long longSeed)
double
RandNormal()
java.util.Vector<java.lang.Double>
RemoveLeadingZeros(java.util.Vector<java.lang.Double> polynomial_in)
boolean
ReorderProgramForSchurTypeLinearSolver(CeresSolver.LinearSolverType linear_solver_type, CeresSolver.SparseLinearAlgebraLibraryType sparse_linear_algebra_library_type, java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.OrderedGroups<double[]> parameter_block_ordering, CeresSolver.Program program, java.lang.String[] error)
boolean
RunCallbacks(CeresSolver.MinimizerOptions options, CeresSolver.IterationSummary iteration_summary, CeresSolver.SolverSummary summary)
java.lang.String
SchurStructureToString(int row_block_size, int e_block_size, int f_block_size)
void
SetSummaryFinalCost(CeresSolver.GradientProblemSolverSummary summary)
void
SetSummaryFinalCost(CeresSolver.SolverSummary summary)
void
SetupCommonMinimizerOptions(CeresSolver.PreprocessedProblem pp)
void
Solve(CeresSolver.GradientProblemSolverOptions options, CeresSolver.GradientProblem problem, double[] parameters_ptr, CeresSolver.GradientProblemSolverSummary summary)
void
Solve(CeresSolver.SolverOptions options, CeresSolver.ProblemImpl problem, CeresSolver.SolverSummary summary)
private CeresSolver.LinearSolverTerminationType
SolveInPlaceUsingCholesky(int num_rows, double[][] in_lhs, double[] rhs_and_solution, java.lang.String[] message)
private CeresSolver.LinearSolverTerminationType
SolveInPlaceUsingQR(int num_rows, int num_cols, double[][] in_lhs, int work_size, double[] work, double[] rhs_and_solution, java.lang.String[] message)
<Vertex> int
StableIndependentSetOrdering(CeresSolver.Graph<Vertex> graph, java.util.Vector<Vertex> ordering)
private void
SummarizeGivenProgram(CeresSolver.Program program, CeresSolver.SolverSummary summary)
void
SummarizeReducedProgram(CeresSolver.Program program, CeresSolver.SolverSummary summary)
<T> void
swap(T el1, T el2)
private void
SymmetricRankUpdate(int num_rows, int num_cols, double[] a, boolean transpose, double alpha, double beta, double[][] c)
java.lang.String
TerminationTypeToString(CeresSolver.TerminationType type)
void
TransposeForCompressedRowSparseStructure(int num_rows, int num_cols, int num_nonzeros, int[] rows, int[] cols, double[] values, int[] transpose_rows, int[] transpose_cols, double[] transpose_values)
int
Uniform(int n)
(package private) void
WriteArrayToFileOrDie(java.lang.String filename, double[] x, int size)
void
WriteStringToFileOrDie(java.lang.String data, java.lang.String filename)
-
-
-
Field Detail
-
ge
private GeneralizedEigenvalue ge
-
ge2
private GeneralizedEigenvalue2 ge2
-
gi2
private GeneralizedInverse2 gi2
-
le
private LinearEquations le
-
le2
private LinearEquations2 le2
-
svd
public SVD svd
-
requestedLinearSolverType
private CeresSolver.LinearSolverType requestedLinearSolverType
-
MAX_LOG_LEVEL
public int MAX_LOG_LEVEL
-
FATAL
public int FATAL
-
ERROR
public int ERROR
-
WARNING
public int WARNING
-
INFO
public int INFO
-
CERES_NO_SUITESPARSE
private boolean CERES_NO_SUITESPARSE
-
CERES_NO_CXSPARSE
private boolean CERES_NO_CXSPARSE
-
SUITESPARSE_VERSION
private int SUITESPARSE_VERSION
-
CERES_USE_EIGEN_SPARSE
private boolean CERES_USE_EIGEN_SPARSE
-
kImpossibleValue
private final double kImpossibleValue
- See Also:
- Constant Field Values
-
testMode
public boolean testMode
-
epsilon
double epsilon
-
default_relstep
double default_relstep
-
m
protected int m
integer scalar containing the number of data points.
-
num_residuals_
private int num_residuals_
-
N0
protected int N0
variables integer scalar containing the number of unknowns.
-
DYNAMIC
protected int DYNAMIC
-
kLBFGSSecantConditionHessianUpdateTolerance
private final double kLBFGSSecantConditionHessianUpdateTolerance
- See Also:
- Constant Field Values
-
testCase
public int testCase
-
COST_FUNCTOR_EXAMPLE
protected final int COST_FUNCTOR_EXAMPLE
- See Also:
- Constant Field Values
-
CURVE_FITTING_EXAMPLE
protected final int CURVE_FITTING_EXAMPLE
- See Also:
- Constant Field Values
-
TEST_TERM_EXAMPLE
protected final int TEST_TERM_EXAMPLE
- See Also:
- Constant Field Values
-
GOOD_TEST_TERM_EXAMPLE
protected final int GOOD_TEST_TERM_EXAMPLE
- See Also:
- Constant Field Values
-
BAD_TEST_TERM_EXAMPLE
protected final int BAD_TEST_TERM_EXAMPLE
- See Also:
- Constant Field Values
-
LINEAR_COST_FUNCTION_EXAMPLE
protected final int LINEAR_COST_FUNCTION_EXAMPLE
- See Also:
- Constant Field Values
-
EASY_FUNCTOR_EXAMPLE
protected final int EASY_FUNCTOR_EXAMPLE
- See Also:
- Constant Field Values
-
EASY_COST_FUNCTION
protected final int EASY_COST_FUNCTION
- See Also:
- Constant Field Values
-
TRANSCENDENTAL_FUNCTOR
protected final int TRANSCENDENTAL_FUNCTOR
- See Also:
- Constant Field Values
-
TRANSCENDENTAL_COST_FUNCTION
protected final int TRANSCENDENTAL_COST_FUNCTION
- See Also:
- Constant Field Values
-
SIZE_TESTING_COST_FUNCTION
protected final int SIZE_TESTING_COST_FUNCTION
- See Also:
- Constant Field Values
-
EXPONENTIAL_FUNCTOR
protected final int EXPONENTIAL_FUNCTOR
- See Also:
- Constant Field Values
-
EXPONENTIAL_COST_FUNCTION
protected final int EXPONENTIAL_COST_FUNCTION
- See Also:
- Constant Field Values
-
RANDOMIZED_FUNCTOR
protected final int RANDOMIZED_FUNCTOR
- See Also:
- Constant Field Values
-
RANDOMIZED_COST_FUNCTION
protected final int RANDOMIZED_COST_FUNCTION
- See Also:
- Constant Field Values
-
ONLY_FILLS_ONE_OUTPUT_FUNCTOR
protected final int ONLY_FILLS_ONE_OUTPUT_FUNCTOR
- See Also:
- Constant Field Values
-
MY_COST_FUNCTOR
protected final int MY_COST_FUNCTOR
- See Also:
- Constant Field Values
-
MY_THREE_PARAMETER_COST_FUNCTOR
protected final int MY_THREE_PARAMETER_COST_FUNCTOR
- See Also:
- Constant Field Values
-
optionsValid
protected boolean optionsValid
-
curveFittingObservations
protected final int curveFittingObservations
- See Also:
- Constant Field Values
-
curveFittingData
protected double[] curveFittingData
-
-
Method Detail
-
ExpectClose
public boolean ExpectClose(double x, double y, double max_abs_relative_difference)
-
Solve
public void Solve(CeresSolver.SolverOptions options, CeresSolver.ProblemImpl problem, CeresSolver.SolverSummary summary)
-
GetBestSchurTemplateSpecialization
public void GetBestSchurTemplateSpecialization(int[] row_block_size, int[] e_block_size, int[] f_block_size)
-
SchurStructureToString
public java.lang.String SchurStructureToString(int row_block_size, int e_block_size, int f_block_size)
-
DetectStructure
public void DetectStructure(CeresSolver.CompressedRowBlockStructure bs, int num_eliminate_blocks, int[] row_block_size, int[] e_block_size, int[] f_block_size)
-
PostSolveSummarize
public void PostSolveSummarize(CeresSolver.PreprocessedProblem pp, CeresSolver.SolverSummary summary)
-
SummarizeReducedProgram
public void SummarizeReducedProgram(CeresSolver.Program program, CeresSolver.SolverSummary summary)
-
SetSummaryFinalCost
public void SetSummaryFinalCost(CeresSolver.SolverSummary summary)
-
SetSummaryFinalCost
public void SetSummaryFinalCost(CeresSolver.GradientProblemSolverSummary summary)
-
Minimize
public void Minimize(CeresSolver.PreprocessedProblem pp, CeresSolver.SolverSummary summary)
-
IsSchurType
public boolean IsSchurType(CeresSolver.LinearSolverType type)
-
CreatePreprocessor
CeresSolver.Preprocessor CreatePreprocessor(CeresSolver.MinimizerType minimizer_type)
-
swap
public <T> void swap(T el1, T el2)
-
ReorderProgramForSchurTypeLinearSolver
public boolean ReorderProgramForSchurTypeLinearSolver(CeresSolver.LinearSolverType linear_solver_type, CeresSolver.SparseLinearAlgebraLibraryType sparse_linear_algebra_library_type, java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.OrderedGroups<double[]> parameter_block_ordering, CeresSolver.Program program, java.lang.String[] error)
-
MinParameterBlock
public int MinParameterBlock(CeresSolver.ResidualBlock residual_block, int size_of_first_elimination_group)
-
LexicographicallyOrderResidualBlocks
public boolean LexicographicallyOrderResidualBlocks(int size_of_first_elimination_group, CeresSolver.Program program, java.lang.String[] error)
-
MaybeReorderSchurComplementColumnsUsingSuiteSparse
public void MaybeReorderSchurComplementColumnsUsingSuiteSparse(CeresSolver.OrderedGroups<double[]> parameter_block_ordering, CeresSolver.Program program)
-
MaybeReorderSchurComplementColumnsUsingEigen
public void MaybeReorderSchurComplementColumnsUsingEigen(int size_of_first_elimination_group, java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.Program program)
-
ApplyOrdering
public boolean ApplyOrdering(java.util.HashMap<double[],CeresSolver.ParameterBlock> parameter_map, CeresSolver.OrderedGroups<double[]> ordering, CeresSolver.Program program, java.lang.String[] error)
-
CreateHessianGraph
public CeresSolver.Graph<CeresSolver.ParameterBlock> CreateHessianGraph(CeresSolver.Program program)
-
ComputeSchurOrdering
public int ComputeSchurOrdering(CeresSolver.Program program, java.util.Vector<CeresSolver.ParameterBlock> ordering)
-
ComputeStableSchurOrdering
public int ComputeStableSchurOrdering(CeresSolver.Program program, java.util.Vector<CeresSolver.ParameterBlock> ordering)
-
IndependentSetOrdering
public <Vertex> int IndependentSetOrdering(CeresSolver.Graph<Vertex> graph, java.util.Vector<Vertex> ordering)
-
StableIndependentSetOrdering
public <Vertex> int StableIndependentSetOrdering(CeresSolver.Graph<Vertex> graph, java.util.Vector<Vertex> ordering)
-
LinearSolverTypeToString
public java.lang.String LinearSolverTypeToString(CeresSolver.LinearSolverType type)
-
PreconditionerTypeToString
public java.lang.String PreconditionerTypeToString(CeresSolver.PreconditionerType type)
-
PreconditionerForZeroEBlocks
public CeresSolver.PreconditionerType PreconditionerForZeroEBlocks(CeresSolver.PreconditionerType preconditioner_type)
-
SetupCommonMinimizerOptions
public void SetupCommonMinimizerOptions(CeresSolver.PreprocessedProblem pp)
-
CreateDiagonalMatrix
public CeresSolver.BlockSparseMatrix CreateDiagonalMatrix(double[] diagonal, java.util.Vector<CeresSolver.Block> column_blocks)
-
CreateRandomMatrix
public CeresSolver.BlockSparseMatrix CreateRandomMatrix(CeresSolver.BlockSparseMatrixRandomMatrixOptions options)
-
operator
public CeresSolver.TripletSparseMatrix operator(CeresSolver.TripletSparseMatrix lhs, CeresSolver.TripletSparseMatrix rhs)
-
CreateSparseDiagonalMatrix
public CeresSolver.TripletSparseMatrix CreateSparseDiagonalMatrix(double[] values, int num_rows)
-
CreateRandomMatrix
public CeresSolver.TripletSparseMatrix CreateRandomMatrix(CeresSolver.TripletSparseMatrixRandomMatrixOptions options)
-
Uniform
public int Uniform(int n)
-
RandDouble
public double RandDouble()
-
RandDouble
public double RandDouble(long longSeed)
-
RandNormal
public double RandNormal()
-
TransposeForCompressedRowSparseStructure
public void TransposeForCompressedRowSparseStructure(int num_rows, int num_cols, int num_nonzeros, int[] rows, int[] cols, double[] values, int[] transpose_rows, int[] transpose_cols, double[] transpose_values)
-
Create
public CeresSolver.LinearSolver Create(CeresSolver.LinearSolverOptions options)
-
EstimateWorkSizeForQR
private int EstimateWorkSizeForQR(int num_rows, int num_cols)
-
SymmetricRankUpdate
private void SymmetricRankUpdate(int num_rows, int num_cols, double[] a, boolean transpose, double alpha, double beta, double[][] c)
-
SolveInPlaceUsingQR
private CeresSolver.LinearSolverTerminationType SolveInPlaceUsingQR(int num_rows, int num_cols, double[][] in_lhs, int work_size, double[] work, double[] rhs_and_solution, java.lang.String[] message)
-
SolveInPlaceUsingCholesky
private CeresSolver.LinearSolverTerminationType SolveInPlaceUsingCholesky(int num_rows, double[][] in_lhs, double[] rhs_and_solution, java.lang.String[] message)
-
InvertPSDMatrix
public double[][] InvertPSDMatrix(boolean assume_full_rank, double[][] arr)
-
createSchurEliminatorBase
public CeresSolver.SchurEliminatorBase createSchurEliminatorBase(CeresSolver.LinearSolverOptions options)
-
createPartitionedMatrixView
public CeresSolver.PartitionedMatrixView createPartitionedMatrixView(CeresSolver.LinearSolverOptions options, CeresSolver.BlockSparseMatrix matrix)
-
LinearSolverForZeroEBlocks
public CeresSolver.LinearSolverType LinearSolverForZeroEBlocks(CeresSolver.LinearSolverType linear_solver_type)
-
Create
public CeresSolver.Evaluator Create(CeresSolver.EvaluatorOptions options, CeresSolver.Program program, java.lang.String[] error)
-
Create
public CeresSolver.ScratchEvaluatePreparer[] Create(CeresSolver.Program program, int num_threads)
-
CreateEvaluatorScratch
public CeresSolver.EvaluateScratch[] CreateEvaluatorScratch(CeresSolver.Program program, int num_threads)
-
BuildResidualLayout
public void BuildResidualLayout(CeresSolver.Program program, java.util.Vector<java.lang.Integer> residual_layout)
-
IsOrderingValid
public boolean IsOrderingValid(CeresSolver.Program program, CeresSolver.OrderedGroups<double[]> ordering, java.lang.String[] message)
-
CreateOrdering
public CeresSolver.OrderedGroups<double[]> CreateOrdering(CeresSolver.Program program)
-
ComputeRecursiveIndependentSetOrdering
public void ComputeRecursiveIndependentSetOrdering(CeresSolver.Program program, CeresSolver.OrderedGroups<double[]> ordering)
-
Create
public CeresSolver.LineSearch Create(CeresSolver.LineSearchType line_search_type, CeresSolver.LineSearchOptions options, java.lang.String[] error)
-
copyFunctionSample
public void copyFunctionSample(CeresSolver.FunctionSample dst, CeresSolver.FunctionSample src)
-
Create
public CeresSolver.TrustRegionStrategy Create(CeresSolver.TrustRegionStrategyOptions options)
-
RemoveLeadingZeros
public java.util.Vector<java.lang.Double> RemoveLeadingZeros(java.util.Vector<java.lang.Double> polynomial_in)
-
FindLinearPolynomialRoots
public void FindLinearPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> real, java.util.Vector<java.lang.Double> imaginary)
-
FindQuadraticPolynomialRoots
public void FindQuadraticPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> real, java.util.Vector<java.lang.Double> imaginary)
-
CreateLinearLeastSquaresProblemFromId
public CeresSolver.LinearLeastSquaresProblem CreateLinearLeastSquaresProblemFromId(int id)
-
LinearLeastSquaresProblem0
public CeresSolver.LinearLeastSquaresProblem LinearLeastSquaresProblem0()
-
LinearLeastSquaresProblem1
public CeresSolver.LinearLeastSquaresProblem LinearLeastSquaresProblem1()
-
LinearLeastSquaresProblem2
public CeresSolver.LinearLeastSquaresProblem LinearLeastSquaresProblem2()
-
LinearLeastSquaresProblem3
public CeresSolver.LinearLeastSquaresProblem LinearLeastSquaresProblem3()
-
LinearLeastSquaresProblem4
public CeresSolver.LinearLeastSquaresProblem LinearLeastSquaresProblem4()
-
DumpLinearLeastSquaresProblem
public boolean DumpLinearLeastSquaresProblem(java.lang.String filename_base, CeresSolver.DumpFormatType dump_format_type, CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
-
DumpLinearLeastSquaresProblemToConsole
public boolean DumpLinearLeastSquaresProblemToConsole(CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
-
WriteArrayToFileOrDie
void WriteArrayToFileOrDie(java.lang.String filename, double[] x, int size)
-
WriteStringToFileOrDie
public void WriteStringToFileOrDie(java.lang.String data, java.lang.String filename)
-
DumpLinearLeastSquaresProblemToTextFile
public boolean DumpLinearLeastSquaresProblemToTextFile(java.lang.String filename_base, CeresSolver.SparseMatrix A, double[] D, double[] b, double[] x, int num_eliminate_blocks)
-
Create
public CeresSolver.Minimizer Create(CeresSolver.MinimizerType minimizer_type)
-
NonlinearConjugateGradientTypeToString
public java.lang.String NonlinearConjugateGradientTypeToString(CeresSolver.NonlinearConjugateGradientType type)
-
Create
public CeresSolver.LineSearchDirection Create(CeresSolver.LineSearchDirectionOptions options)
-
LineSearchDirectionTypeToString
public java.lang.String LineSearchDirectionTypeToString(CeresSolver.LineSearchDirectionType type)
-
RunCallbacks
public boolean RunCallbacks(CeresSolver.MinimizerOptions options, CeresSolver.IterationSummary iteration_summary, CeresSolver.SolverSummary summary)
-
CreateGradientCheckingProblemImpl
public CeresSolver.ProblemImpl CreateGradientCheckingProblemImpl(CeresSolver.ProblemImpl problem_impl, double relative_step_size, double relative_precision, CeresSolver.GradientCheckingIterationCallback callback)
-
PreSolveSummarize
private void PreSolveSummarize(CeresSolver.SolverOptions options, CeresSolver.ProblemImpl problem, CeresSolver.SolverSummary summary)
-
OrderingToGroupSizes
private void OrderingToGroupSizes(CeresSolver.OrderedGroups<double[]> ordering, java.util.Vector<java.lang.Integer> group_sizes)
-
SummarizeGivenProgram
private void SummarizeGivenProgram(CeresSolver.Program program, CeresSolver.SolverSummary summary)
-
EvaluateJacobianForParameterBlock
public <CostFunctor> boolean EvaluateJacobianForParameterBlock(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int N0, int N1, int N2, int N3, int N4, int N5, int N6, int N7, int N8, int N9, int kParameterBlock, int kParameterBlockSize, CostFunctor functor, double[] residuals_at_eval_point, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[][] parameters, double[] jacobian)
-
EvaluateJacobianForParameterBlock
public <CostFunctor> boolean EvaluateJacobianForParameterBlock(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int N0, int N1, int N2, int N3, int N4, int N5, int N6, int N7, int N8, int N9, int kParameterBlock, int kParameterBlockSize, CostFunctor functor, double[] residuals_at_eval_point, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[][] parameters, double[] jacobian, int jacobian_offset)
-
EvaluateJacobianColumn
public <CostFunctor> boolean EvaluateJacobianColumn(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int kParameterBlockSize, CostFunctor functor, int parameter_index, double delta, int num_residuals, int parameter_block_index, int parameter_block_size, double[] x_ptr, double[] residuals_at_eval_point, double[][] parameters, double[] x_plus_delta_ptr, double[] temp_residuals_ptr, double[] residuals_ptr)
-
EvaluateRiddersJacobianColumn
public <CostFunctor> boolean EvaluateRiddersJacobianColumn(CeresSolver.NumericDiffMethodType kMethod, int kNumResiduals, int kParameterBlockSize, CostFunctor functor, int parameter_index, double delta, CeresSolver.NumericDiffOptions options, int num_residuals, int parameter_block_index, int parameter_block_size, double[] x_ptr, double[] residuals_at_eval_point, double[][] parameters, double[] x_plus_delta_ptr, double[] temp_residuals_ptr, double[] residuals_ptr)
-
QuaternionProduct
public void QuaternionProduct(double[] z, double[] w, double[] zw)
-
EigenQuaternionProduct
public void EigenQuaternionProduct(double[] a, double[] b, double[] ab)
Constructs and initializes the quaternion \f$ w+xi+yj+zk \f$ from its four coefficients \a w, \a x, \a y and \a z. \warning Note the order of the arguments: the real \a w coefficient first, while internally the coefficients are stored in the following order: [\c x, \c y, \c z, \c w]
-
ComputeHouseholderVector
public void ComputeHouseholderVector(double[] x, double[] v, double[] beta)
-
IsSolutionUsable
public boolean IsSolutionUsable(CeresSolver.SolverSummary sum)
-
TerminationTypeToString
public java.lang.String TerminationTypeToString(CeresSolver.TerminationType type)
-
CreateGradientCheckingCostFunction
public CeresSolver.CostFunction CreateGradientCheckingCostFunction(CeresSolver.CostFunction cost_function, java.util.Vector<CeresSolver.LocalParameterization> local_parameterizations, double relative_step_size, double relative_precision, java.lang.String extra_info, CeresSolver.GradientCheckingIterationCallback callback)
-
EvaluateCostFunction
public boolean EvaluateCostFunction(CeresSolver.CostFunction function, java.util.Vector<double[]> parameters, java.util.Vector<CeresSolver.LocalParameterization> local_parameterizations, java.util.Vector<java.lang.Double> residuals, java.util.Vector<Jama.Matrix> jacobians, java.util.Vector<Jama.Matrix> local_jacobians)
-
IsClose
public boolean IsClose(double x, double y, double relative_precision, double[] relative_error, double[] absolute_error)
-
InvalidateArray
public void InvalidateArray(int size, double[] x)
-
InvalidateArray
public void InvalidateArray(int size, double[] x, int x_offset)
-
InvalidateArray
public void InvalidateArray(int row, int col, double[][] x)
-
InvalidateArray
public void InvalidateArray(int size, java.util.Vector<java.lang.Double> x)
-
IsArrayValid
public boolean IsArrayValid(int size, double[] x)
-
IsArrayValid
public boolean IsArrayValid(int size, double[] x, int x_offset)
-
IsArrayValid
public boolean IsArrayValid(int row, int col, double[][] x)
-
IsArrayValid
public boolean IsArrayValid(int size, java.util.Vector<java.lang.Double> x)
-
FindInvalidValue
int FindInvalidValue(int size, double[] x)
-
AppendArrayToString
public void AppendArrayToString(int size, double[] x, java.lang.String[] result)
-
MatrixTransposeVectorMultiply
public void MatrixTransposeVectorMultiply(int kRowA, int kColA, int kOperation, double[] A, int Astart, int num_row_a, int num_col_a, double[] b, int bstart, double[] c, int cstart)
-
MatrixVectorMultiply
public void MatrixVectorMultiply(int kRowA, int kColA, int kOperation, double[] A, int Astart, int num_row_a, int num_col_a, double[] b, int bstart, double[] c, int cstart)
-
MatrixTransposeMatrixMultiply
public void MatrixTransposeMatrixMultiply(int kRowA, int kColA, int kRowB, int kColB, int kOperation, double[] A, int A_start, int num_row_a, int num_col_a, double[] B, int B_start, int num_row_b, int num_col_b, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
-
MatrixMatrixMultiply
public void MatrixMatrixMultiply(int kRowA, int kColA, int kRowB, int kColB, int kOperation, double[] A, int A_start, int num_row_a, int num_col_a, double[] B, int B_start, int num_row_b, int num_col_b, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
-
MatrixMatrixMultiply
public void MatrixMatrixMultiply(int kOperation, double[] A, int NUM_ROW_A, int NUM_COL_A, double[] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
-
MatrixMatrixMultiply
public void MatrixMatrixMultiply(int kOperation, double[] A, int NUM_ROW_A, int NUM_COL_A, double[][] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
-
MatrixMatrixMultiply
public void MatrixMatrixMultiply(int kOperation, double[] A, int A_start, int NUM_ROW_A, int NUM_COL_A, double[][] B, int NUM_ROW_B, int NUM_COL_B, double[] C, int C_start, int start_row_c, int start_col_c, int row_stride_c, int col_stride_c)
-
LineSearchTypeToString
java.lang.String LineSearchTypeToString(CeresSolver.LineSearchType type)
-
LineSearchInterpolationTypeToString
java.lang.String LineSearchInterpolationTypeToString(CeresSolver.LineSearchInterpolationType type)
-
FindWithDefault
CeresSolver.ParameterBlock FindWithDefault(java.util.HashMap<double[],CeresSolver.ParameterBlock> collection, double[] key, CeresSolver.ParameterBlock value)
-
FindWithDefault
CeresSolver.CallStatistics FindWithDefault(java.util.HashMap<java.lang.String,CeresSolver.CallStatistics> collection, java.lang.String key, CeresSolver.CallStatistics value)
-
MinimizeInterpolatingPolynomial
public void MinimizeInterpolatingPolynomial(java.util.Vector<CeresSolver.FunctionSample> samples, double x_min, double x_max, double[] optimal_x, double[] optimal_value)
-
MinimizePolynomial
public void MinimizePolynomial(java.util.Vector<java.lang.Double> polynomial, double x_min, double x_max, double[] optimal_x, double[] optimal_value)
-
DifferentiatePolynomial
java.util.Vector<java.lang.Double> DifferentiatePolynomial(java.util.Vector<java.lang.Double> polynomial)
-
EvaluatePolynomial
double EvaluatePolynomial(java.util.Vector<java.lang.Double> polynomial, double x)
-
FindInterpolatingPolynomial
java.util.Vector<java.lang.Double> FindInterpolatingPolynomial(java.util.Vector<CeresSolver.FunctionSample> samples)
-
FindPolynomialRoots
public boolean FindPolynomialRoots(java.util.Vector<java.lang.Double> polynomial, java.util.Vector<java.lang.Double> roots_real, java.util.Vector<java.lang.Double> roots_imag)
-
GradientProblemSolverOptionsToSolverOptions
public CeresSolver.SolverOptions GradientProblemSolverOptionsToSolverOptions(CeresSolver.GradientProblemSolverOptions options)
-
IsSolutionUsable
public boolean IsSolutionUsable(CeresSolver.GradientProblemSolverSummary sum)
-
Solve
public void Solve(CeresSolver.GradientProblemSolverOptions options, CeresSolver.GradientProblem problem, double[] parameters_ptr, CeresSolver.GradientProblemSolverSummary summary)
-
fitToExternalFunction
public abstract boolean fitToExternalFunction(double[] a, double[] residuals, double[][] jacobian)
-
-